Skip to content

#[macro_use] does not work on macro-expanded extern crates #33936

Closed
@jseyfried

Description

@jseyfried

For example, this compiles:

#![feature(rustc_private)]

#[macro_use]
extern crate syntax;

fn main() {
    help!(S, "");

    struct S;
    impl S { fn help(&self, _: &str) {} }
}

but this doesn't:

#![feature(rustc_private)]

macro_rules! my_extern_crate {
    ($i:ident) => { #[macro_use] extern crate $i; }
}
my_extern_crate!(syntax);

fn main() { ... }

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions