File tree Expand file tree Collapse file tree 3 files changed +4
-2
lines changed
src/queries/unusedentities
test/query-tests/unusedentities Expand file tree Collapse file tree 3 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -23,4 +23,7 @@ predicate isUnused(Variable v) {
2323predicate isAllowableUnused ( Variable v ) {
2424 // in a macro expansion
2525 v .getPat ( ) .isInMacroExpansion ( )
26+ or
27+ // a 'self' variable
28+ v .getName ( ) = "self"
2629}
Original file line number Diff line number Diff line change 11| main.rs:29:9:29:9 | a | Variable 'a' is not used. |
2- | main.rs:89:19:89:22 | self | Variable 'self' is not used. |
32| main.rs:98:13:98:13 | d | Variable 'd' is not used. |
43| main.rs:147:5:147:5 | y | Variable 'y' is not used. |
54| main.rs:174:9:174:9 | x | Variable 'x' is not used. |
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ impl MyStruct {
8686 return self . val ;
8787 }
8888
89- fn get_flags ( & self ) -> i64 { // $ SPURIOUS: Alert[rust/unused-variable]
89+ fn get_flags ( & self ) -> i64 {
9090 return 0 ;
9191 }
9292}
You can’t perform that action at this time.
0 commit comments