We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 991d2ee commit 07ee472Copy full SHA for 07ee472
src/librustc_parse/parser/path.rs
@@ -82,13 +82,17 @@ impl<'a> Parser<'a> {
82
}
83
84
/// Recover from an invalid single colon, when the user likely meant a qualified path.
85
+ /// We avoid emitting this if not followed by an identifier, as our assumption that the user
86
+ /// intended this to be a qualified path may not be correct.
87
///
88
/// ```ignore (diagnostics)
89
/// <Bar as Baz<T>>:Qux
90
/// ^ help: use double colon
91
/// ```
92
fn recover_colon_before_qpath_proj(&mut self) -> bool {
- if self.token.kind != token::Colon {
93
+ if self.token.kind != token::Colon
94
+ || self.look_ahead(1, |t| !t.is_ident() || t.is_reserved_ident())
95
+ {
96
return false;
97
98
0 commit comments