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
88private import codeql.rust.elements.FormatArgsExpr
99private import codeql.rust.elements.FormatArgsArg
1010private import codeql.rust.elements.Format
11+ private import codeql.rust.elements.MacroCall
1112private import codeql.rust.elements.NamedFormatArgument
1213private import codeql.rust.elements.PositionalFormatArgument
1314private import codeql.Locations
@@ -36,7 +37,9 @@ private module Cached {
3637 */
3738 cached
3839 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 ( )
4043 }
4144}
4245
Original file line number Diff line number Diff line change 1616| main.rs:10:31:10:31 | 1 | main.rs:10:23:10:23 | 0 | format argument |
1717| main.rs:10:34:10:34 | 2 | main.rs:10:16:10:16 | 1 | format argument |
1818| 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 |
2319| 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