2019-06-22 01:30:24 +02:00
|
|
|
warning: denote infinite loops with `loop { ... }`
|
|
|
|
--> $DIR/mut-borrow-in-loop.rs:15:9
|
|
|
|
|
|
|
|
|
LL | while true {
|
|
|
|
| ^^^^^^^^^^ help: use `loop`
|
|
|
|
|
|
2019-07-16 22:17:38 +02:00
|
|
|
= note: `#[warn(while_true)]` on by default
|
2019-06-22 01:30:24 +02:00
|
|
|
|
2017-07-27 02:43:11 +01:00
|
|
|
error[E0499]: cannot borrow `*arg` as mutable more than once at a time
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/mut-borrow-in-loop.rs:10:25
|
2017-07-27 02:43:11 +01:00
|
|
|
|
|
2019-04-22 08:40:08 +01:00
|
|
|
LL | impl<'a, T : 'a> FuncWrapper<'a, T> {
|
|
|
|
| -- lifetime `'a` defined here
|
|
|
|
...
|
2019-03-09 15:03:44 +03:00
|
|
|
LL | (self.func)(arg)
|
2019-04-22 08:40:08 +01:00
|
|
|
| ------------^^^-
|
|
|
|
| | |
|
2020-10-08 10:45:34 +05:30
|
|
|
| | `*arg` was mutably borrowed here in the previous iteration of the loop
|
2019-04-22 08:40:08 +01:00
|
|
|
| argument requires that `*arg` is borrowed for `'a`
|
2017-07-27 02:43:11 +01:00
|
|
|
|
|
|
|
error[E0499]: cannot borrow `*arg` as mutable more than once at a time
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/mut-borrow-in-loop.rs:16:25
|
2017-07-27 02:43:11 +01:00
|
|
|
|
|
2019-04-22 08:40:08 +01:00
|
|
|
LL | impl<'a, T : 'a> FuncWrapper<'a, T> {
|
|
|
|
| -- lifetime `'a` defined here
|
|
|
|
...
|
2019-03-09 15:03:44 +03:00
|
|
|
LL | (self.func)(arg)
|
2019-04-22 08:40:08 +01:00
|
|
|
| ------------^^^-
|
|
|
|
| | |
|
2020-10-08 10:45:34 +05:30
|
|
|
| | `*arg` was mutably borrowed here in the previous iteration of the loop
|
2019-04-22 08:40:08 +01:00
|
|
|
| argument requires that `*arg` is borrowed for `'a`
|
2017-07-27 02:43:11 +01:00
|
|
|
|
|
|
|
error[E0499]: cannot borrow `*arg` as mutable more than once at a time
|
2018-12-25 08:56:47 -07:00
|
|
|
--> $DIR/mut-borrow-in-loop.rs:23:25
|
2017-07-27 02:43:11 +01:00
|
|
|
|
|
2019-04-22 08:40:08 +01:00
|
|
|
LL | impl<'a, T : 'a> FuncWrapper<'a, T> {
|
|
|
|
| -- lifetime `'a` defined here
|
|
|
|
...
|
2019-03-09 15:03:44 +03:00
|
|
|
LL | (self.func)(arg)
|
2019-04-22 08:40:08 +01:00
|
|
|
| ------------^^^-
|
|
|
|
| | |
|
2020-10-08 10:45:34 +05:30
|
|
|
| | `*arg` was mutably borrowed here in the previous iteration of the loop
|
2019-04-22 08:40:08 +01:00
|
|
|
| argument requires that `*arg` is borrowed for `'a`
|
2017-07-27 02:43:11 +01:00
|
|
|
|
2020-03-11 16:30:09 +01:00
|
|
|
error: aborting due to 3 previous errors; 1 warning emitted
|
2017-07-27 02:43:11 +01:00
|
|
|
|
2018-03-03 15:59:40 +01:00
|
|
|
For more information about this error, try `rustc --explain E0499`.
|