-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17940 from geoffw0/resolvable
Rust: Add unresolved macro calls diagnostic
- Loading branch information
Showing
12 changed files
with
39 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* @name Unresolved Macro Calls | ||
* @description List all macro calls that were not resolved to a target. | ||
* @kind diagnostic | ||
* @id rust/diagnostics/unresolved-macro-calls | ||
*/ | ||
|
||
import rust | ||
|
||
from MacroCall mc | ||
where not mc.hasExpanded() | ||
select mc, "Macro call was not resolved to a target." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
| 59 | | ||
| 60 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
| 59 | | ||
| 60 | |
2 changes: 1 addition & 1 deletion
2
rust/ql/test/query-tests/diagnostics/LinesOfUserCodeInFiles.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
| Elements extracted | 375 | | ||
| Elements extracted | 382 | | ||
| Elements unextracted | 0 | | ||
| Extraction errors | 0 | | ||
| Extraction warnings | 6 | | ||
| Extraction warnings | 7 | | ||
| Files extracted - total | 8 | | ||
| Files extracted - with errors | 2 | | ||
| Files extracted - without errors | 6 | | ||
| Files extracted - with errors | 3 | | ||
| Files extracted - without errors | 5 | | ||
| Inconsistencies - AST | 0 | | ||
| Inconsistencies - CFG | 0 | | ||
| Inconsistencies - data flow | 0 | | ||
| Lines of code extracted | 59 | | ||
| Lines of user code extracted | 59 | | ||
| Lines of code extracted | 60 | | ||
| Lines of user code extracted | 60 | | ||
| Macro calls - resolved | 8 | | ||
| Macro calls - total | 9 | | ||
| Macro calls - unresolved | 1 | |
1 change: 1 addition & 0 deletions
1
rust/ql/test/query-tests/diagnostics/UnresolvedMacroCalls.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
| my_macro.rs:17:9:17:27 | myUndefinedMacro!... | Macro call was not resolved to a target. | |
1 change: 1 addition & 0 deletions
1
rust/ql/test/query-tests/diagnostics/UnresolvedMacroCalls.qlref
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
queries/diagnostics/UnresolvedMacroCalls.ql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters