wickerman
wickerman copied to clipboard
Errors not generated when applied to non-struct item with doc-comments
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,
}
I don't think this is a wickerman bug. Should be fixed by https://github.com/rust-lang/rust/issues/47941.
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.