File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -11,13 +11,11 @@ error[E0382]: use of moved value: `f`
1111 --> $DIR/two-phase-nonrecv-autoref.rs:69:11
1212 |
1313LL | fn twice_ten_so<F: FnOnce(i32) -> i32>(f: Box<F>) {
14- | - consider adding a `Copy` constraint to this type argument
14+ | - move occurs because `f` has type `std::boxed::Box<F>`, which does not implement the `Copy` trait
1515LL | f(f(10));
1616 | - ^ value used here after move
1717 | |
1818 | value moved here
19- |
20- = note: move occurs because `f` has type `std::boxed::Box<F>`, which does not implement the `Copy` trait
2119
2220error[E0499]: cannot borrow `*f` as mutable more than once at a time
2321 --> $DIR/two-phase-nonrecv-autoref.rs:76:11
@@ -31,12 +29,12 @@ LL | f(f(10));
3129error[E0382]: use of moved value: `f`
3230 --> $DIR/two-phase-nonrecv-autoref.rs:85:11
3331 |
32+ LL | fn twice_ten_oo(f: Box<FnOnce(i32) -> i32>) {
33+ | - move occurs because `f` has type `std::boxed::Box<dyn std::ops::FnOnce(i32) -> i32>`, which does not implement the `Copy` trait
3434LL | f(f(10));
3535 | - ^ value used here after move
3636 | |
3737 | value moved here
38- |
39- = note: move occurs because `f` has type `std::boxed::Box<dyn std::ops::FnOnce(i32) -> i32>`, which does not implement the `Copy` trait
4038
4139error[E0502]: cannot borrow `a` as immutable because it is also borrowed as mutable
4240 --> $DIR/two-phase-nonrecv-autoref.rs:125:27
You can’t perform that action at this time.
0 commit comments