]> git.lizzy.rs Git - rust.git/blob - tests/ui/macros/format-args-temporaries-in-write.stderr
Rollup merge of #106714 - Ezrashaw:remove-e0490, r=davidtwco
[rust.git] / tests / ui / macros / format-args-temporaries-in-write.stderr
1 error[E0597]: `mutex` does not live long enough
2   --> $DIR/format-args-temporaries-in-write.rs:41:27
3    |
4 LL |         write!(Out, "{}", mutex.lock()) /* no semicolon */
5    |                           ^^^^^^^^^^^^
6    |                           |
7    |                           borrowed value does not live long enough
8    |                           a temporary with access to the borrow is created here ...
9 LL |
10 LL |     };
11    |     -- ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `MutexGuard`
12    |     |
13    |     `mutex` dropped here while still borrowed
14    |
15
16 error[E0597]: `mutex` does not live long enough
17   --> $DIR/format-args-temporaries-in-write.rs:47:29
18    |
19 LL |         writeln!(Out, "{}", mutex.lock()) /* no semicolon */
20    |                             ^^^^^^^^^^^^
21    |                             |
22    |                             borrowed value does not live long enough
23    |                             a temporary with access to the borrow is created here ...
24 LL |
25 LL |     };
26    |     -- ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `MutexGuard`
27    |     |
28    |     `mutex` dropped here while still borrowed
29    |
30
31 error: aborting due to 2 previous errors
32
33 For more information about this error, try `rustc --explain E0597`.