clippy
39 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 39 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.77.2 (25ef9e3d8 2024-04-09)
- cargo 1.77.2 (e52e36006 2024-03-26)
- clippy 0.1.77 (25ef9e3 2024-04-09)
Annotations
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 128 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:128:5
|
128 | 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 128 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:128:5
|
128 | pub fn analyze(&mut self, ast: &ast::Ast) -> Result<()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: first possible panic found here
--> src/syntax/semantics.rs:129:9
|
129 | / match ast {
130 | | Ast::Root(root) => self.visit_root(root),
131 | | Ast::Condition(condition) => self.visit_condition(condition),
132 | | Ast::Action(action) => self.visit_action(action),
... |
136 | | // be stored in `self.errors`.
137 | | .unwrap();
| |_________________^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
Check warning on line 139 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:139:5
|
139 | 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 149 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:149:5
|
149 | 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 149 in src/scaffold/mod.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/mod.rs:149:5
|
149 | pub fn scaffold(&self, text: &str) -> crate::error::Result<String> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: first possible panic found here
--> src/scaffold/mod.rs:153:25
|
153 | let formatted = fmt(&source).expect("should format the emitted solidity code");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
Check warning on line 98 in src/scaffold/mod.rs
github-actions / clippy
writing `&PathBuf` instead of `&Path` involves a new object where a slice will do
warning: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do
--> src/scaffold/mod.rs:98:34
|
98 | fn to_test_file(&self, file: &PathBuf) -> PathBuf {
| ^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
= note: `#[warn(clippy::ptr_arg)]` implied by `#[warn(clippy::all)]`
help: change this to
|
98 ~ fn to_test_file(&self, file: &Path) -> PathBuf {
99 ~ let mut file = file.to_path_buf();
|
Check warning on line 98 in src/scaffold/mod.rs
github-actions / clippy
unused `self` argument
warning: unused `self` argument
--> src/scaffold/mod.rs:98:21
|
98 | fn to_test_file(&self, file: &PathBuf) -> PathBuf {
| ^^^^^
|
= help: consider refactoring to an associated function
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_self
Check warning on line 48 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:48:5
|
48 | 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 41 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:41:5
|
41 | pub fn discover(&mut self, ast: &Ast) -> &IndexMap<String, String> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: first possible panic found here
--> src/scaffold/modifiers.rs:44:17
|
44 | self.visit_root(root).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
Check warning on line 256 in src/scaffold/emitter.rs
github-actions / clippy
variables can be used directly in the `format!` string
warning: variables can be used directly in the `format!` string
--> src/scaffold/emitter.rs:256:34
|
256 | emitted.push_str(format!("{}vm.skip(true);\n", indentation).as_str());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
= note: `#[warn(clippy::uninlined_format_args)]` implied by `#[warn(clippy::pedantic)]`
help: change this to
|
256 - emitted.push_str(format!("{}vm.skip(true);\n", indentation).as_str());
256 + emitted.push_str(format!("{indentation}vm.skip(true);\n").as_str());
|
Check warning on line 80 in src/scaffold/emitter.rs
github-actions / clippy
unused `self` argument
warning: unused `self` argument
--> src/scaffold/emitter.rs:80:29
|
80 | 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 23 in src/hir/mod.rs
github-actions / clippy
item name ends with its containing module's name
warning: item name ends with its containing module's name
--> src/hir/mod.rs:23:8
|
23 | pub fn translate_tree_to_hir(
| ^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
= note: `#[warn(clippy::module_name_repetitions)]` implied by `#[warn(clippy::pedantic)]`
Check warning on line 26 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:23:1
|
23 | / pub fn translate_tree_to_hir(
24 | | tree: &str,
25 | | add_vm_skip: bool,
26 | | ) -> crate::error::Result<crate::hir::Hir> {
| |__________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Check warning on line 15 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:15:1
|
15 | pub fn translate(text: &str, add_vm_skip: bool) -> 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 75 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:72:5
|
72 | / fn visit_statement(
73 | | &mut self,
74 | | statement: &hir::Statement,
75 | | ) -> Result<Self::StatementOutput, Self::Error>;
| |____________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Check warning on line 63 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:62:5
|
62 | / fn visit_comment(&mut self, comment: &hir::Comment)
63 | | -> Result<Self::CommentOutput, Self::Error>;
| |____________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Check warning on line 53 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:50:5
|
50 | / fn visit_function(
51 | | &mut self,
52 | | function: &hir::FunctionDefinition,
53 | | ) -> Result<Self::FunctionDefinitionOutput, Self::Error>;
| |_____________________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Check warning on line 42 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:39:5
|
39 | / fn visit_contract(
40 | | &mut self,
41 | | contract: &hir::ContractDefinition,
42 | | ) -> Result<Self::ContractDefinitionOutput, Self::Error>;
| |_____________________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Check warning on line 31 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:31:5
|
31 | fn visit_root(&mut self, root: &hir::Root) -> Result<Self::RootOutput, Self::Error>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc