Skip to content

Commit 29fe076

Browse files
petrochenkovpietroalbini
authored andcommitted
Add a test for an opaque macro eagerly expanding its arguments
1 parent 57f845c commit 29fe076

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Opaque macro can eagerly expand its input without breaking its resolution.
2+
// Regression test for issue #63685.
3+
4+
macro_rules! foo {
5+
() => {
6+
"foo"
7+
};
8+
}
9+
10+
macro_rules! bar {
11+
() => {
12+
foo!() //~ ERROR cannot find macro `foo!` in this scope
13+
};
14+
}
15+
16+
fn main() {
17+
format_args!(bar!());
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: cannot find macro `foo!` in this scope
2+
--> $DIR/eager-from-opaque.rs:12:9
3+
|
4+
LL | foo!()
5+
| ^^^
6+
7+
error: aborting due to previous error
8+

0 commit comments

Comments
 (0)