2018-08-08 14:28:26 +02:00
error[E0499]: cannot borrow `*f` as mutable more than once at a time
2018-12-25 08:56:47 -07:00
--> $DIR/two-phase-nonrecv-autoref.rs:60:11
2018-08-08 14:28:26 +02:00
|
LL | f(f(10));
2018-09-29 11:47:47 +01:00
| - ^ second mutable borrow occurs here
| |
2018-08-08 14:28:26 +02:00
| first mutable borrow occurs here
2018-09-29 11:47:47 +01:00
| first borrow later used by call
2018-08-08 14:28:26 +02:00
error[E0382]: use of moved value: `*f`
2018-12-25 08:56:47 -07:00
--> $DIR/two-phase-nonrecv-autoref.rs:69:11
2018-08-08 14:28:26 +02:00
|
2019-01-24 10:53:43 -08:00
LL | fn twice_ten_so<F: FnOnce(i32) -> i32>(f: Box<F>) {
| - consider adding a `Copy` constraint to this type argument
2018-08-08 14:28:26 +02:00
LL | f(f(10));
| - ^ value used here after move
| |
| value moved here
2018-12-27 19:08:51 +08:00
|
= note: move occurs because `*f` has type `F`, which does not implement the `Copy` trait
2018-08-08 14:28:26 +02:00
error[E0499]: cannot borrow `*f` as mutable more than once at a time
2018-12-25 08:56:47 -07:00
--> $DIR/two-phase-nonrecv-autoref.rs:76:11
2018-08-08 14:28:26 +02:00
|
LL | f(f(10));
2018-09-29 11:47:47 +01:00
| - ^ second mutable borrow occurs here
| |
2018-08-08 14:28:26 +02:00
| first mutable borrow occurs here
2018-09-29 11:47:47 +01:00
| first borrow later used by call
2018-08-08 14:28:26 +02:00
error[E0161]: cannot move a value of type dyn std::ops::FnOnce(i32) -> i32: the size of dyn std::ops::FnOnce(i32) -> i32 cannot be statically determined
2018-12-25 08:56:47 -07:00
--> $DIR/two-phase-nonrecv-autoref.rs:85:9
2018-08-08 14:28:26 +02:00
|
LL | f(f(10));
| ^
error[E0161]: cannot move a value of type dyn std::ops::FnOnce(i32) -> i32: the size of dyn std::ops::FnOnce(i32) -> i32 cannot be statically determined
2018-12-25 08:56:47 -07:00
--> $DIR/two-phase-nonrecv-autoref.rs:85:11
2018-08-08 14:28:26 +02:00
|
LL | f(f(10));
| ^
error[E0382]: use of moved value: `*f`
2018-12-25 08:56:47 -07:00
--> $DIR/two-phase-nonrecv-autoref.rs:85:11
2018-08-08 14:28:26 +02:00
|
LL | f(f(10));
| - ^ value used here after move
| |
| value moved here
2018-12-27 19:08:51 +08:00
|
= note: move occurs because `*f` has type `dyn std::ops::FnOnce(i32) -> i32`, which does not implement the `Copy` trait
2018-08-08 14:28:26 +02:00
error[E0502]: cannot borrow `a` as immutable because it is also borrowed as mutable
2018-12-25 08:56:47 -07:00
--> $DIR/two-phase-nonrecv-autoref.rs:129:27
2018-08-08 14:28:26 +02:00
|
LL | double_access(&mut a, &a);
2018-09-29 11:47:47 +01:00
| ------------- ------ ^^ immutable borrow occurs here
| | |
2018-08-08 14:28:26 +02:00
| | mutable borrow occurs here
2018-09-29 11:47:47 +01:00
| mutable borrow later used by call
2018-08-08 14:28:26 +02:00
error[E0502]: cannot borrow `i` as immutable because it is also borrowed as mutable
2018-12-25 08:56:47 -07:00
--> $DIR/two-phase-nonrecv-autoref.rs:157:7
2018-08-08 14:28:26 +02:00
|
LL | i[i[3]] = 4;
| --^----
| | |
| | immutable borrow occurs here
| mutable borrow occurs here
2018-09-29 11:47:47 +01:00
| mutable borrow later used here
2018-08-08 14:28:26 +02:00
error[E0502]: cannot borrow `i` as immutable because it is also borrowed as mutable
2018-12-25 08:56:47 -07:00
--> $DIR/two-phase-nonrecv-autoref.rs:163:7
2018-08-08 14:28:26 +02:00
|
LL | i[i[3]] = i[4];
| --^----
| | |
| | immutable borrow occurs here
| mutable borrow occurs here
2018-09-29 11:47:47 +01:00
| mutable borrow later used here
2018-08-08 14:28:26 +02:00
error: aborting due to 9 previous errors
Some errors occurred: E0161, E0382, E0499, E0502.
For more information about an error, try `rustc --explain E0161`.