-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
49 changed files
with
493 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,253 @@ | ||
error[E0382]: use of moved value: `lhs` | ||
--> $DIR/binop-consume-args.rs:7:10 | ||
| | ||
LL | fn add<A: Add<B, Output=()>, B>(lhs: A, rhs: B) { | ||
| - --- move occurs because `lhs` has type `A`, which does not implement the `Copy` trait | ||
| | | ||
| consider adding a `Copy` constraint to this type argument | ||
LL | lhs + rhs; | ||
| --- value moved here | ||
LL | drop(lhs); //~ ERROR use of moved value: `lhs` | ||
| ^^^ value used here after move | ||
|
||
error[E0382]: use of moved value: `rhs` | ||
--> $DIR/binop-consume-args.rs:8:10 | ||
| | ||
LL | fn add<A: Add<B, Output=()>, B>(lhs: A, rhs: B) { | ||
| - --- move occurs because `rhs` has type `B`, which does not implement the `Copy` trait | ||
| | | ||
| consider adding a `Copy` constraint to this type argument | ||
LL | lhs + rhs; | ||
| --- value moved here | ||
LL | drop(lhs); //~ ERROR use of moved value: `lhs` | ||
LL | drop(rhs); //~ ERROR use of moved value: `rhs` | ||
| ^^^ value used here after move | ||
|
||
error[E0382]: use of moved value: `lhs` | ||
--> $DIR/binop-consume-args.rs:13:10 | ||
| | ||
LL | fn sub<A: Sub<B, Output=()>, B>(lhs: A, rhs: B) { | ||
| - --- move occurs because `lhs` has type `A`, which does not implement the `Copy` trait | ||
| | | ||
| consider adding a `Copy` constraint to this type argument | ||
LL | lhs - rhs; | ||
| --- value moved here | ||
LL | drop(lhs); //~ ERROR use of moved value: `lhs` | ||
| ^^^ value used here after move | ||
|
||
error[E0382]: use of moved value: `rhs` | ||
--> $DIR/binop-consume-args.rs:14:10 | ||
| | ||
LL | fn sub<A: Sub<B, Output=()>, B>(lhs: A, rhs: B) { | ||
| - --- move occurs because `rhs` has type `B`, which does not implement the `Copy` trait | ||
| | | ||
| consider adding a `Copy` constraint to this type argument | ||
LL | lhs - rhs; | ||
| --- value moved here | ||
LL | drop(lhs); //~ ERROR use of moved value: `lhs` | ||
LL | drop(rhs); //~ ERROR use of moved value: `rhs` | ||
| ^^^ value used here after move | ||
|
||
error[E0382]: use of moved value: `lhs` | ||
--> $DIR/binop-consume-args.rs:19:10 | ||
| | ||
LL | fn mul<A: Mul<B, Output=()>, B>(lhs: A, rhs: B) { | ||
| - --- move occurs because `lhs` has type `A`, which does not implement the `Copy` trait | ||
| | | ||
| consider adding a `Copy` constraint to this type argument | ||
LL | lhs * rhs; | ||
| --- value moved here | ||
LL | drop(lhs); //~ ERROR use of moved value: `lhs` | ||
| ^^^ value used here after move | ||
|
||
error[E0382]: use of moved value: `rhs` | ||
--> $DIR/binop-consume-args.rs:20:10 | ||
| | ||
LL | fn mul<A: Mul<B, Output=()>, B>(lhs: A, rhs: B) { | ||
| - --- move occurs because `rhs` has type `B`, which does not implement the `Copy` trait | ||
| | | ||
| consider adding a `Copy` constraint to this type argument | ||
LL | lhs * rhs; | ||
| --- value moved here | ||
LL | drop(lhs); //~ ERROR use of moved value: `lhs` | ||
LL | drop(rhs); //~ ERROR use of moved value: `rhs` | ||
| ^^^ value used here after move | ||
|
||
error[E0382]: use of moved value: `lhs` | ||
--> $DIR/binop-consume-args.rs:25:10 | ||
| | ||
LL | fn div<A: Div<B, Output=()>, B>(lhs: A, rhs: B) { | ||
| - --- move occurs because `lhs` has type `A`, which does not implement the `Copy` trait | ||
| | | ||
| consider adding a `Copy` constraint to this type argument | ||
LL | lhs / rhs; | ||
| --- value moved here | ||
LL | drop(lhs); //~ ERROR use of moved value: `lhs` | ||
| ^^^ value used here after move | ||
|
||
error[E0382]: use of moved value: `rhs` | ||
--> $DIR/binop-consume-args.rs:26:10 | ||
| | ||
LL | fn div<A: Div<B, Output=()>, B>(lhs: A, rhs: B) { | ||
| - --- move occurs because `rhs` has type `B`, which does not implement the `Copy` trait | ||
| | | ||
| consider adding a `Copy` constraint to this type argument | ||
LL | lhs / rhs; | ||
| --- value moved here | ||
LL | drop(lhs); //~ ERROR use of moved value: `lhs` | ||
LL | drop(rhs); //~ ERROR use of moved value: `rhs` | ||
| ^^^ value used here after move | ||
|
||
error[E0382]: use of moved value: `lhs` | ||
--> $DIR/binop-consume-args.rs:31:10 | ||
| | ||
LL | fn rem<A: Rem<B, Output=()>, B>(lhs: A, rhs: B) { | ||
| - --- move occurs because `lhs` has type `A`, which does not implement the `Copy` trait | ||
| | | ||
| consider adding a `Copy` constraint to this type argument | ||
LL | lhs % rhs; | ||
| --- value moved here | ||
LL | drop(lhs); //~ ERROR use of moved value: `lhs` | ||
| ^^^ value used here after move | ||
|
||
error[E0382]: use of moved value: `rhs` | ||
--> $DIR/binop-consume-args.rs:32:10 | ||
| | ||
LL | fn rem<A: Rem<B, Output=()>, B>(lhs: A, rhs: B) { | ||
| - --- move occurs because `rhs` has type `B`, which does not implement the `Copy` trait | ||
| | | ||
| consider adding a `Copy` constraint to this type argument | ||
LL | lhs % rhs; | ||
| --- value moved here | ||
LL | drop(lhs); //~ ERROR use of moved value: `lhs` | ||
LL | drop(rhs); //~ ERROR use of moved value: `rhs` | ||
| ^^^ value used here after move | ||
|
||
error[E0382]: use of moved value: `lhs` | ||
--> $DIR/binop-consume-args.rs:37:10 | ||
| | ||
LL | fn bitand<A: BitAnd<B, Output=()>, B>(lhs: A, rhs: B) { | ||
| - --- move occurs because `lhs` has type `A`, which does not implement the `Copy` trait | ||
| | | ||
| consider adding a `Copy` constraint to this type argument | ||
LL | lhs & rhs; | ||
| --- value moved here | ||
LL | drop(lhs); //~ ERROR use of moved value: `lhs` | ||
| ^^^ value used here after move | ||
|
||
error[E0382]: use of moved value: `rhs` | ||
--> $DIR/binop-consume-args.rs:38:10 | ||
| | ||
LL | fn bitand<A: BitAnd<B, Output=()>, B>(lhs: A, rhs: B) { | ||
| - --- move occurs because `rhs` has type `B`, which does not implement the `Copy` trait | ||
| | | ||
| consider adding a `Copy` constraint to this type argument | ||
LL | lhs & rhs; | ||
| --- value moved here | ||
LL | drop(lhs); //~ ERROR use of moved value: `lhs` | ||
LL | drop(rhs); //~ ERROR use of moved value: `rhs` | ||
| ^^^ value used here after move | ||
|
||
error[E0382]: use of moved value: `lhs` | ||
--> $DIR/binop-consume-args.rs:43:10 | ||
| | ||
LL | fn bitor<A: BitOr<B, Output=()>, B>(lhs: A, rhs: B) { | ||
| - --- move occurs because `lhs` has type `A`, which does not implement the `Copy` trait | ||
| | | ||
| consider adding a `Copy` constraint to this type argument | ||
LL | lhs | rhs; | ||
| --- value moved here | ||
LL | drop(lhs); //~ ERROR use of moved value: `lhs` | ||
| ^^^ value used here after move | ||
|
||
error[E0382]: use of moved value: `rhs` | ||
--> $DIR/binop-consume-args.rs:44:10 | ||
| | ||
LL | fn bitor<A: BitOr<B, Output=()>, B>(lhs: A, rhs: B) { | ||
| - --- move occurs because `rhs` has type `B`, which does not implement the `Copy` trait | ||
| | | ||
| consider adding a `Copy` constraint to this type argument | ||
LL | lhs | rhs; | ||
| --- value moved here | ||
LL | drop(lhs); //~ ERROR use of moved value: `lhs` | ||
LL | drop(rhs); //~ ERROR use of moved value: `rhs` | ||
| ^^^ value used here after move | ||
|
||
error[E0382]: use of moved value: `lhs` | ||
--> $DIR/binop-consume-args.rs:49:10 | ||
| | ||
LL | fn bitxor<A: BitXor<B, Output=()>, B>(lhs: A, rhs: B) { | ||
| - --- move occurs because `lhs` has type `A`, which does not implement the `Copy` trait | ||
| | | ||
| consider adding a `Copy` constraint to this type argument | ||
LL | lhs ^ rhs; | ||
| --- value moved here | ||
LL | drop(lhs); //~ ERROR use of moved value: `lhs` | ||
| ^^^ value used here after move | ||
|
||
error[E0382]: use of moved value: `rhs` | ||
--> $DIR/binop-consume-args.rs:50:10 | ||
| | ||
LL | fn bitxor<A: BitXor<B, Output=()>, B>(lhs: A, rhs: B) { | ||
| - --- move occurs because `rhs` has type `B`, which does not implement the `Copy` trait | ||
| | | ||
| consider adding a `Copy` constraint to this type argument | ||
LL | lhs ^ rhs; | ||
| --- value moved here | ||
LL | drop(lhs); //~ ERROR use of moved value: `lhs` | ||
LL | drop(rhs); //~ ERROR use of moved value: `rhs` | ||
| ^^^ value used here after move | ||
|
||
error[E0382]: use of moved value: `lhs` | ||
--> $DIR/binop-consume-args.rs:55:10 | ||
| | ||
LL | fn shl<A: Shl<B, Output=()>, B>(lhs: A, rhs: B) { | ||
| - --- move occurs because `lhs` has type `A`, which does not implement the `Copy` trait | ||
| | | ||
| consider adding a `Copy` constraint to this type argument | ||
LL | lhs << rhs; | ||
| --- value moved here | ||
LL | drop(lhs); //~ ERROR use of moved value: `lhs` | ||
| ^^^ value used here after move | ||
|
||
error[E0382]: use of moved value: `rhs` | ||
--> $DIR/binop-consume-args.rs:56:10 | ||
| | ||
LL | fn shl<A: Shl<B, Output=()>, B>(lhs: A, rhs: B) { | ||
| - --- move occurs because `rhs` has type `B`, which does not implement the `Copy` trait | ||
| | | ||
| consider adding a `Copy` constraint to this type argument | ||
LL | lhs << rhs; | ||
| --- value moved here | ||
LL | drop(lhs); //~ ERROR use of moved value: `lhs` | ||
LL | drop(rhs); //~ ERROR use of moved value: `rhs` | ||
| ^^^ value used here after move | ||
|
||
error[E0382]: use of moved value: `lhs` | ||
--> $DIR/binop-consume-args.rs:61:10 | ||
| | ||
LL | fn shr<A: Shr<B, Output=()>, B>(lhs: A, rhs: B) { | ||
| - --- move occurs because `lhs` has type `A`, which does not implement the `Copy` trait | ||
| | | ||
| consider adding a `Copy` constraint to this type argument | ||
LL | lhs >> rhs; | ||
| --- value moved here | ||
LL | drop(lhs); //~ ERROR use of moved value: `lhs` | ||
| ^^^ value used here after move | ||
|
||
error[E0382]: use of moved value: `rhs` | ||
--> $DIR/binop-consume-args.rs:62:10 | ||
| | ||
LL | fn shr<A: Shr<B, Output=()>, B>(lhs: A, rhs: B) { | ||
| - --- move occurs because `rhs` has type `B`, which does not implement the `Copy` trait | ||
| | | ||
| consider adding a `Copy` constraint to this type argument | ||
LL | lhs >> rhs; | ||
| --- value moved here | ||
LL | drop(lhs); //~ ERROR use of moved value: `lhs` | ||
LL | drop(rhs); //~ ERROR use of moved value: `rhs` | ||
| ^^^ value used here after move | ||
|
||
error: aborting due to 20 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0382`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/test/ui/borrowck/borrowck-consume-unsize-vec.nll.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
error[E0382]: use of moved value: `b` | ||
--> $DIR/borrowck-consume-unsize-vec.rs:8:13 | ||
| | ||
LL | fn foo(b: Box<[i32;5]>) { | ||
| - move occurs because `b` has type `std::boxed::Box<[i32; 5]>`, which does not implement the `Copy` trait | ||
LL | consume(b); | ||
| - value moved here | ||
LL | consume(b); //~ ERROR use of moved value | ||
| ^ value used here after move | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0382`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/test/ui/borrowck/borrowck-loan-in-overloaded-op.nll.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.