Skip to content

Commit

Permalink
Add a test for an opaque macro eagerly expanding its arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
petrochenkov committed Aug 21, 2019
1 parent bea0372 commit 1dd56aa
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/test/ui/hygiene/eager-from-opaque.rs
@@ -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!());
}
8 changes: 8 additions & 0 deletions src/test/ui/hygiene/eager-from-opaque.stderr
@@ -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

0 comments on commit 1dd56aa

Please sign in to comment.