@@ -563,6 +563,7 @@ impl Pat {
563563 /// This is intended for use by diagnostics.
564564 pub fn to_ty ( & self ) -> Option < P < Ty > > {
565565 let kind = match & self . kind {
566+ PatKind :: Missing => unreachable ! ( ) ,
566567 // In a type expression `_` is an inference variable.
567568 PatKind :: Wild => TyKind :: Infer ,
568569 // An IDENT pattern with no binding mode would be valid as path to a type. E.g. `u32`.
@@ -625,7 +626,8 @@ impl Pat {
625626 | PatKind :: Guard ( s, _) => s. walk ( it) ,
626627
627628 // These patterns do not contain subpatterns, skip.
628- PatKind :: Wild
629+ PatKind :: Missing
630+ | PatKind :: Wild
629631 | PatKind :: Rest
630632 | PatKind :: Never
631633 | PatKind :: Expr ( _)
@@ -676,6 +678,7 @@ impl Pat {
676678 /// Return a name suitable for diagnostics.
677679 pub fn descr ( & self ) -> Option < String > {
678680 match & self . kind {
681+ PatKind :: Missing => unreachable ! ( ) ,
679682 PatKind :: Wild => Some ( "_" . to_string ( ) ) ,
680683 PatKind :: Ident ( BindingMode :: NONE , ident, None ) => Some ( format ! ( "{ident}" ) ) ,
681684 PatKind :: Ref ( pat, mutbl) => pat. descr ( ) . map ( |d| format ! ( "&{}{d}" , mutbl. prefix_str( ) ) ) ,
@@ -769,6 +772,9 @@ pub enum RangeSyntax {
769772// Adding a new variant? Please update `test_pat` in `tests/ui/macros/stringify.rs`.
770773#[ derive( Clone , Encodable , Decodable , Debug ) ]
771774pub enum PatKind {
775+ /// A missing pattern, e.g. for an anonymous param in a bare fn like `fn f(u32)`.
776+ Missing ,
777+
772778 /// Represents a wildcard pattern (`_`).
773779 Wild ,
774780
@@ -1169,6 +1175,7 @@ pub enum MacStmtStyle {
11691175#[ derive( Clone , Encodable , Decodable , Debug ) ]
11701176pub struct Local {
11711177 pub id : NodeId ,
1178+ pub super_ : Option < Span > ,
11721179 pub pat : P < Pat > ,
11731180 pub ty : Option < P < Ty > > ,
11741181 pub kind : LocalKind ,
@@ -3926,7 +3933,7 @@ mod size_asserts {
39263933 static_assert_size ! ( Item , 144 ) ;
39273934 static_assert_size ! ( ItemKind , 80 ) ;
39283935 static_assert_size ! ( LitKind , 24 ) ;
3929- static_assert_size ! ( Local , 80 ) ;
3936+ static_assert_size ! ( Local , 96 ) ;
39303937 static_assert_size ! ( MetaItemLit , 40 ) ;
39313938 static_assert_size ! ( Param , 40 ) ;
39323939 static_assert_size ! ( Pat , 72 ) ;
0 commit comments