fork/rust

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

borsAuto merge of #71868 - Mark-Simulacrum:stable-1.43.1, r=pietroalbini8d69840ab92

1.43.1
1.0 KiB29 linesraw
1error[E0597]: `x` does not live long enough
2  --> $DIR/issue-29106.rs:16:26
3   |
4LL |         y = Arc::new(Foo(&x));
5   |                          ^^ borrowed value does not live long enough
6LL |     }
7   |     -
8   |     |
9   |     `x` dropped here while still borrowed
10   |     borrow might be used here, when `y` is dropped and runs the `Drop` code for type `std::sync::Arc`
11   |
12   = note: values in a scope are dropped in the opposite order they are defined
13
14error[E0597]: `x` does not live long enough
15  --> $DIR/issue-29106.rs:23:25
16   |
17LL |         y = Rc::new(Foo(&x));
18   |                         ^^ borrowed value does not live long enough
19LL |     }
20   |     -
21   |     |
22   |     `x` dropped here while still borrowed
23   |     borrow might be used here, when `y` is dropped and runs the `Drop` code for type `std::rc::Rc`
24   |
25   = note: values in a scope are dropped in the opposite order they are defined
26
27error: aborting due to 2 previous errors
28
29For more information about this error, try `rustc --explain E0597`.