fork/rust

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

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

master
1.5 KiB37 linesraw
1error[E0597]: `mutex` does not live long enough
2  --> $DIR/format-args-temporaries-in-write.rs:41:27
3   |
4LL |         let mutex = Mutex;
5   |             ----- binding `mutex` declared here
6LL |         write!(Out, "{}", mutex.lock()) /* no semicolon */
7   |                           ^^^^^-------
8   |                           |
9   |                           borrowed value does not live long enough
10   |                           a temporary with access to the borrow is created here ...
11LL |
12LL |     };
13   |     -- ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `MutexGuard`
14   |     |
15   |     `mutex` dropped here while still borrowed
16   |
17
18error[E0597]: `mutex` does not live long enough
19  --> $DIR/format-args-temporaries-in-write.rs:47:29
20   |
21LL |         let mutex = Mutex;
22   |             ----- binding `mutex` declared here
23LL |         writeln!(Out, "{}", mutex.lock()) /* no semicolon */
24   |                             ^^^^^-------
25   |                             |
26   |                             borrowed value does not live long enough
27   |                             a temporary with access to the borrow is created here ...
28LL |
29LL |     };
30   |     -- ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `MutexGuard`
31   |     |
32   |     `mutex` dropped here while still borrowed
33   |
34
35error: aborting due to 2 previous errors
36
37For more information about this error, try `rustc --explain E0597`.