fork/rust

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

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

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