@@ -4,10 +4,11 @@ use super::{
44 TokenExpectType , TokenType ,
55} ;
66use crate :: errors:: {
7- AmbiguousPlus , AttributeOnParamType , BadQPathStage2 , BadTypePlus , BadTypePlusSub , ColonAsSemi ,
8- ComparisonOperatorsCannotBeChained , ComparisonOperatorsCannotBeChainedSugg ,
9- ConstGenericWithoutBraces , ConstGenericWithoutBracesSugg , DocCommentDoesNotDocumentAnything ,
10- DocCommentOnParamType , DoubleColonInBound , ExpectedIdentifier , ExpectedSemi , ExpectedSemiSugg ,
7+ AmbiguousPlus , AsyncMoveBlockIn2015 , AttributeOnParamType , BadQPathStage2 , BadTypePlus ,
8+ BadTypePlusSub , ColonAsSemi , ComparisonOperatorsCannotBeChained ,
9+ ComparisonOperatorsCannotBeChainedSugg , ConstGenericWithoutBraces ,
10+ ConstGenericWithoutBracesSugg , DocCommentDoesNotDocumentAnything , DocCommentOnParamType ,
11+ DoubleColonInBound , ExpectedIdentifier , ExpectedSemi , ExpectedSemiSugg ,
1112 GenericParamsWithoutAngleBrackets , GenericParamsWithoutAngleBracketsSugg ,
1213 HelpIdentifierStartsWithNumber , InInTypo , IncorrectAwait , IncorrectSemicolon ,
1314 IncorrectUseOfAwait , ParenthesesInForHead , ParenthesesInForHeadSugg ,
@@ -573,6 +574,12 @@ impl<'a> Parser<'a> {
573574 return Err ( self . sess . create_err ( UseEqInstead { span : self . token . span } ) ) ;
574575 }
575576
577+ if self . token . is_keyword ( kw:: Move ) && self . prev_token . is_keyword ( kw:: Async ) {
578+ // The 2015 edition is in use because parsing of `async move` has failed.
579+ let span = self . prev_token . span . to ( self . token . span ) ;
580+ return Err ( self . sess . create_err ( AsyncMoveBlockIn2015 { span } ) ) ;
581+ }
582+
576583 let expect = tokens_to_string ( & expected) ;
577584 let actual = super :: token_descr ( & self . token ) ;
578585 let ( msg_exp, ( label_sp, label_exp) ) = if expected. len ( ) > 1 {
0 commit comments