Skip to content
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

doc cenum_impl_drop_cast #1713

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ickk
Copy link

@ickk ickk commented Jan 14, 2025

Add note about as casts being disallowed for enums that implement Drop.

The cenum_impl_drop_cast lint rust-lang/rust#73333 is already deny on stable rust, and I think eventually this will become a hard restriction for enum-to-numeric casts. playground

@rustbot rustbot added the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Jan 14, 2025
@ehuss
Copy link
Contributor

ehuss commented Jan 14, 2025

Thanks for the PR! We generally are hesitant to document these future-incompat things until they are actually made into a hard error. In which case, it would be written as a normal rule and not a warning block. Is there a planned timeline for this?

@ickk
Copy link
Author

ickk commented Jan 15, 2025

Based on the reference, it was a bit surprising to discover that the compiler rejects this (since rust-lang/rust#97652) without an explicit annotation, but I understand it's not technically a requirement. I wasn't sure what the reference guidelines were for such things, sorry.

Is there a planned timeline for this?

On the lint's tracking issue page it appears to have been added to the "Lang Edition 2024" project, but doesn't seem to appear on the project board itself - I'm not sure if this means it was rejected from inclusion in the Edition, or somehow lost and forgotten? Either way, at this point I assume it won't be a hard error until at least the following edition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: The marked PR is awaiting review from a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants