fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

1.44.0
524 B17 linesraw
1error[E0597]: `x` does not live long enough
2  --> $DIR/promoted-annotation.rs:6:7
3   |
4LL | fn foo<'a>() {
5   |        -- lifetime `'a` defined here
6LL |     let x = 0;
7LL |     let f = &drop::<&'a i32>;
8   |             ---------------- assignment requires that `x` is borrowed for `'a`
9LL |     f(&x);
10   |       ^^ borrowed value does not live long enough
11LL |
12LL | }
13   | - `x` dropped here while still borrowed
14
15error: aborting due to previous error
16
17For more information about this error, try `rustc --explain E0597`.