Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rustc_mir: Re-use
report_selection_error
.
This commit replaces the new error that was being emitted in NLL type check with a call to `report_selection_error` so that the same trait error as before this PR is emitted.
- Loading branch information
Showing
10 changed files
with
53 additions
and
35 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
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
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: 9 additions & 4 deletions
13
src/test/ui/consts/rfc-2203-const-array-repeat-exprs/migrate-borrowck.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 |
---|---|---|
@@ -1,18 +1,23 @@ | ||
error: repeated expression does not implement `std::marker::Copy` | ||
error[E0277]: the trait bound `std::option::Option<Bar>: std::marker::Copy` is not satisfied | ||
--> $DIR/migrate-borrowck.rs:88:37 | ||
| | ||
LL | let arr: [Option<Bar>; 2] = [x; 2]; | ||
| ^^^^^^ the trait `std::marker::Copy` is not implemented for `std::option::Option<Bar>` | ||
| | ||
= note: the `std::marker::Copy` trait is required because the repeated element will be copied | ||
= help: the following implementations were found: | ||
<std::option::Option<T> as std::marker::Copy> | ||
= note: the `Copy` trait is required because the repeated element will be copied | ||
|
||
error: repeated expression does not implement `std::marker::Copy` | ||
error[E0277]: the trait bound `std::option::Option<Bar>: std::marker::Copy` is not satisfied | ||
--> $DIR/migrate-borrowck.rs:104:37 | ||
| | ||
LL | let arr: [Option<Bar>; 2] = [x; 2]; | ||
| ^^^^^^ the trait `std::marker::Copy` is not implemented for `std::option::Option<Bar>` | ||
| | ||
= note: the `std::marker::Copy` trait is required because the repeated element will be copied | ||
= help: the following implementations were found: | ||
<std::option::Option<T> as std::marker::Copy> | ||
= note: the `Copy` trait is required because the repeated element will be copied | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0277`. |
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: 9 additions & 4 deletions
13
src/test/ui/consts/rfc-2203-const-array-repeat-exprs/nll-borrowck.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 |
---|---|---|
@@ -1,18 +1,23 @@ | ||
error: repeated expression does not implement `std::marker::Copy` | ||
error[E0277]: the trait bound `std::option::Option<Bar>: std::marker::Copy` is not satisfied | ||
--> $DIR/nll-borrowck.rs:87:37 | ||
| | ||
LL | let arr: [Option<Bar>; 2] = [x; 2]; | ||
| ^^^^^^ the trait `std::marker::Copy` is not implemented for `std::option::Option<Bar>` | ||
| | ||
= note: the `std::marker::Copy` trait is required because the repeated element will be copied | ||
= help: the following implementations were found: | ||
<std::option::Option<T> as std::marker::Copy> | ||
= note: the `Copy` trait is required because the repeated element will be copied | ||
|
||
error: repeated expression does not implement `std::marker::Copy` | ||
error[E0277]: the trait bound `std::option::Option<Bar>: std::marker::Copy` is not satisfied | ||
--> $DIR/nll-borrowck.rs:103:37 | ||
| | ||
LL | let arr: [Option<Bar>; 2] = [x; 2]; | ||
| ^^^^^^ the trait `std::marker::Copy` is not implemented for `std::option::Option<Bar>` | ||
| | ||
= note: the `std::marker::Copy` trait is required because the repeated element will be copied | ||
= help: the following implementations were found: | ||
<std::option::Option<T> as std::marker::Copy> | ||
= note: the `Copy` trait is required because the repeated element will be copied | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0277`. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
error: repeated expression does not implement `std::marker::Copy` | ||
error[E0277]: the trait bound `Foo: std::marker::Copy` is not satisfied | ||
--> $DIR/repeat-to-run-dtor-twice.rs:17:13 | ||
| | ||
LL | let _ = [ a; 5 ]; | ||
| ^^^^^^^^ the trait `std::marker::Copy` is not implemented for `Foo` | ||
| | ||
= note: the `std::marker::Copy` trait is required because the repeated element will be copied | ||
= note: the `Copy` trait is required because the repeated element will be copied | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0277`. |