Skip to content
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

Errors not generated when applied to non-struct item with doc-comments #8

Open
zmitchell opened this issue Feb 6, 2018 · 2 comments
Labels
bug Something isn't working

Comments

@zmitchell
Copy link
Owner

If you apply the #[wickerman] attribute to an item that is not a struct, you should see an error:

#[wickerman]
enum Foo { // error: this is not a struct
    Bar,
    Baz,
}

However, if that item has doc-comments, you won't see the error:

/// This doesn't generate an error
#[wickerman]
enum Foo {
    Bar,
    Baz,
}
@zmitchell zmitchell added bug Something isn't working help wanted Extra attention is needed good first issue Good for newcomers labels Feb 6, 2018
@dtolnay
Copy link
Contributor

dtolnay commented Feb 6, 2018

I don't think this is a wickerman bug. Should be fixed by rust-lang/rust#47941.

@zmitchell zmitchell removed good first issue Good for newcomers help wanted Extra attention is needed labels Feb 6, 2018
@zmitchell
Copy link
Owner Author

I agree, when I add an enum to the existing example:

/// This is a doc-comment
#[wickerman]
enum SpamOrEggs {
    Spam,
    Eggs,
}

I get this error message:

error: This is not a struct
 --> <macro expansion>:1:1
  |
1 | /// This is a doc-comment
  | ^^^^^^^^^^^^^^^^^^^^^^^^^

which has the wrong filename and line number, just like Sean pointed out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants