File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
test/library-tests/definitions Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ private import codeql.rust.elements.Locatable
8
8
private import codeql.rust.elements.FormatArgsExpr
9
9
private import codeql.rust.elements.FormatArgsArg
10
10
private import codeql.rust.elements.Format
11
+ private import codeql.rust.elements.MacroCall
11
12
private import codeql.rust.elements.NamedFormatArgument
12
13
private import codeql.rust.elements.PositionalFormatArgument
13
14
private import codeql.Locations
@@ -36,7 +37,9 @@ private module Cached {
36
37
*/
37
38
cached
38
39
Definition definitionOf ( Use use , string kind ) {
39
- result = use .getDefinition ( ) and kind = use .getUseType ( )
40
+ result = use .getDefinition ( ) and
41
+ kind = use .getUseType ( ) and
42
+ not result .getLocation ( ) = any ( MacroCall m ) .getLocation ( )
40
43
}
41
44
}
42
45
Original file line number Diff line number Diff line change 16
16
| main.rs:10:31:10:31 | 1 | main.rs:10:23:10:23 | 0 | format argument |
17
17
| main.rs:10:34:10:34 | 2 | main.rs:10:16:10:16 | 1 | format argument |
18
18
| main.rs:10:34:10:34 | 2 | main.rs:10:26:10:27 | {} | format argument |
19
- | main.rs:11:5:11:60 | left_val | main.rs:11:5:11:60 | left_val | local variable |
20
- | main.rs:11:5:11:60 | left_val | main.rs:11:5:11:60 | left_val | local variable |
21
- | main.rs:11:5:11:60 | right_val | main.rs:11:5:11:60 | right_val | local variable |
22
- | main.rs:11:5:11:60 | right_val | main.rs:11:5:11:60 | right_val | local variable |
23
19
| main.rs:11:40:11:42 | "x" | main.rs:11:31:11:35 | {:<5} | format argument |
You can’t perform that action at this time.
0 commit comments