File tree 3 files changed +18
-2
lines changed
compiler/rustc_lint_defs/src
3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -2650,10 +2650,11 @@ declare_lint! {
2650
2650
/// [issue #73333]: https://github.com/rust-lang/rust/issues/73333
2651
2651
/// [`Copy`]: https://doc.rust-lang.org/std/marker/trait.Copy.html
2652
2652
pub CENUM_IMPL_DROP_CAST ,
2653
- Warn ,
2653
+ Deny ,
2654
2654
"a C-like enum implementing Drop is cast" ,
2655
2655
@future_incompatible = FutureIncompatibleInfo {
2656
2656
reference: "issue #73333 <https://github.com/rust-lang/rust/issues/73333>" ,
2657
+ reason: FutureIncompatibilityReason :: FutureReleaseErrorReportNow ,
2657
2658
} ;
2658
2659
}
2659
2660
Original file line number Diff line number Diff line change 1
- #![ allow( dead_code) ]
1
+ #![ allow( dead_code, cenum_impl_drop_cast ) ]
2
2
3
3
// check dtor calling order when casting enums.
4
4
Original file line number Diff line number Diff line change @@ -14,3 +14,18 @@ LL | #![deny(cenum_impl_drop_cast)]
14
14
15
15
error: aborting due to previous error
16
16
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