File tree Expand file tree Collapse file tree 6 files changed +37
-30
lines changed
rust/ql/test/query-tests/unusedentities Expand file tree Collapse file tree 6 files changed +37
-30
lines changed Original file line number Diff line number Diff line change 14
14
| main.rs:284:13:284:17 | total | Variable $@ is assigned a value that is never used. | main.rs:252:13:252:17 | total | total |
15
15
| main.rs:377:9:377:9 | x | Variable $@ is assigned a value that is never used. | main.rs:377:9:377:9 | x | x |
16
16
| main.rs:385:17:385:17 | x | Variable $@ is assigned a value that is never used. | main.rs:385:17:385:17 | x | x |
17
- | main.rs:556 :9:556 :20 | var_in_macro | Variable $@ is assigned a value that is never used. | main.rs:556 :9:556 :20 | var_in_macro | var_in_macro |
18
- | main.rs:565 :9:565 :9 | c | Variable $@ is assigned a value that is never used. | main.rs:565 :9:565 :9 | c | c |
17
+ | main.rs:531 :9:531 :20 | var_in_macro | Variable $@ is assigned a value that is never used. | main.rs:531 :9:531 :20 | var_in_macro | var_in_macro |
18
+ | main.rs:540 :9:540 :9 | c | Variable $@ is assigned a value that is never used. | main.rs:540 :9:540 :9 | c | c |
19
19
| 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 |
20
20
| 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 |
21
21
| more.rs:65:13: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 @@ -507,31 +507,6 @@ fn macros2() {
507
507
}
508
508
509
509
fn macros3 ( ) {
510
- let d: u16 = 4 ;
511
-
512
- undefined_macro_call ! ( d) ;
513
- }
514
-
515
- fn macros4 ( ) {
516
- {
517
- let a: u16 = 6 ; // $ MISSING: Alert[rust/unused-variable]
518
- }
519
-
520
- undefined_macro_call ! ( 5 ) ;
521
-
522
- let b: u16 = 6 ; // $ MISSING: Alert[rust/unused-variable]
523
- }
524
-
525
- fn macros5 ( ) {
526
- match std:: env:: args ( ) . nth ( 1 ) . unwrap ( ) . parse :: < u16 > ( ) {
527
- Ok ( n) => {
528
- undefined_macro_call ! ( n) ;
529
- }
530
- _ => { }
531
- }
532
- }
533
-
534
- fn macros6 ( ) {
535
510
let x;
536
511
println ! (
537
512
"The value of x is {}" ,
@@ -601,9 +576,6 @@ fn main() {
601
576
macros1 ( ) ;
602
577
macros2 ( ) ;
603
578
macros3 ( ) ;
604
- macros4 ( ) ;
605
- macros5 ( ) ;
606
- macros6 ( ) ;
607
579
hygiene_mismatch ( ) ;
608
580
references ( ) ;
609
581
Original file line number Diff line number Diff line change
1
+ query: queries/unusedentities/UnusedVariable.ql
2
+ postprocess: utils/test/InlineExpectationsTestQuery.ql
Original file line number Diff line number Diff line change
1
+
2
+ // --- undefined macro calls ---
3
+
4
+ fn undefined_macros1 ( ) {
5
+ let d: u16 = 4 ;
6
+
7
+ undefined_macro_call ! ( d) ;
8
+ }
9
+
10
+ fn undefined_macros2 ( ) {
11
+ {
12
+ let a: u16 = 6 ; // $ MISSING: Alert[rust/unused-variable]
13
+ }
14
+
15
+ undefined_macro_call ! ( 5 ) ;
16
+
17
+ let b: u16 = 6 ; // $ MISSING: Alert[rust/unused-variable]
18
+ }
19
+
20
+ fn undefined_macros3 ( ) {
21
+ match std:: env:: args ( ) . nth ( 1 ) . unwrap ( ) . parse :: < u16 > ( ) {
22
+ Ok ( n) => {
23
+ undefined_macro_call ! ( n) ;
24
+ }
25
+ _ => { }
26
+ }
27
+ }
28
+
29
+ fn main ( ) {
30
+ undefined_macros1 ( ) ;
31
+ undefined_macros2 ( ) ;
32
+ undefined_macros3 ( ) ;
33
+ }
File renamed without changes.
You can’t perform that action at this time.
0 commit comments