Skip to content

Exportable macros require hardcoding crate's name #12088

Closed
@huonw

Description

@huonw

which means the user has to import it under that name to use the macros.

// some_crate.rs
#[feature(macro_rules)];

pub static X: uint = 1;

#[macro_export]
macro_rules! foo { () => { some_crate::X } }
// other_crate.rs
#[feature(phases)];
#[phase(syntax, link)] extern mod blah = "some_crate";

fn main() { foo!(); } // unresolved name some_crate

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-syntaxextArea: Syntax extensions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions