-
Notifications
You must be signed in to change notification settings - Fork 14k
Deny const auto traits #149307
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
base: main
Are you sure you want to change the base?
Deny const auto traits #149307
Conversation
|
|
8eb8894 to
809379a
Compare
| LL | const auto trait Marker {} | ||
| | ^^^^^ | ||
| | | ||
| = help: remove the `const` keyword |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could provide a structured suggestion but yeah, it's not really worth the effort.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I initially thought about that, but decided not to, mainly because not every suggestion can be fixed automatically with rustfix, for example the code sample in the original issue that triggers a panic in next-gen solvers, and because we don't really have anything meaningful to add beyond what the current message already communicates.
|
Thanks! Two small nitpicks |
44f4a9b to
0f63688
Compare
0f63688 to
3326fbd
Compare
|
@rustbot ready |
close #149285
The AST validation now detects and rejects const auto traits. Additionally, I updated an existing test that was using
const unsafe auto trait.r? fmease