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 2 commits 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.

@ehuss ehuss self-assigned this Jan 30, 2025
@rustbot

This comment has been minimized.

@ehuss ehuss force-pushed the doc-cenum_impl_drop_cast branch from 98d3e84 to 350536c Compare February 4, 2025 14:43
cenum_impl_drop_cast has been changed to a hard error in
rust-lang/rust#135964
@ehuss ehuss force-pushed the doc-cenum_impl_drop_cast branch from 350536c to 4675c25 Compare February 4, 2025 14:44
@ehuss
Copy link
Contributor

ehuss commented Feb 4, 2025

I pushed an update as this is changing to a hard error via rust-lang/rust#135964.

@traviscross traviscross added S-waiting-on-stabilization Waiting for a stabilization PR to be merged in the main Rust repository and removed S-waiting-on-review Status: The marked PR is awaiting review from a maintainer labels Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-stabilization Waiting for a stabilization PR to be merged in the main Rust repository
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants