@@ -126,7 +126,7 @@ impl<'a> Parser<'a> {
126126 /// ```
127127 fn recover_colon_before_qpath_proj ( & mut self ) -> bool {
128128 if !self . check_noexpect ( & TokenKind :: Colon )
129- || self . look_ahead ( 1 , |t| !t. is_ident ( ) || t . is_reserved_ident ( ) )
129+ || self . look_ahead ( 1 , |t| !t. is_non_reserved_ident ( ) )
130130 {
131131 return false ;
132132 }
@@ -260,7 +260,7 @@ impl<'a> Parser<'a> {
260260 if self . may_recover ( )
261261 && style == PathStyle :: Expr // (!)
262262 && self . token == token:: Colon
263- && self . look_ahead ( 1 , |token| token. is_ident ( ) && !token . is_reserved_ident ( ) )
263+ && self . look_ahead ( 1 , |token| token. is_non_reserved_ident ( ) )
264264 {
265265 // Emit a special error message for `a::b:c` to help users
266266 // otherwise, `a: c` might have meant to introduce a new binding
@@ -334,9 +334,7 @@ impl<'a> Parser<'a> {
334334 self . expect_gt ( ) . map_err ( |mut err| {
335335 // Try to recover a `:` into a `::`
336336 if self . token == token:: Colon
337- && self . look_ahead ( 1 , |token| {
338- token. is_ident ( ) && !token. is_reserved_ident ( )
339- } )
337+ && self . look_ahead ( 1 , |token| token. is_non_reserved_ident ( ) )
340338 {
341339 err. cancel ( ) ;
342340 err = self . dcx ( ) . create_err ( PathSingleColon {
0 commit comments