forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename tests and add short test description
- Loading branch information
Showing
5 changed files
with
38 additions
and
26 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
6 changes: 4 additions & 2 deletions
6
src/test/ui/issues/issue-66923.rs → ...ssue-66923-show-error-for-correct-call.rs
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,13 +1,15 @@ | ||
// This test checks that errors are showed for lines with `collect` rather than `push` method. | ||
|
||
fn main() { | ||
let v = vec![1_f64, 2.2_f64]; | ||
let mut fft: Vec<Vec<f64>> = vec![]; | ||
|
||
let x1: &[f64] = &v; | ||
let x2: Vec<f64> = x1.into_iter().collect(); | ||
//~^ ERROR a collection of type | ||
//~^ ERROR a value of type | ||
fft.push(x2); | ||
|
||
let x3 = x1.into_iter().collect::<Vec<f64>>(); | ||
//~^ ERROR a collection of type | ||
//~^ ERROR a value of type | ||
fft.push(x3); | ||
} |
19 changes: 19 additions & 0 deletions
19
src/test/ui/issues/issue-66923-show-error-for-correct-call.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,19 @@ | ||
error[E0277]: a value of type `std::vec::Vec<f64>` cannot be built from an iterator over elements of type `&f64` | ||
--> $DIR/issue-66923-show-error-for-correct-call.rs:8:39 | ||
| | ||
LL | let x2: Vec<f64> = x1.into_iter().collect(); | ||
| ^^^^^^^ value of type `std::vec::Vec<f64>` cannot be built from `std::iter::Iterator<Item=&f64>` | ||
| | ||
= help: the trait `std::iter::FromIterator<&f64>` is not implemented for `std::vec::Vec<f64>` | ||
|
||
error[E0277]: a value of type `std::vec::Vec<f64>` cannot be built from an iterator over elements of type `&f64` | ||
--> $DIR/issue-66923-show-error-for-correct-call.rs:12:29 | ||
| | ||
LL | let x3 = x1.into_iter().collect::<Vec<f64>>(); | ||
| ^^^^^^^ value of type `std::vec::Vec<f64>` cannot be built from `std::iter::Iterator<Item=&f64>` | ||
| | ||
= help: the trait `std::iter::FromIterator<&f64>` is not implemented for `std::vec::Vec<f64>` | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0277`. |
This file was deleted.
Oops, something went wrong.