Rollup merge of #45122 - jean-lourenco:master, r=nikomatsakis
Better compile error output when using arguments instead of types Following @estebank sugestion on issue https://github.com/rust-lang/rust/issues/18945#issuecomment-331251436
This commit is contained in:
commit
9eab4ec823
@ -2960,6 +2960,7 @@ impl<'a> Parser<'a> {
|
||||
{ // Foo<Bar<Baz<Qux, ()>>>
|
||||
err.help(
|
||||
"use `::<...>` instead of `<...>` if you meant to specify type arguments");
|
||||
err.help("or use `(...)` if you meant to specify fn arguments");
|
||||
}
|
||||
err.emit();
|
||||
}
|
||||
|
@ -21,5 +21,6 @@ fn main() {
|
||||
|
||||
f<X>();
|
||||
//~^ ERROR: chained comparison operators require parentheses
|
||||
//~^^ HELP: use `::<...>` instead of `<...>`
|
||||
//~| HELP: use `::<...>` instead of `<...>`
|
||||
//~| HELP: or use `(...)`
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ error: chained comparison operators require parentheses
|
||||
| ^^^^^^^^
|
||||
|
|
||||
= help: use `::<...>` instead of `<...>` if you meant to specify type arguments
|
||||
= help: or use `(...)` if you meant to specify fn arguments
|
||||
|
||||
error: chained comparison operators require parentheses
|
||||
--> $DIR/issue-40396.rs:16:25
|
||||
@ -13,6 +14,7 @@ error: chained comparison operators require parentheses
|
||||
| ^^^^^^^
|
||||
|
|
||||
= help: use `::<...>` instead of `<...>` if you meant to specify type arguments
|
||||
= help: or use `(...)` if you meant to specify fn arguments
|
||||
|
||||
error: chained comparison operators require parentheses
|
||||
--> $DIR/issue-40396.rs:20:37
|
||||
@ -21,6 +23,7 @@ error: chained comparison operators require parentheses
|
||||
| ^^^^^^^^
|
||||
|
|
||||
= help: use `::<...>` instead of `<...>` if you meant to specify type arguments
|
||||
= help: or use `(...)` if you meant to specify fn arguments
|
||||
|
||||
error: chained comparison operators require parentheses
|
||||
--> $DIR/issue-40396.rs:20:41
|
||||
@ -29,6 +32,7 @@ error: chained comparison operators require parentheses
|
||||
| ^^^^^^
|
||||
|
|
||||
= help: use `::<...>` instead of `<...>` if you meant to specify type arguments
|
||||
= help: or use `(...)` if you meant to specify fn arguments
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user