@@ -4,10 +4,11 @@ use super::{
4
4
TokenExpectType , TokenType ,
5
5
} ;
6
6
use 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 ,
11
12
GenericParamsWithoutAngleBrackets , GenericParamsWithoutAngleBracketsSugg ,
12
13
HelpIdentifierStartsWithNumber , InInTypo , IncorrectAwait , IncorrectSemicolon ,
13
14
IncorrectUseOfAwait , ParenthesesInForHead , ParenthesesInForHeadSugg ,
@@ -573,6 +574,12 @@ impl<'a> Parser<'a> {
573
574
return Err ( self . sess . create_err ( UseEqInstead { span : self . token . span } ) ) ;
574
575
}
575
576
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
+
576
583
let expect = tokens_to_string ( & expected) ;
577
584
let actual = super :: token_descr ( & self . token ) ;
578
585
let ( msg_exp, ( label_sp, label_exp) ) = if expected. len ( ) > 1 {
0 commit comments