-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-prettyArea: Pretty printing (including `-Z unpretty`)Area: Pretty printing (including `-Z unpretty`)
Description
$ cat t.rs
#[macro_export] macro_rules! foo { () => (mod foo { use super::f; pub fn ff() { f(); } }) }
$ cat s.rs
#[macro_use] extern crate t;
macro_rules! bar { () => (mod bar { use super::f; pub fn ff() { f(); } }) }
fn f() { println!("ffff"); }
foo!();
bar!();
$ rustc t.rs --crate-type lib
$ rustc s.rs --crate-type lib -L.
<t macros>:1:25: 1:30 error: expected identifier, found keyword `super`
<t macros>:1 ( ) => ( mod foo { use super :: f ; pub fn ff ( ) { f ( ) ; } } )
^~~~~
Macro definitions encoded to the metadata do not preserve the ModName
identifier style, thus certain paths break down.
Metadata
Metadata
Assignees
Labels
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-prettyArea: Pretty printing (including `-Z unpretty`)Area: Pretty printing (including `-Z unpretty`)