Skip to content

Macros can not parse and expand to associated types #22463

New issue

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

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

Already on GitHub? # to your account

Closed
Kimundi opened this issue Feb 17, 2015 · 2 comments
Closed

Macros can not parse and expand to associated types #22463

Kimundi opened this issue Feb 17, 2015 · 2 comments
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added.

Comments

@Kimundi
Copy link
Member

Kimundi commented Feb 17, 2015

macro_rules! items {
    () => {
        type A = ();
        fn a() {}
    }
}

trait Foo {
    type A;
    fn a();
}

impl Foo for () {
    items!();
}

fn main() {

}
<anon>:3:9: 3:13 error: expected one of `extern`, `fn`, or `unsafe`, found `type`
<anon>:3         type A = ();
                 ^~~~
@Kimundi Kimundi added the A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) label Feb 17, 2015
@kmcallister
Copy link
Contributor

Mm, we have "method macros" but now there are other things that can go in a trait.

@Kimundi
Copy link
Member Author

Kimundi commented Apr 2, 2015

Seems to be fixed by #23265, but I don't see tests for it specifically, so I guess this needs tests.

@Kimundi Kimundi added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Apr 2, 2015
jooert added a commit to jooert/rust that referenced this issue May 6, 2015
@bors bors closed this as completed in 6de3cdc May 7, 2015
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
Projects
None yet
Development

No branches or pull requests

2 participants