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.
Rollup merge of rust-lang#68681 - bobrippling:fix-matched-angle-brack…
…ets, r=Centril Suggest path separator for single-colon typos This commit adds guidance for when a user means to type a path, but ends up typing a single colon, such as `<<Impl as T>:Ty>`. This change seemed pertinent as the current error message is particularly misleading, emitting `error: unmatched angle bracket`, despite the angle bracket being matched later on, leaving the user to track down the typo'd colon.
- Loading branch information
Showing
4 changed files
with
82 additions
and
1 deletion.
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,19 @@ | ||
// run-rustfix | ||
trait T { | ||
type Ty; | ||
} | ||
|
||
struct Impl; | ||
|
||
impl T for Impl { | ||
type Ty = u32; | ||
} | ||
|
||
fn template<T>() -> i64 { | ||
3 | ||
} | ||
|
||
fn main() { | ||
template::<<Impl as T>::Ty>(); | ||
//~^ ERROR found single colon before projection in qualified path | ||
} |
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 @@ | ||
// run-rustfix | ||
trait T { | ||
type Ty; | ||
} | ||
|
||
struct Impl; | ||
|
||
impl T for Impl { | ||
type Ty = u32; | ||
} | ||
|
||
fn template<T>() -> i64 { | ||
3 | ||
} | ||
|
||
fn main() { | ||
template::<<Impl as T>:Ty>(); | ||
//~^ ERROR found single colon before projection in qualified path | ||
} |
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,8 @@ | ||
error: found single colon before projection in qualified path | ||
--> $DIR/qualified-path-in-turbofish.rs:17:27 | ||
| | ||
LL | template::<<Impl as T>:Ty>(); | ||
| ^ help: use double colon: `::` | ||
|
||
error: aborting due to previous error | ||
|