diff options
| author | Eric Huss <eric@huss.org> | 2025-01-23 16:45:19 -0800 |
|---|---|---|
| committer | Eric Huss <eric@huss.org> | 2025-01-23 16:45:19 -0800 |
| commit | e0bbeb7a005bbf593ccae60f4b0ba86f17d3df63 (patch) | |
| tree | 62da48e30a2ade9ff2568265d5edad110cb100e7 /tests/ui | |
| parent | 99768c80a1c094a5cfc3b25a04e7a99de7210eae (diff) | |
| download | rust-e0bbeb7a005bbf593ccae60f4b0ba86f17d3df63.tar.gz rust-e0bbeb7a005bbf593ccae60f4b0ba86f17d3df63.zip | |
Make cenum_impl_drop_cast a hard error
This changes the `cenum_impl_drop_cast` lint to be a hard error. This lint has been deny-by-default and warning in dependencies since https://github.com/rust-lang/rust/pull/97652 about 2.5 years ago. Closes https://github.com/rust-lang/rust/issues/73333
Diffstat (limited to 'tests/ui')
| -rw-r--r-- | tests/ui/cenum_impl_drop_cast.rs | 3 | ||||
| -rw-r--r-- | tests/ui/cenum_impl_drop_cast.stderr | 25 |
2 files changed, 1 insertions, 27 deletions
diff --git a/tests/ui/cenum_impl_drop_cast.rs b/tests/ui/cenum_impl_drop_cast.rs index 96e3d967e2c..f681434dd86 100644 --- a/tests/ui/cenum_impl_drop_cast.rs +++ b/tests/ui/cenum_impl_drop_cast.rs @@ -1,5 +1,3 @@ -#![deny(cenum_impl_drop_cast)] - enum E { A = 0, } @@ -14,5 +12,4 @@ fn main() { let e = E::A; let i = e as u32; //~^ ERROR cannot cast enum `E` into integer `u32` because it implements `Drop` - //~| WARN this was previously accepted } diff --git a/tests/ui/cenum_impl_drop_cast.stderr b/tests/ui/cenum_impl_drop_cast.stderr index 541d15d021d..35c69f4b4b7 100644 --- a/tests/ui/cenum_impl_drop_cast.stderr +++ b/tests/ui/cenum_impl_drop_cast.stderr @@ -1,31 +1,8 @@ error: cannot cast enum `E` into integer `u32` because it implements `Drop` - --> $DIR/cenum_impl_drop_cast.rs:15:13 + --> $DIR/cenum_impl_drop_cast.rs:13:13 | LL | let i = e as u32; | ^^^^^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #73333 <https://github.com/rust-lang/rust/issues/73333> -note: the lint level is defined here - --> $DIR/cenum_impl_drop_cast.rs:1:9 - | -LL | #![deny(cenum_impl_drop_cast)] - | ^^^^^^^^^^^^^^^^^^^^ error: aborting due to 1 previous error -Future incompatibility report: Future breakage diagnostic: -error: cannot cast enum `E` into integer `u32` because it implements `Drop` - --> $DIR/cenum_impl_drop_cast.rs:15:13 - | -LL | let i = e as u32; - | ^^^^^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #73333 <https://github.com/rust-lang/rust/issues/73333> -note: the lint level is defined here - --> $DIR/cenum_impl_drop_cast.rs:1:9 - | -LL | #![deny(cenum_impl_drop_cast)] - | ^^^^^^^^^^^^^^^^^^^^ - |
