File tree Expand file tree Collapse file tree 1 file changed +17
-15
lines changed
compiler/rustc_parse/src/parser Expand file tree Collapse file tree 1 file changed +17
-15
lines changed Original file line number Diff line number Diff line change @@ -666,21 +666,23 @@ impl<'a> Parser<'a> {
666666 ) ;
667667 match x {
668668 Ok ( ( _, _, false ) ) => {
669- self . bump ( ) ; // `>`
670- match self . parse_expr ( ) {
671- Ok ( _) => {
672- e. span_suggestion_verbose (
673- binop. span . shrink_to_lo ( ) ,
674- TURBOFISH_SUGGESTION_STR ,
675- "::" . to_string ( ) ,
676- Applicability :: MaybeIncorrect ,
677- ) ;
678- e. emit ( ) ;
679- * expr = self . mk_expr_err ( expr. span . to ( self . prev_token . span ) ) ;
680- return Ok ( ( ) ) ;
681- }
682- Err ( mut err) => {
683- err. cancel ( ) ;
669+ if self . eat ( & token:: Gt ) {
670+ match self . parse_expr ( ) {
671+ Ok ( _) => {
672+ e. span_suggestion_verbose (
673+ binop. span . shrink_to_lo ( ) ,
674+ TURBOFISH_SUGGESTION_STR ,
675+ "::" . to_string ( ) ,
676+ Applicability :: MaybeIncorrect ,
677+ ) ;
678+ e. emit ( ) ;
679+ * expr =
680+ self . mk_expr_err ( expr. span . to ( self . prev_token . span ) ) ;
681+ return Ok ( ( ) ) ;
682+ }
683+ Err ( mut err) => {
684+ err. cancel ( ) ;
685+ }
684686 }
685687 }
686688 }
You can’t perform that action at this time.
0 commit comments