]> git.lizzy.rs Git - rust.git/blob - src/test/ui/span/send-is-not-static-std-sync.stderr
Rollup merge of #87922 - Manishearth:c-enum-target-spec, r=nagisa,eddyb
[rust.git] / src / test / ui / span / send-is-not-static-std-sync.stderr
1 error[E0505]: cannot move out of `y` because it is borrowed
2   --> $DIR/send-is-not-static-std-sync.rs:13:10
3    |
4 LL |     *lock.lock().unwrap() = &*y;
5    |                             --- borrow of `*y` occurs here
6 LL |     drop(y);
7    |          ^ move out of `y` occurs here
8 ...
9 LL |         *lock.lock().unwrap() = &z;
10    |          ---- borrow later used here
11
12 error[E0597]: `z` does not live long enough
13   --> $DIR/send-is-not-static-std-sync.rs:16:33
14    |
15 LL |         *lock.lock().unwrap() = &z;
16    |                                 ^^ borrowed value does not live long enough
17 LL |     }
18    |     - `z` dropped here while still borrowed
19 LL |
20 LL |     lock.use_ref(); // (Mutex is #[may_dangle] so its dtor does not use `z` => needs explicit use)
21    |     ---- borrow later used here
22
23 error[E0505]: cannot move out of `y` because it is borrowed
24   --> $DIR/send-is-not-static-std-sync.rs:27:10
25    |
26 LL |     *lock.write().unwrap() = &*y;
27    |                              --- borrow of `*y` occurs here
28 LL |     drop(y);
29    |          ^ move out of `y` occurs here
30 ...
31 LL |         *lock.write().unwrap() = &z;
32    |          ---- borrow later used here
33
34 error[E0597]: `z` does not live long enough
35   --> $DIR/send-is-not-static-std-sync.rs:30:34
36    |
37 LL |         *lock.write().unwrap() = &z;
38    |                                  ^^ borrowed value does not live long enough
39 LL |     }
40    |     - `z` dropped here while still borrowed
41 LL |
42 LL |     lock.use_ref(); // (RwLock is #[may_dangle] so its dtor does not use `z` => needs explicit use)
43    |     ---- borrow later used here
44
45 error[E0505]: cannot move out of `y` because it is borrowed
46   --> $DIR/send-is-not-static-std-sync.rs:43:10
47    |
48 LL |     tx.send(&*y);
49    |             --- borrow of `*y` occurs here
50 LL |     drop(y);
51    |          ^ move out of `y` occurs here
52 ...
53 LL |         tx.send(&z).unwrap();
54    |         -- borrow later used here
55
56 error[E0597]: `z` does not live long enough
57   --> $DIR/send-is-not-static-std-sync.rs:46:17
58    |
59 LL |         tx.send(&z).unwrap();
60    |                 ^^ borrowed value does not live long enough
61 LL |     }
62    |     - `z` dropped here while still borrowed
63 ...
64 LL | }
65    | - borrow might be used here, when `tx` is dropped and runs the `Drop` code for type `Sender`
66    |
67    = note: values in a scope are dropped in the opposite order they are defined
68
69 error: aborting due to 6 previous errors
70
71 Some errors have detailed explanations: E0505, E0597.
72 For more information about an error, try `rustc --explain E0505`.