-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-syntaxextArea: Syntax extensionsArea: Syntax extensionsC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.
Description
When one macro invokes another macro, it always looks up the nested macro from the point of the outer invocation, instead of from the point of the macro definition. I don't know if this is intentional.
Example:
fn main() {
macro_rules! foo(
() => (println!("outer"))
);
{
macro_rules! bar(
() => (foo!())
);
{
macro_rules! foo(
() => (println!("inner"))
);
bar!()
}
}
}
If these were functions, it would print outer
, but instead it prints inner
.
Metadata
Metadata
Assignees
Labels
A-syntaxextArea: Syntax extensionsArea: Syntax extensionsC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.