File tree Expand file tree Collapse file tree 4 files changed +3
-4
lines changed
src/queries/unusedentities
test/query-tests/unusedentities Expand file tree Collapse file tree 4 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,5 @@ predicate isUnused(Variable v) {
10
10
not exists ( v .getAnAccess ( ) ) and
11
11
not exists ( v .getInitializer ( ) ) and
12
12
not v instanceof DiscardVariable and
13
- not v .getPat ( ) .isInMacroExpansion ( ) and
14
- exists ( File f | f .getBaseName ( ) = "main.rs" | v .getLocation ( ) .getFile ( ) = f ) // temporarily severely limit results
13
+ not v .getPat ( ) .isInMacroExpansion ( )
15
14
}
Original file line number Diff line number Diff line change 14
14
| main.rs:270:13:270:17 | total | Variable $@ is assigned a value that is never used. | main.rs:238:13:238:17 | total | total |
15
15
| main.rs:363:9:363:9 | x | Variable $@ is assigned a value that is never used. | main.rs:363:9:363:9 | x | x |
16
16
| main.rs:371:17:371:17 | x | Variable $@ is assigned a value that is never used. | main.rs:371:17:371:17 | x | x |
17
- | more.rs:24:9:24:11 | val | Variable $@ is assigned a value that is never used. | more.rs:24:9:24:11 | val | val |
18
17
| more.rs:44:9:44:14 | a_ptr4 | Variable $@ is assigned a value that is never used. | more.rs:44:9:44:14 | a_ptr4 | a_ptr4 |
19
18
| more.rs:59:9:59:13 | d_ptr | Variable $@ is assigned a value that is never used. | more.rs:59:9:59:13 | d_ptr | d_ptr |
20
19
| more.rs:65:9:65:17 | f_ptr | Variable $@ is assigned a value that is never used. | more.rs:65:13:65:17 | f_ptr | f_ptr |
Original file line number Diff line number Diff line change 19
19
| main.rs:417:26:417:28 | val | Variable 'val' is not used. |
20
20
| main.rs:420:21:420:23 | acc | Variable 'acc' is not used. |
21
21
| main.rs:441:9:441:14 | unused | Variable 'unused' is not used. |
22
+ | more.rs:24:9:24:11 | val | Variable 'val' is not used. |
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ impl<T> MySettable<T> for MyContainer<T> {
21
21
impl < T > MyGettable < T > for MyContainer < T > {
22
22
fn get (
23
23
& self ,
24
- val : T , // $ SPURIOUS: Alert[rust/unused-value] $ MISSING: Alert[rust/unused-variable]
24
+ val : T , // $ Alert[rust/unused-variable]
25
25
) -> & T {
26
26
return & ( self . val ) ;
27
27
}
You can’t perform that action at this time.
0 commit comments