You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error: expected one of `!` or `::`, found `(`
--> src/main.rs:9:14
|
9 | a()
| ^ expected one of `!` or `::` here
error: Could not compile `playground`.
To learn more, run the command again with --verbose.
This was very confusing and I didn't see anything about this in the generated cfg-if docs. I went on the Rust IRC channel and scottmcm was kind enough to point out that in the crate description visible on Crates.io "A macro to ergonomically define an item depending on a large number of #[cfg] parameters. Structured like an if-else chain, the first matching branch is the item that gets emitted." it talks about items, which are a specific language term.
So now I understand a little bit better the limitations, I think there are two ways to better convey this to users:
Use the term item within the generated docs and be sure to link to the relevant section in the reference that I linked to above.
Emit better errors for when there isn't a macro match (not certain if this is currently possible).
The text was updated successfully, but these errors were encountered:
I was trying to generate a bunch of identical functions with different bodies, so I was writing them similar to this minimal example:
but this fails with:
This was very confusing and I didn't see anything about this in the generated cfg-if docs. I went on the Rust IRC channel and scottmcm was kind enough to point out that in the crate description visible on Crates.io "A macro to ergonomically define an item depending on a large number of #[cfg] parameters. Structured like an if-else chain, the first matching branch is the item that gets emitted." it talks about
item
s, which are a specific language term.So now I understand a little bit better the limitations, I think there are two ways to better convey this to users:
item
within the generated docs and be sure to link to the relevant section in the reference that I linked to above.The text was updated successfully, but these errors were encountered: