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

Merged
merged 2 commits into from
Feb 6, 2025
Merged

Conversation

ickk
Copy link
Contributor

@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
Contributor 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
@ehuss
Copy link
Contributor

ehuss commented Feb 6, 2025

rust-lang/rust#135964 has merged, so I'm going to go ahead and merge this. Thanks for moving this along!

@ehuss ehuss added this pull request to the merge queue Feb 6, 2025
Merged via the queue into rust-lang:master with commit 5ee8ee1 Feb 6, 2025
5 checks passed
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 10, 2025
Update books

## rust-lang/edition-guide

1 commits in f56aecc3b036dff16404b525a83b00f911b9bbea..8dbdda7cae4fa030f09f8f5b63994d4d1dde74b9
2025-02-06 20:06:58 UTC to 2025-02-06 20:06:58 UTC

- Correct spelling error in `static-mut-references.md` (rust-lang/edition-guide#358)

## rust-embedded/book

1 commits in ddbf1b4e2858fedb71b7c42eb15c4576517dc125..0b8219ac23a3e09464e4e0166c768cf1c4bba0d5
2025-02-07 08:26:59 UTC to 2025-02-07 08:26:59 UTC

- Update gcc toolchain download link for windows (rust-embedded/book#384)

## rust-lang/reference

3 commits in 4249fb411dd27f945e2881eb0378044b94cee06f..de2d5289e45506b11dd652bef4f99de64be70e1c
2025-02-08 22:12:20 UTC to 2025-02-06 19:02:01 UTC

- Add trait_upcasting related languages changes (rust-lang/reference#1622)
- fixup `»` insertion for rules (rust-lang/reference#1730)
- doc `cenum_impl_drop_cast` (rust-lang/reference#1713)

## rust-lang/rust-by-example

2 commits in 743766929f1e53e72fab74394ae259bbfb4a7619..66543bbc5b7dbd4e679092c07ae06ba6c73fd912
2025-02-06 12:38:08 UTC to 2025-02-04 01:46:09 UTC

- Add more examples @ drop.md (rust-lang/rust-by-example#1912)
- es translation to 3100 (rust-lang/rust-by-example#1911)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 10, 2025
Update books

## rust-lang/edition-guide

1 commits in f56aecc3b036dff16404b525a83b00f911b9bbea..8dbdda7cae4fa030f09f8f5b63994d4d1dde74b9
2025-02-06 20:06:58 UTC to 2025-02-06 20:06:58 UTC

- Correct spelling error in `static-mut-references.md` (rust-lang/edition-guide#358)

## rust-embedded/book

1 commits in ddbf1b4e2858fedb71b7c42eb15c4576517dc125..0b8219ac23a3e09464e4e0166c768cf1c4bba0d5
2025-02-07 08:26:59 UTC to 2025-02-07 08:26:59 UTC

- Update gcc toolchain download link for windows (rust-embedded/book#384)

## rust-lang/reference

3 commits in 4249fb411dd27f945e2881eb0378044b94cee06f..de2d5289e45506b11dd652bef4f99de64be70e1c
2025-02-08 22:12:20 UTC to 2025-02-06 19:02:01 UTC

- Add trait_upcasting related languages changes (rust-lang/reference#1622)
- fixup `»` insertion for rules (rust-lang/reference#1730)
- doc `cenum_impl_drop_cast` (rust-lang/reference#1713)

## rust-lang/rust-by-example

2 commits in 743766929f1e53e72fab74394ae259bbfb4a7619..66543bbc5b7dbd4e679092c07ae06ba6c73fd912
2025-02-06 12:38:08 UTC to 2025-02-04 01:46:09 UTC

- Add more examples @ drop.md (rust-lang/rust-by-example#1912)
- es translation to 3100 (rust-lang/rust-by-example#1911)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 11, 2025
Update books

## rust-lang/edition-guide

1 commits in f56aecc3b036dff16404b525a83b00f911b9bbea..8dbdda7cae4fa030f09f8f5b63994d4d1dde74b9
2025-02-06 20:06:58 UTC to 2025-02-06 20:06:58 UTC

- Correct spelling error in `static-mut-references.md` (rust-lang/edition-guide#358)

## rust-embedded/book

1 commits in ddbf1b4e2858fedb71b7c42eb15c4576517dc125..0b8219ac23a3e09464e4e0166c768cf1c4bba0d5
2025-02-07 08:26:59 UTC to 2025-02-07 08:26:59 UTC

- Update gcc toolchain download link for windows (rust-embedded/book#384)

## rust-lang/reference

3 commits in 4249fb411dd27f945e2881eb0378044b94cee06f..de2d5289e45506b11dd652bef4f99de64be70e1c
2025-02-08 22:12:20 UTC to 2025-02-06 19:02:01 UTC

- Add trait_upcasting related languages changes (rust-lang/reference#1622)
- fixup `»` insertion for rules (rust-lang/reference#1730)
- doc `cenum_impl_drop_cast` (rust-lang/reference#1713)

## rust-lang/rust-by-example

2 commits in 743766929f1e53e72fab74394ae259bbfb4a7619..66543bbc5b7dbd4e679092c07ae06ba6c73fd912
2025-02-06 12:38:08 UTC to 2025-02-04 01:46:09 UTC

- Add more examples @ drop.md (rust-lang/rust-by-example#1912)
- es translation to 3100 (rust-lang/rust-by-example#1911)
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Feb 11, 2025
Rollup merge of rust-lang#136825 - rustbot:docs-update, r=ehuss

Update books

## rust-lang/edition-guide

1 commits in f56aecc3b036dff16404b525a83b00f911b9bbea..8dbdda7cae4fa030f09f8f5b63994d4d1dde74b9
2025-02-06 20:06:58 UTC to 2025-02-06 20:06:58 UTC

- Correct spelling error in `static-mut-references.md` (rust-lang/edition-guide#358)

## rust-embedded/book

1 commits in ddbf1b4e2858fedb71b7c42eb15c4576517dc125..0b8219ac23a3e09464e4e0166c768cf1c4bba0d5
2025-02-07 08:26:59 UTC to 2025-02-07 08:26:59 UTC

- Update gcc toolchain download link for windows (rust-embedded/book#384)

## rust-lang/reference

3 commits in 4249fb411dd27f945e2881eb0378044b94cee06f..de2d5289e45506b11dd652bef4f99de64be70e1c
2025-02-08 22:12:20 UTC to 2025-02-06 19:02:01 UTC

- Add trait_upcasting related languages changes (rust-lang/reference#1622)
- fixup `»` insertion for rules (rust-lang/reference#1730)
- doc `cenum_impl_drop_cast` (rust-lang/reference#1713)

## rust-lang/rust-by-example

2 commits in 743766929f1e53e72fab74394ae259bbfb4a7619..66543bbc5b7dbd4e679092c07ae06ba6c73fd912
2025-02-06 12:38:08 UTC to 2025-02-04 01:46:09 UTC

- Add more examples @ drop.md (rust-lang/rust-by-example#1912)
- es translation to 3100 (rust-lang/rust-by-example#1911)
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