Skip to content

Commit b11c58c

Browse files
author
Paolo Tranquilli
committed
Rust: more macro expansion test tweaks
1 parent 1ab6994 commit b11c58c

File tree

13 files changed

+39
-22
lines changed

13 files changed

+39
-22
lines changed

rust/ql/.generated.list

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,13 @@ macro_rules! my_int {
3434
}
3535

3636
fn answer() -> my_int!() { // this doesn't expand since 0.0.274
37-
42
37+
let a: my_int!() = 42; // this is fine
38+
a as my_int!() // this is fine too
39+
}
40+
41+
42+
type MyInt = my_int!(); // this doesn't expand since 0.0.274
43+
44+
struct MyStruct {
45+
field: my_int!(), // this doesn't expand since 0.0.274
3846
}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,14 @@ macro_calls
2727
| calls/src/lib.rs:22:9:23:13 | format!... | calls/src/lib.rs:22:9:23:13 | ...::must_use(...) |
2828
| calls/src/lib.rs:27:1:27:24 | concat!... | calls/src/lib.rs:27:1:27:24 | "Hello world!" |
2929
| calls/src/lib.rs:27:1:27:24 | include!... | calls/src/lib.rs:27:1:27:24 | MacroItems |
30+
| calls/src/lib.rs:37:12:37:20 | my_int!... | calls/src/lib.rs:37:12:37:20 | i32 |
31+
| calls/src/lib.rs:38:12:38:20 | my_int!... | calls/src/lib.rs:38:12:38:20 | i32 |
32+
| calls/src/lib.rs:39:10:39:18 | my_int!... | calls/src/lib.rs:39:10:39:18 | i32 |
3033
unexpanded_macro_calls
3134
| attributes/src/lib.rs:5:9:5:35 | concat!... |
3235
| calls/src/included.rs:2:9:2:39 | concat!... |
3336
| calls/src/lib.rs:22:9:22:31 | concat!... |
3437
| calls/src/lib.rs:29:9:29:32 | include_str!... |
3538
| calls/src/lib.rs:36:16:36:24 | my_int!... |
39+
| calls/src/lib.rs:43:14:43:22 | my_int!... |
40+
| calls/src/lib.rs:46:12:46:20 | my_int!... |

rust/ql/lib/codeql/rust/elements/MacroTypeRepr.qll

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/ql/lib/codeql/rust/elements/internal/MacroTypeReprImpl.qll

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/ql/lib/codeql/rust/elements/internal/generated/MacroTypeRepr.qll

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/ql/test/extractor-tests/generated/.generated_tests.list

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/ql/test/extractor-tests/generated/MacroTypeRepr/CONSISTENCY/ExtractionConsistency.expected

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
| gen_macro_type_repr.rs:10:14:10:26 | MacroTypeRepr | hasMacroCall: | yes |
1+
| gen_macro_type_repr.rs:11:12:11:24 | MacroTypeRepr | hasMacroCall: | yes |

0 commit comments

Comments
 (0)