mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
Add a test for an opaque macro eagerly expanding its arguments
This commit is contained in:
parent
bea0372a1a
commit
1dd56aa304
18
src/test/ui/hygiene/eager-from-opaque.rs
Normal file
18
src/test/ui/hygiene/eager-from-opaque.rs
Normal 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!());
|
||||
}
|
8
src/test/ui/hygiene/eager-from-opaque.stderr
Normal file
8
src/test/ui/hygiene/eager-from-opaque.stderr
Normal 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
|
||||
|
Loading…
Reference in New Issue
Block a user