Skip to content

Conversation

@lapla-cogito
Copy link
Contributor

@lapla-cogito lapla-cogito commented Nov 25, 2025

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

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 25, 2025
@rustbot
Copy link
Collaborator

rustbot commented Nov 25, 2025

fmease is currently at their maximum review capacity.
They may take a while to respond.

LL | const auto trait Marker {}
| ^^^^^
|
= help: remove the `const` keyword
Copy link
Member

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.

Copy link
Contributor Author

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.

@fmease fmease added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 25, 2025
@fmease
Copy link
Member

fmease commented Nov 25, 2025

Thanks! Two small nitpicks

@lapla-cogito lapla-cogito force-pushed the deny_const_auto_trait branch 2 times, most recently from 44f4a9b to 0f63688 Compare November 25, 2025 12:06
@lapla-cogito
Copy link
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

We don't reject const auto traits

3 participants