-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Cold Structs #54044
Comments
A lot of attributes (most of them?) are not validated in any way, neither locations, nor syntax.
This is a known issue, but I'm not sure there's a single issue about the attribute validation problem in general. |
I'll add a line saying that the attribute is allowed on other places in the reference. That said, it'd be nice to make it a warning in the 2018 edition, error by default in the 2021 edition, and removed completely in the 2024 edition. @petrochenkov Having an actual list of said attributes would be useful for said documentation purposes. @cramertj You can't put attributes on expressions, only statements or blocks. Are you saying |
…acement, r=matthewjasper Validate built-in attribute placement Closes rust-lang#54584, closes rust-lang#47725, closes rust-lang#54044. I've changed silently ignoring some incorrectly placed attributes to errors. I'm not sure what the policy is since this can theoretically break code (should they be warnings instead? does it warrant a crater run?).
Is it intentional that this work? If so, what is it supposed to do? The reference lists it as a function-only attribute, but I've always known it to work on expressions like loops as well.
The text was updated successfully, but these errors were encountered: