-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
repr attributes can be applied at module level #64734
Comments
cc @Centril ^^^ I don't know who is familiar with libsyntax or the library that handles this. |
I don't think attributes that affect codegen are checked for validity at all. The same thing happens for |
Some attributes including |
In case it turns out that many people rely on this, we could give reasonable (and arguably desirable) interpretation to |
If people rely on this compiling, but doing nothing, changing the repr of all types silently feels like a footgun. |
I feel the standard warn by default, deny by default, hard error approach is the easiest way to handle this. Maybe even skip to deny by default. |
Given that occurrences of |
We should fix this too, in the same manner as @rkruppe pointed out. (Either as part of this issue, or in a new issue.) Lack of validity checking can cause concrete problems, as in #64768. |
…l, r=matthewjasper Add check for doc alias attribute at crate level Fixes rust-lang#76298, rust-lang#64734, rust-lang#69365. r? @ollie27
Closing, as this is now a hard error via #76329. |
Spot what's wrong with this code:
(Playground)
For some reason, top-level
#![repr(..)]
attributes are allowed, soFoo
isn'trepr(C)
. Sadly,@rust-lang/underhanded isn't a thing.
The text was updated successfully, but these errors were encountered: