about summary refs log tree commit diff
path: root/tests/ui/dropck/let-else-more-permissive.stderr
blob: 4f0c193a78da8fcd701a60167f5643d83c01fb0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
error[E0597]: `short1` does not live long enough
  --> $DIR/let-else-more-permissive.rs:13:19
   |
LL |         let (mut long1, short1) = (Struct(&0), 1);
   |                         ------ binding `short1` declared here
LL |         long1.0 = &short1;
   |                   ^^^^^^^ borrowed value does not live long enough
LL |
LL |     }
   |     -
   |     |
   |     `short1` dropped here while still borrowed
   |     borrow might be used here, when `long1` is dropped and runs the `Drop` code for type `Struct`
   |
   = note: values in a scope are dropped in the opposite order they are defined

error[E0597]: `short2` does not live long enough
  --> $DIR/let-else-more-permissive.rs:20:19
   |
LL |         let (mut long2, short2) = (Struct(&0), 1) else { unreachable!() };
   |                         ------ binding `short2` declared here
LL |         long2.0 = &short2;
   |                   ^^^^^^^ borrowed value does not live long enough
LL |
LL |     }
   |     -
   |     |
   |     `short2` dropped here while still borrowed
   |     borrow might be used here, when `long2` is dropped and runs the `Drop` code for type `Struct`
   |
   = note: values in a scope are dropped in the opposite order they are defined

error[E0597]: `short3` does not live long enough
  --> $DIR/let-else-more-permissive.rs:28:19
   |
LL |         let (mut long3, short3) = (Struct(&tmp), Box::new(1)) else { unreachable!() };
   |                         ------ binding `short3` declared here
LL |         long3.0 = &short3;
   |                   ^^^^^^^ borrowed value does not live long enough
LL |
LL |     }
   |     -
   |     |
   |     `short3` dropped here while still borrowed
   |     borrow might be used here, when `long3` is dropped and runs the `Drop` code for type `Struct`
   |
   = note: values in a scope are dropped in the opposite order they are defined

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0597`.