File tree Expand file tree Collapse file tree 3 files changed +18
-2
lines changed
compiler/rustc_lint_defs/src Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -2650,10 +2650,11 @@ declare_lint! {
26502650 /// [issue #73333]: https://github.com/rust-lang/rust/issues/73333
26512651 /// [`Copy`]: https://doc.rust-lang.org/std/marker/trait.Copy.html
26522652 pub CENUM_IMPL_DROP_CAST ,
2653- Warn ,
2653+ Deny ,
26542654 "a C-like enum implementing Drop is cast" ,
26552655 @future_incompatible = FutureIncompatibleInfo {
26562656 reference: "issue #73333 <https://github.com/rust-lang/rust/issues/73333>" ,
2657+ reason: FutureIncompatibilityReason :: FutureReleaseErrorReportNow ,
26572658 } ;
26582659}
26592660
Original file line number Diff line number Diff line change 1- #![ allow( dead_code) ]
1+ #![ allow( dead_code, cenum_impl_drop_cast ) ]
22
33// check dtor calling order when casting enums.
44
Original file line number Diff line number Diff line change @@ -14,3 +14,18 @@ LL | #![deny(cenum_impl_drop_cast)]
1414
1515error: aborting due to previous error
1616
17+ Future incompatibility report: Future breakage diagnostic:
18+ error: cannot cast enum `E` into integer `u32` because it implements `Drop`
19+ --> $DIR/cenum_impl_drop_cast.rs:15:13
20+ |
21+ LL | let i = e as u32;
22+ | ^^^^^^^^
23+ |
24+ note: the lint level is defined here
25+ --> $DIR/cenum_impl_drop_cast.rs:1:9
26+ |
27+ LL | #![deny(cenum_impl_drop_cast)]
28+ | ^^^^^^^^^^^^^^^^^^^^
29+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
30+ = note: for more information, see issue #73333 <https://github.com/rust-lang/rust/issues/73333>
31+
You can’t perform that action at this time.
0 commit comments