blob: 318dab599f5a3f910846d4a826954a7b73337197 (
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
|
error[E0597]: `x` does not live long enough
--> $DIR/send-is-not-static-std-sync-2.rs:22:5
|
21 | Mutex::new(&x) //~ ERROR does not live long enough
| - borrow occurs here
22 | };
| ^ `x` dropped here while still borrowed
...
25 | }
| - borrowed value needs to live until here
error[E0597]: `x` does not live long enough
--> $DIR/send-is-not-static-std-sync-2.rs:31:5
|
30 | RwLock::new(&x) //~ ERROR does not live long enough
| - borrow occurs here
31 | };
| ^ `x` dropped here while still borrowed
32 | let _dangling = *lock.read().unwrap();
33 | }
| - borrowed value needs to live until here
error[E0597]: `x` does not live long enough
--> $DIR/send-is-not-static-std-sync-2.rs:41:5
|
39 | let _ = tx.send(&x); //~ ERROR does not live long enough
| - borrow occurs here
40 | (tx, rx)
41 | };
| ^ `x` dropped here while still borrowed
...
44 | }
| - borrowed value needs to live until here
error: aborting due to 3 previous errors
|