11error[E0716]: temporary value dropped while borrowed
2- --> $DIR/if-let-rescope-borrowck-suggestions.rs:22 :39
2+ --> $DIR/if-let-rescope-borrowck-suggestions.rs:21 :39
33 |
44LL | do_something(if let Some(value) = Droppy.get_ref() { value } else { &0 });
55 | ^^^^^^ - temporary value is freed at the end of this statement
66 | |
77 | creates a temporary value which is freed while still in use
88 |
99note: lifetimes for temporaries generated in `if let`s have been shortened in Edition 2024 so that they are dropped here instead
10- --> $DIR/if-let-rescope-borrowck-suggestions.rs:22 :64
10+ --> $DIR/if-let-rescope-borrowck-suggestions.rs:21 :64
1111 |
1212LL | do_something(if let Some(value) = Droppy.get_ref() { value } else { &0 });
1313 | ^
@@ -22,7 +22,7 @@ LL | do_something({ match Droppy.get_ref() { Some(value) => { value } _ =>
2222 | ~~~~~~~ ++++++++++++++++ ~~~~ ++
2323
2424error[E0716]: temporary value dropped while borrowed
25- --> $DIR/if-let-rescope-borrowck-suggestions.rs:24 :39
25+ --> $DIR/if-let-rescope-borrowck-suggestions.rs:23 :39
2626 |
2727LL | do_something(if let Some(value) = Droppy.get_ref() {
2828 | ^^^^^^ creates a temporary value which is freed while still in use
@@ -31,7 +31,7 @@ LL | } else if let Some(value) = Droppy.get_ref() {
3131 | - temporary value is freed at the end of this statement
3232 |
3333note: lifetimes for temporaries generated in `if let`s have been shortened in Edition 2024 so that they are dropped here instead
34- --> $DIR/if-let-rescope-borrowck-suggestions.rs:27 :5
34+ --> $DIR/if-let-rescope-borrowck-suggestions.rs:26 :5
3535 |
3636LL | } else if let Some(value) = Droppy.get_ref() {
3737 | ^
@@ -53,7 +53,7 @@ LL ~ }}});
5353 |
5454
5555error[E0716]: temporary value dropped while borrowed
56- --> $DIR/if-let-rescope-borrowck-suggestions.rs:27 :33
56+ --> $DIR/if-let-rescope-borrowck-suggestions.rs:26 :33
5757 |
5858LL | } else if let Some(value) = Droppy.get_ref() {
5959 | ^^^^^^ creates a temporary value which is freed while still in use
@@ -62,7 +62,7 @@ LL | } else {
6262 | - temporary value is freed at the end of this statement
6363 |
6464note: lifetimes for temporaries generated in `if let`s have been shortened in Edition 2024 so that they are dropped here instead
65- --> $DIR/if-let-rescope-borrowck-suggestions.rs:30 :5
65+ --> $DIR/if-let-rescope-borrowck-suggestions.rs:29 :5
6666 |
6767LL | } else {
6868 | ^
0 commit comments