-
Notifications
You must be signed in to change notification settings - Fork 13k
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
ABIs are validated before cfg-ing #27873
Comments
Any ideas where we could move the check into? Any of borrowck, typeck, lints, privacy and resolve don’t exactly fit. I think trans thematically is the best place to have it, but it is a shame to have it error out so late for such an easy to detect and obvious error. I’m personally fine keeping it a parse error, IMO there’s no reason to have cfg blocks with code that does not compile. |
NB. we can add a special
Yeah, of course. However, there are cases when the |
The I hit it myself; I'm playing with the SIMD work from @huonw's pull request, but I want to keep the crate working on stable. I worked around it by using a conditional |
The ABI string for
extern "..."
is validated while being parsed, meaning one can get errors about incfg
'd off modules:(Compiled without
--cfg foo
.)This isn't necessarily wrong, but it is weird and somewhat annoying if one needs it. (It can be worked-around by hiding the
extern
block behind a macro:macro_rules! annoying ( () => { extern "foo" {} }); annoying!()
.)The text was updated successfully, but these errors were encountered: