Add a test for an opaque macro eagerly expanding its arguments

This commit is contained in:
Vadim Petrochenkov 2019-08-19 23:10:07 +03:00 committed by Pietro Albini
parent 57f845c533
commit 29fe07641f
No known key found for this signature in database
GPG key ID: 3E06ABE80BAAF19C
2 changed files with 26 additions and 0 deletions

View file

@ -0,0 +1,18 @@
// Opaque macro can eagerly expand its input without breaking its resolution.
// Regression test for issue #63685.
macro_rules! foo {
() => {
"foo"
};
}
macro_rules! bar {
() => {
foo!() //~ ERROR cannot find macro `foo!` in this scope
};
}
fn main() {
format_args!(bar!());
}

View file

@ -0,0 +1,8 @@
error: cannot find macro `foo!` in this scope
--> $DIR/eager-from-opaque.rs:12:9
|
LL | foo!()
| ^^^
error: aborting due to previous error