Skip to content

Commit 1ab6994

Browse files
author
Paolo Tranquilli
committed
Rust: accept test changes and showcase new unexpanded macro
1 parent 59c796c commit 1ab6994

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

rust/ql/integration-tests/macro-expansion/calls/src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,11 @@ include!("included.rs");
2828

2929
#[doc = include_str!("some.txt")] // this doesn't expand since 0.0.274
3030
fn documented() {}
31+
32+
macro_rules! my_int {
33+
() => { i32 };
34+
}
35+
36+
fn answer() -> my_int!() { // this doesn't expand since 0.0.274
37+
42
38+
}

rust/ql/integration-tests/macro-expansion/test.expected

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@ unexpanded_macro_calls
3232
| calls/src/included.rs:2:9:2:39 | concat!... |
3333
| calls/src/lib.rs:22:9:22:31 | concat!... |
3434
| calls/src/lib.rs:29:9:29:32 | include_str!... |
35+
| calls/src/lib.rs:36:16:36:24 | my_int!... |
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
| gen_const.rs:4:5:7:22 | Const | hasExtendedCanonicalPath: | no | hasCrateOrigin: | no | hasAttributeMacroExpansion: | no | getNumberOfAttrs: | 0 | hasBody: | yes | isConst: | yes | isDefault: | no | hasName: | yes | hasTypeRepr: | yes | hasVisibility: | no |
1+
| gen_const.rs:4:5:7:22 | Const | hasExtendedCanonicalPath: | no | hasCrateOrigin: | no | hasAttributeMacroExpansion: | no | getNumberOfAttrs: | 0 | hasBody: | yes | hasGenericParamList: | no | isConst: | yes | isDefault: | no | hasName: | yes | hasTypeRepr: | yes | hasVisibility: | no | hasWhereClause: | no |
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
extractionWarning
2+
| gen_macro_type_repr.rs:10:14:10:26 | macro expansion failed: could not resolve macro 'macro_type' |

0 commit comments

Comments
 (0)