fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

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