@@ -1514,7 +1514,7 @@ impl<'a> Parser<'a> {
1514
1514
let ident = this. parse_field_ident ( "enum" , vlo) ?;
1515
1515
1516
1516
if this. token == token:: Not {
1517
- if let Err ( err) = this. unexpected :: < ( ) > ( ) {
1517
+ if let Err ( err) = this. unexpected ( ) {
1518
1518
err. with_note ( fluent:: parse_macro_expands_to_enum_variant) . emit ( ) ;
1519
1519
}
1520
1520
@@ -1937,7 +1937,7 @@ impl<'a> Parser<'a> {
1937
1937
) -> PResult < ' a , FieldDef > {
1938
1938
let name = self . parse_field_ident ( adt_ty, lo) ?;
1939
1939
if self . token . kind == token:: Not {
1940
- if let Err ( mut err) = self . unexpected :: < FieldDef > ( ) {
1940
+ if let Err ( mut err) = self . unexpected ( ) {
1941
1941
// Encounter the macro invocation
1942
1942
err. subdiagnostic ( self . dcx ( ) , MacroExpandsToAdtField { adt_ty } ) ;
1943
1943
return Err ( err) ;
@@ -2067,7 +2067,7 @@ impl<'a> Parser<'a> {
2067
2067
let params = self . parse_token_tree ( ) ; // `MacParams`
2068
2068
let pspan = params. span ( ) ;
2069
2069
if !self . check ( & token:: OpenDelim ( Delimiter :: Brace ) ) {
2070
- return self . unexpected ( ) ;
2070
+ self . unexpected ( ) ? ;
2071
2071
}
2072
2072
let body = self . parse_token_tree ( ) ; // `MacBody`
2073
2073
// Convert `MacParams MacBody` into `{ MacParams => MacBody }`.
@@ -2077,7 +2077,7 @@ impl<'a> Parser<'a> {
2077
2077
let dspan = DelimSpan :: from_pair ( pspan. shrink_to_lo ( ) , bspan. shrink_to_hi ( ) ) ;
2078
2078
P ( DelimArgs { dspan, delim : Delimiter :: Brace , tokens } )
2079
2079
} else {
2080
- return self . unexpected ( ) ;
2080
+ self . unexpected_any ( ) ?
2081
2081
} ;
2082
2082
2083
2083
self . psess . gated_spans . gate ( sym:: decl_macro, lo. to ( self . prev_token . span ) ) ;
@@ -2692,7 +2692,7 @@ impl<'a> Parser<'a> {
2692
2692
debug ! ( "parse_param_general parse_pat (is_name_required:{})" , is_name_required) ;
2693
2693
let ( pat, colon) = this. parse_fn_param_pat_colon ( ) ?;
2694
2694
if !colon {
2695
- let mut err = this. unexpected :: < ( ) > ( ) . unwrap_err ( ) ;
2695
+ let mut err = this. unexpected ( ) . unwrap_err ( ) ;
2696
2696
return if let Some ( ident) =
2697
2697
this. parameter_without_type ( & mut err, pat, is_name_required, first_param)
2698
2698
{
@@ -2716,7 +2716,7 @@ impl<'a> Parser<'a> {
2716
2716
{
2717
2717
// This wasn't actually a type, but a pattern looking like a type,
2718
2718
// so we are going to rollback and re-parse for recovery.
2719
- ty = this. unexpected ( ) ;
2719
+ ty = this. unexpected_any ( ) ;
2720
2720
}
2721
2721
match ty {
2722
2722
Ok ( ty) => {
0 commit comments