-
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.
Account for type params on method without parens
- Loading branch information
Showing
4 changed files
with
37 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
fn main() { | ||
let _ = vec![].into_iter().collect::<usize>; | ||
//~^ ERROR attempted to take value of method `collect` on type `std::vec::IntoIter<_>` | ||
//~| ERROR field expressions may not have generic arguments | ||
} |
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,17 @@ | ||
error: field expressions may not have generic arguments | ||
--> $DIR/method-missing-parentheses.rs:2:41 | ||
| | ||
LL | let _ = vec![].into_iter().collect::<usize>; | ||
| ^^^^^^^ | ||
|
||
error[E0615]: attempted to take value of method `collect` on type `std::vec::IntoIter<_>` | ||
--> $DIR/method-missing-parentheses.rs:2:32 | ||
| | ||
LL | let _ = vec![].into_iter().collect::<usize>; | ||
| ^^^^^^^--------- | ||
| | | ||
| help: use parentheses to call the method: `collect::<usize>()` | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0615`. |