-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Actual behavior: When you compile this program,
fn main() {
println!("{:?}", (0..13).collect<Vec<i32>>());
}
this is the error message:
error: chained comparison operators require parentheses
--> collect_err.rs:2:37
|
2 | println!("{:?}", (0..13).collect<Vec<i32>>());
| ^^^^^^^^
Expected behavior: If you trigger this error in a slightly different way,
fn main() {
println!("{:?}", Vec<i32>::new());
}
you get a lovely "help" message at the end:
error: chained comparison operators require parentheses
--> collect_err.rs:2:25
|
2 | println!("{:?}", Vec<i32>::new());
| ^^^^^^^
|
= help: use `::<...>` instead of `<...>` if you meant to specify type arguments
The bug is that the first program does not trigger this help message.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.