feat(emitter): emit dummy SPDX identifier (#47) #92
clippy
33 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 33 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.73.0 (cc66ad468 2023-10-03)
- cargo 1.73.0 (9c4383fb5 2023-08-26)
- clippy 0.1.73 (cc66ad4 2023-10-03)
Annotations
Check warning on line 53 in src/check/violation.rs
github-actions / clippy
this seems like a manual implementation of the non-exhaustive pattern
warning: this seems like a manual implementation of the non-exhaustive pattern
--> src/check/violation.rs:33:1
|
33 | pub(crate) enum ViolationKind {
| ^----------------------------
| |
| _help: add the attribute: `#[non_exhaustive] pub(crate) enum ViolationKind`
| |
34 | | /// The corresponding Solidity file does not exist.
35 | | FileMissing(String),
36 | | /// Couldn't read the corresponding Solidity file.
... |
52 | | __Nonexhaustive,
53 | | }
| |_^
|
help: remove this variant
--> src/check/violation.rs:52:5
|
52 | __Nonexhaustive,
| ^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_non_exhaustive
= note: `#[warn(clippy::manual_non_exhaustive)]` implied by `#[warn(clippy::all)]`
Check warning on line 65 in src/error.rs
github-actions / clippy
wildcard matches only a single variant and will also match any future added variants
warning: wildcard matches only a single variant and will also match any future added variants
--> src/error.rs:65:13
|
65 | _ => unreachable!(),
| ^ help: try: `Self::__Nonexhaustive`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_wildcard_for_single_variants
Check warning on line 14 in src/syntax/mod.rs
github-actions / clippy
docs for function returning `Result` missing `# Errors` section
warning: docs for function returning `Result` missing `# Errors` section
--> src/syntax/mod.rs:14:1
|
14 | pub fn parse(text: &str) -> crate::error::Result<ast::Ast> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Check warning on line 26 in src/syntax/visitor.rs
github-actions / clippy
docs for function returning `Result` missing `# Errors` section
warning: docs for function returning `Result` missing `# Errors` section
--> src/syntax/visitor.rs:23:5
|
23 | / fn visit_description(
24 | | &mut self,
25 | | description: &ast::Description,
26 | | ) -> Result<Self::Output, Self::Error>;
| |___________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Check warning on line 21 in src/syntax/visitor.rs
github-actions / clippy
docs for function returning `Result` missing `# Errors` section
warning: docs for function returning `Result` missing `# Errors` section
--> src/syntax/visitor.rs:21:5
|
21 | fn visit_action(&mut self, action: &ast::Action) -> Result<Self::Output, Self::Error>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Check warning on line 19 in src/syntax/visitor.rs
github-actions / clippy
docs for function returning `Result` missing `# Errors` section
warning: docs for function returning `Result` missing `# Errors` section
--> src/syntax/visitor.rs:19:5
|
19 | fn visit_condition(&mut self, condition: &ast::Condition) -> Result<Self::Output, Self::Error>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Check warning on line 17 in src/syntax/visitor.rs
github-actions / clippy
docs for function returning `Result` missing `# Errors` section
warning: docs for function returning `Result` missing `# Errors` section
--> src/syntax/visitor.rs:17:5
|
17 | fn visit_root(&mut self, root: &ast::Root) -> Result<Self::Output, Self::Error>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Check warning on line 156 in src/syntax/tokenizer.rs
github-actions / clippy
docs for function returning `Result` missing `# Errors` section
warning: docs for function returning `Result` missing `# Errors` section
--> src/syntax/tokenizer.rs:156:5
|
156 | pub fn tokenize(&mut self, text: &str) -> Result<Vec<Token>> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Check warning on line 69 in src/syntax/tokenizer.rs
github-actions / clippy
wildcard matches only a single variant and will also match any future added variants
warning: wildcard matches only a single variant and will also match any future added variants
--> src/syntax/tokenizer.rs:69:13
|
69 | _ => unreachable!(),
| ^ help: try: `__Nonexhaustive`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_wildcard_for_single_variants
Check warning on line 118 in src/syntax/semantics.rs
github-actions / clippy
docs for function returning `Result` missing `# Errors` section
warning: docs for function returning `Result` missing `# Errors` section
--> src/syntax/semantics.rs:118:5
|
118 | pub fn analyze(&mut self, ast: &ast::Ast) -> Result<()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Check warning on line 118 in src/syntax/semantics.rs
github-actions / clippy
docs for function which may panic missing `# Panics` section
warning: docs for function which may panic missing `# Panics` section
--> src/syntax/semantics.rs:118:5
|
118 | pub fn analyze(&mut self, ast: &ast::Ast) -> Result<()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: first possible panic found here
--> src/syntax/semantics.rs:119:9
|
119 | / match ast {
120 | | Ast::Root(root) => self.visit_root(root),
121 | | Ast::Condition(condition) => self.visit_condition(condition),
122 | | Ast::Action(action) => self.visit_action(action),
... |
126 | | // be stored in `self.errors`.
127 | | .unwrap();
| |_________________^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
Check warning on line 81 in src/syntax/semantics.rs
github-actions / clippy
wildcard matches only a single variant and will also match any future added variants
warning: wildcard matches only a single variant and will also match any future added variants
--> src/syntax/semantics.rs:81:13
|
81 | _ => unreachable!(),
| ^ help: try: `__Nonexhaustive`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_wildcard_for_single_variants
Check warning on line 140 in src/syntax/parser.rs
github-actions / clippy
docs for function returning `Result` missing `# Errors` section
warning: docs for function returning `Result` missing `# Errors` section
--> src/syntax/parser.rs:140:5
|
140 | pub fn parse(&mut self, text: &str, tokens: &[Token]) -> Result<Ast> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Check warning on line 112 in src/syntax/parser.rs
github-actions / clippy
wildcard matches only a single variant and will also match any future added variants
warning: wildcard matches only a single variant and will also match any future added variants
--> src/syntax/parser.rs:112:13
|
112 | _ => unreachable!(),
| ^ help: try: `__Nonexhaustive`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_wildcard_for_single_variants
Check warning on line 96 in src/syntax/parser.rs
github-actions / clippy
usage of wildcard import for enum variants
warning: usage of wildcard import for enum variants
--> src/syntax/parser.rs:96:13
|
96 | use self::ErrorKind::*;
| ^^^^^^^^^^^^^^^^^^ help: try: `self::ErrorKind::{CornerNotLastChild, DescriptionTokenUnexpected, EofUnexpected, GivenUnexpected, ItUnexpected, TeeLastChild, TitleMissing, TokenUnexpected, TreeEmpty, TreeRootless, WhenUnexpected, WordUnexpected}`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_glob_use
= note: `#[warn(clippy::enum_glob_use)]` implied by `#[warn(clippy::pedantic)]`
Check warning on line 130 in src/scaffold/mod.rs
github-actions / clippy
docs for function returning `Result` missing `# Errors` section
warning: docs for function returning `Result` missing `# Errors` section
--> src/scaffold/mod.rs:130:5
|
130 | pub fn scaffold(&self, text: &str) -> crate::error::Result<String> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Check warning on line 54 in src/scaffold/mod.rs
github-actions / clippy
docs for function returning `Result` missing `# Errors` section
warning: docs for function returning `Result` missing `# Errors` section
--> src/scaffold/mod.rs:54:5
|
54 | pub fn run(self) -> anyhow::Result<()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Check warning on line 39 in src/scaffold/modifiers.rs
github-actions / clippy
docs for function which may panic missing `# Panics` section
warning: docs for function which may panic missing `# Panics` section
--> src/scaffold/modifiers.rs:39:5
|
39 | pub fn discover(&mut self, ast: &Ast) -> &IndexMap<String, String> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: first possible panic found here
--> src/scaffold/modifiers.rs:42:17
|
42 | self.visit_root(root).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
= note: `#[warn(clippy::missing_panics_doc)]` implied by `#[warn(clippy::pedantic)]`
Check warning on line 159 in src/scaffold/emitter.rs
github-actions / clippy
useless use of `format!`
warning: useless use of `format!`
--> src/scaffold/emitter.rs:159:27
|
159 | emitted.push_str(&format!("// SPDX-License-Identifier: UNLICENSED\n").as_str());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"// SPDX-License-Identifier: UNLICENSED\n".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format
= note: `#[warn(clippy::useless_format)]` implied by `#[warn(clippy::all)]`
Check warning on line 159 in src/scaffold/emitter.rs
github-actions / clippy
this expression creates a reference which is immediately dereferenced by the compiler
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/scaffold/emitter.rs:159:26
|
159 | emitted.push_str(&format!("// SPDX-License-Identifier: UNLICENSED\n").as_str());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("// SPDX-License-Identifier: UNLICENSED\n").as_str()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` implied by `#[warn(clippy::all)]`
Check warning on line 78 in src/scaffold/emitter.rs
github-actions / clippy
unused `self` argument
warning: unused `self` argument
--> src/scaffold/emitter.rs:78:29
|
78 | fn emit_contract_header(&self, contract: &hir::ContractDefinition) -> String {
| ^^^^^
|
= help: consider refactoring to an associated function
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_self
= note: `#[warn(clippy::unused_self)]` implied by `#[warn(clippy::pedantic)]`
Check warning on line 14 in src/hir/mod.rs
github-actions / clippy
docs for function returning `Result` missing `# Errors` section
warning: docs for function returning `Result` missing `# Errors` section
--> src/hir/mod.rs:14:1
|
14 | pub fn translate(tree: &str) -> anyhow::Result<Hir> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Check warning on line 26 in src/hir/visitor.rs
github-actions / clippy
docs for function returning `Result` missing `# Errors` section
warning: docs for function returning `Result` missing `# Errors` section
--> src/hir/visitor.rs:26:5
|
26 | fn visit_comment(&mut self, comment: &hir::Comment) -> Result<Self::Output, Self::Error>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Check warning on line 24 in src/hir/visitor.rs
github-actions / clippy
docs for function returning `Result` missing `# Errors` section
warning: docs for function returning `Result` missing `# Errors` section
--> src/hir/visitor.rs:21:5
|
21 | / fn visit_function(
22 | | &mut self,
23 | | function: &hir::FunctionDefinition,
24 | | ) -> Result<Self::Output, Self::Error>;
| |___________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Check warning on line 19 in src/hir/visitor.rs
github-actions / clippy
docs for function returning `Result` missing `# Errors` section
warning: docs for function returning `Result` missing `# Errors` section
--> src/hir/visitor.rs:16:5
|
16 | / fn visit_contract(
17 | | &mut self,
18 | | contract: &hir::ContractDefinition,
19 | | ) -> Result<Self::Output, Self::Error>;
| |___________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc