31 lines
1 KiB
Text
31 lines
1 KiB
Text
|
error: `if let` assigns a shorter lifetime since Edition 2024
|
||
|
--> $DIR/lint-if-let-rescope-gated.rs:27:8
|
||
|
|
|
||
|
LL | if let Some(_value) = Droppy.get() {
|
||
|
| ^^^^^^^^^^^^^^^^^^^------^^^^^^
|
||
|
| |
|
||
|
| this value has a significant drop implementation which may observe a major change in drop order and requires your discretion
|
||
|
|
|
||
|
= warning: this changes meaning in Rust 2024
|
||
|
= note: for more information, see issue #124085 <https://github.com/rust-lang/rust/issues/124085>
|
||
|
help: the value is now dropped here in Edition 2024
|
||
|
--> $DIR/lint-if-let-rescope-gated.rs:30:5
|
||
|
|
|
||
|
LL | };
|
||
|
| ^
|
||
|
note: the lint level is defined here
|
||
|
--> $DIR/lint-if-let-rescope-gated.rs:11:9
|
||
|
|
|
||
|
LL | #![deny(if_let_rescope)]
|
||
|
| ^^^^^^^^^^^^^^
|
||
|
help: rewrite this `if let` into a `match` with a single arm to preserve the drop order up to Edition 2021
|
||
|
|
|
||
|
LL ~ match Droppy.get() { Some(_value) => {
|
||
|
LL |
|
||
|
LL |
|
||
|
LL ~ } _ => {} };
|
||
|
|
|
||
|
|
||
|
error: aborting due to 1 previous error
|
||
|
|