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.
Fix pointing at arg when cause is outside of call
- Loading branch information
Showing
3 changed files
with
69 additions
and
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
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 | ||
fft.push(x2); | ||
|
||
let x3 = x1.into_iter().collect::<Vec<f64>>(); | ||
//~^ ERROR a collection of type | ||
fft.push(x3); | ||
} |
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 collection of type `std::vec::Vec<f64>` cannot be built from an iterator over elements of type `&f64` | ||
--> $DIR/issue-66923.rs:6:39 | ||
| | ||
LL | let x2: Vec<f64> = x1.into_iter().collect(); | ||
| ^^^^^^^ a collection 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 collection of type `std::vec::Vec<f64>` cannot be built from an iterator over elements of type `&f64` | ||
--> $DIR/issue-66923.rs:10:29 | ||
| | ||
LL | let x3 = x1.into_iter().collect::<Vec<f64>>(); | ||
| ^^^^^^^ a collection 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`. |