Account for type params on method without parens

This commit is contained in:
Esteban Küber 2020-02-08 20:02:54 -08:00
parent a19edd6b16
commit 97d47a5e7c
4 changed files with 37 additions and 7 deletions

View file

@ -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
}

View file

@ -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`.