@@ -1514,7 +1514,7 @@ impl<'a> Parser<'a> {
15141514 let ident = this. parse_field_ident ( "enum" , vlo) ?;
15151515
15161516 if this. token == token:: Not {
1517- if let Err ( err) = this. unexpected :: < ( ) > ( ) {
1517+ if let Err ( err) = this. unexpected ( ) {
15181518 err. with_note ( fluent:: parse_macro_expands_to_enum_variant) . emit ( ) ;
15191519 }
15201520
@@ -1937,7 +1937,7 @@ impl<'a> Parser<'a> {
19371937 ) -> PResult < ' a , FieldDef > {
19381938 let name = self . parse_field_ident ( adt_ty, lo) ?;
19391939 if self . token . kind == token:: Not {
1940- if let Err ( mut err) = self . unexpected :: < FieldDef > ( ) {
1940+ if let Err ( mut err) = self . unexpected ( ) {
19411941 // Encounter the macro invocation
19421942 err. subdiagnostic ( self . dcx ( ) , MacroExpandsToAdtField { adt_ty } ) ;
19431943 return Err ( err) ;
@@ -2067,7 +2067,7 @@ impl<'a> Parser<'a> {
20672067 let params = self . parse_token_tree ( ) ; // `MacParams`
20682068 let pspan = params. span ( ) ;
20692069 if !self . check ( & token:: OpenDelim ( Delimiter :: Brace ) ) {
2070- return self . unexpected ( ) ;
2070+ self . unexpected ( ) ? ;
20712071 }
20722072 let body = self . parse_token_tree ( ) ; // `MacBody`
20732073 // Convert `MacParams MacBody` into `{ MacParams => MacBody }`.
@@ -2077,7 +2077,7 @@ impl<'a> Parser<'a> {
20772077 let dspan = DelimSpan :: from_pair ( pspan. shrink_to_lo ( ) , bspan. shrink_to_hi ( ) ) ;
20782078 P ( DelimArgs { dspan, delim : Delimiter :: Brace , tokens } )
20792079 } else {
2080- return self . unexpected ( ) ;
2080+ self . unexpected_any ( ) ?
20812081 } ;
20822082
20832083 self . psess . gated_spans . gate ( sym:: decl_macro, lo. to ( self . prev_token . span ) ) ;
@@ -2692,7 +2692,7 @@ impl<'a> Parser<'a> {
26922692 debug ! ( "parse_param_general parse_pat (is_name_required:{})" , is_name_required) ;
26932693 let ( pat, colon) = this. parse_fn_param_pat_colon ( ) ?;
26942694 if !colon {
2695- let mut err = this. unexpected :: < ( ) > ( ) . unwrap_err ( ) ;
2695+ let mut err = this. unexpected ( ) . unwrap_err ( ) ;
26962696 return if let Some ( ident) =
26972697 this. parameter_without_type ( & mut err, pat, is_name_required, first_param)
26982698 {
@@ -2716,7 +2716,7 @@ impl<'a> Parser<'a> {
27162716 {
27172717 // This wasn't actually a type, but a pattern looking like a type,
27182718 // so we are going to rollback and re-parse for recovery.
2719- ty = this. unexpected ( ) ;
2719+ ty = this. unexpected_any ( ) ;
27202720 }
27212721 match ty {
27222722 Ok ( ty) => {
0 commit comments