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) {
23
23
predicate isAllowableUnused ( Variable v ) {
24
24
// in a macro expansion
25
25
v .getPat ( ) .isInMacroExpansion ( )
26
+ or
27
+ // a 'self' variable
28
+ v .getName ( ) = "self"
26
29
}
Original file line number Diff line number Diff line change 1
1
| 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. |
3
2
| main.rs:98:13:98:13 | d | Variable 'd' is not used. |
4
3
| main.rs:147:5:147:5 | y | Variable 'y' is not used. |
5
4
| 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 {
86
86
return self . val ;
87
87
}
88
88
89
- fn get_flags ( & self ) -> i64 { // $ SPURIOUS: Alert[rust/unused-variable]
89
+ fn get_flags ( & self ) -> i64 {
90
90
return 0 ;
91
91
}
92
92
}
You can’t perform that action at this time.
0 commit comments