Skip to content

Item macros inside of impls don't work #4661

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
brendanzab opened this issue Jan 29, 2013 · 1 comment
Closed

Item macros inside of impls don't work #4661

brendanzab opened this issue Jan 29, 2013 · 1 comment

Comments

@brendanzab
Copy link
Member

macro_rules! printer_method {
    { $id:ident : $string:expr } => {
        pure fn $id () { io::println($string) }
    }
}

type MyInt = int;

impl MyInt {
    printer_method!{ ~"Hullo folks." }
}

fn main() {}
$ rustc macro-in-impl.rs
macro-in-impl.rs:10:4: 10:18 error: unexpected token: `printer_method`
macro-in-impl.rs:10     printer_method!{ ~"Hullo folks." }
@brendanzab
Copy link
Member Author

Woops - just realised that I reposted my own issue: #4641 - sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant