@@ -718,10 +718,10 @@ pub enum PatKind {
718718
719719    /// A struct or struct variant pattern (e.g., `Variant {x, y, ..}`). 
720720/// The `bool` is `true` in the presence of a `..`. 
721- Struct ( Option < QSelf > ,  Path ,  Vec < PatField > ,  /* recovered */  bool ) , 
721+ Struct ( Option < P < QSelf > > ,  Path ,  Vec < PatField > ,  /* recovered */  bool ) , 
722722
723723    /// A tuple struct/variant pattern (`Variant(x, y, .., z)`). 
724- TupleStruct ( Option < QSelf > ,  Path ,  Vec < P < Pat > > ) , 
724+ TupleStruct ( Option < P < QSelf > > ,  Path ,  Vec < P < Pat > > ) , 
725725
726726    /// An or-pattern `A | B | C`. 
727727/// Invariant: `pats.len() >= 2`. 
@@ -731,7 +731,7 @@ pub enum PatKind {
731731/// Unqualified path patterns `A::B::C` can legally refer to variants, structs, constants 
732732/// or associated constants. Qualified path patterns `<A>::B::C`/`<A as Trait>::B::C` can 
733733/// only legally refer to associated constants. 
734- Path ( Option < QSelf > ,  Path ) , 
734+ Path ( Option < P < QSelf > > ,  Path ) , 
735735
736736    /// A tuple pattern (`(a, b)`). 
737737Tuple ( Vec < P < Pat > > ) , 
@@ -1272,6 +1272,18 @@ impl Expr {
12721272    } 
12731273} 
12741274
1275+ #[ derive( Clone ,  Encodable ,  Decodable ,  Debug ) ]  
1276+ pub  struct  Closure  { 
1277+     pub  binder :  ClosureBinder , 
1278+     pub  capture_clause :  CaptureBy , 
1279+     pub  asyncness :  Async , 
1280+     pub  movability :  Movability , 
1281+     pub  fn_decl :  P < FnDecl > , 
1282+     pub  body :  P < Expr > , 
1283+     /// The span of the argument block `|...|`. 
1284+ pub  fn_decl_span :  Span , 
1285+ } 
1286+ 
12751287/// Limit types of a range (inclusive or exclusive) 
12761288#[ derive( Copy ,  Clone ,  PartialEq ,  Encodable ,  Decodable ,  Debug ) ]  
12771289pub  enum  RangeLimits  { 
@@ -1281,6 +1293,20 @@ pub enum RangeLimits {
12811293Closed , 
12821294} 
12831295
1296+ /// A method call (e.g. `x.foo::<Bar, Baz>(a, b, c)`). 
1297+ #[ derive( Clone ,  Encodable ,  Decodable ,  Debug ) ]  
1298+ pub  struct  MethodCall  { 
1299+     /// The method name and its generic arguments, e.g. `foo::<Bar, Baz>`. 
1300+ pub  seg :  PathSegment , 
1301+     /// The receiver, e.g. `x`. 
1302+ pub  receiver :  P < Expr > , 
1303+     /// The arguments, e.g. `a, b, c`. 
1304+ pub  args :  Vec < P < Expr > > , 
1305+     /// The span of the function, without the dot and receiver e.g. `foo::<Bar, 
1306+ /// Baz>(a, b, c)`. 
1307+ pub  span :  Span , 
1308+ } 
1309+ 
12841310#[ derive( Clone ,  Encodable ,  Decodable ,  Debug ) ]  
12851311pub  enum  StructRest  { 
12861312    /// `..x`. 
@@ -1293,7 +1319,7 @@ pub enum StructRest {
12931319
12941320#[ derive( Clone ,  Encodable ,  Decodable ,  Debug ) ]  
12951321pub  struct  StructExpr  { 
1296-     pub  qself :  Option < QSelf > , 
1322+     pub  qself :  Option < P < QSelf > > , 
12971323    pub  path :  Path , 
12981324    pub  fields :  Vec < ExprField > , 
12991325    pub  rest :  StructRest , 
@@ -1314,17 +1340,8 @@ pub enum ExprKind {
13141340/// This also represents calling the constructor of 
13151341/// tuple-like ADTs such as tuple structs and enum variants. 
13161342Call ( P < Expr > ,  Vec < P < Expr > > ) , 
1317-     /// A method call (`x.foo::<'static, Bar, Baz>(a, b, c, d)`) 
1318- /// 
1319- /// The `PathSegment` represents the method name and its generic arguments 
1320- /// (within the angle brackets). 
1321- /// The standalone `Expr` is the receiver expression. 
1322- /// The vector of `Expr` is the arguments. 
1323- /// `x.foo::<Bar, Baz>(a, b, c, d)` is represented as 
1324- /// `ExprKind::MethodCall(PathSegment { foo, [Bar, Baz] }, x, [a, b, c, d])`. 
1325- /// This `Span` is the span of the function, without the dot and receiver 
1326- /// (e.g. `foo(a, b)` in `x.foo(a, b)` 
1327- MethodCall ( PathSegment ,  P < Expr > ,  Vec < P < Expr > > ,  Span ) , 
1343+     /// A method call (e.g. `x.foo::<Bar, Baz>(a, b, c)`). 
1344+ MethodCall ( Box < MethodCall > ) , 
13281345    /// A tuple (e.g., `(a, b, c, d)`). 
13291346Tup ( Vec < P < Expr > > ) , 
13301347    /// A binary operation (e.g., `a + b`, `a * b`). 
@@ -1363,9 +1380,7 @@ pub enum ExprKind {
13631380    /// A `match` block. 
13641381Match ( P < Expr > ,  Vec < Arm > ) , 
13651382    /// A closure (e.g., `move |a, b, c| a + b + c`). 
1366- /// 
1367- /// The final span is the span of the argument block `|...|`. 
1368- Closure ( ClosureBinder ,  CaptureBy ,  Async ,  Movability ,  P < FnDecl > ,  P < Expr > ,  Span ) , 
1383+ Closure ( Box < Closure > ) , 
13691384    /// A block (`'label: { ... }`). 
13701385Block ( P < Block > ,  Option < Label > ) , 
13711386    /// An async block (`async move { ... }`). 
@@ -1403,7 +1418,7 @@ pub enum ExprKind {
14031418/// parameters (e.g., `foo::bar::<baz>`). 
14041419/// 
14051420/// Optionally "qualified" (e.g., `<Vec<T> as SomeTrait>::SomeType`). 
1406- Path ( Option < QSelf > ,  Path ) , 
1421+ Path ( Option < P < QSelf > > ,  Path ) , 
14071422
14081423    /// A referencing operation (`&a`, `&mut a`, `&raw const a` or `&raw mut a`). 
14091424AddrOf ( BorrowKind ,  Mutability ,  P < Expr > ) , 
@@ -2006,7 +2021,7 @@ pub enum TyKind {
20062021/// "qualified", e.g., `<Vec<T> as SomeTrait>::SomeType`. 
20072022/// 
20082023/// Type parameters are stored in the `Path` itself. 
2009- Path ( Option < QSelf > ,  Path ) , 
2024+ Path ( Option < P < QSelf > > ,  Path ) , 
20102025    /// A trait object type `Bound1 + Bound2 + Bound3` 
20112026/// where `Bound` is a trait or a lifetime. 
20122027TraitObject ( GenericBounds ,  TraitObjectSyntax ) , 
@@ -2138,7 +2153,7 @@ impl InlineAsmTemplatePiece {
21382153#[ derive( Clone ,  Encodable ,  Decodable ,  Debug ) ]  
21392154pub  struct  InlineAsmSym  { 
21402155    pub  id :  NodeId , 
2141-     pub  qself :  Option < QSelf > , 
2156+     pub  qself :  Option < P < QSelf > > , 
21422157    pub  path :  Path , 
21432158} 
21442159
@@ -3031,8 +3046,8 @@ mod size_asserts {
30313046    static_assert_size ! ( AssocItemKind ,  32 ) ; 
30323047    static_assert_size ! ( Attribute ,  32 ) ; 
30333048    static_assert_size ! ( Block ,  48 ) ; 
3034-     static_assert_size ! ( Expr ,  104 ) ; 
3035-     static_assert_size ! ( ExprKind ,  72 ) ; 
3049+     static_assert_size ! ( Expr ,  88 ) ; 
3050+     static_assert_size ! ( ExprKind ,  56 ) ; 
30363051    static_assert_size ! ( Fn ,  184 ) ; 
30373052    static_assert_size ! ( ForeignItem ,  96 ) ; 
30383053    static_assert_size ! ( ForeignItemKind ,  24 ) ; 
@@ -3046,13 +3061,13 @@ mod size_asserts {
30463061    static_assert_size ! ( LitKind ,  24 ) ; 
30473062    static_assert_size ! ( Local ,  72 ) ; 
30483063    static_assert_size ! ( Param ,  40 ) ; 
3049-     static_assert_size ! ( Pat ,  120 ) ; 
3064+     static_assert_size ! ( Pat ,  104 ) ; 
30503065    static_assert_size ! ( Path ,  40 ) ; 
30513066    static_assert_size ! ( PathSegment ,  24 ) ; 
3052-     static_assert_size ! ( PatKind ,  96 ) ; 
3067+     static_assert_size ! ( PatKind ,  80 ) ; 
30533068    static_assert_size ! ( Stmt ,  32 ) ; 
30543069    static_assert_size ! ( StmtKind ,  16 ) ; 
3055-     static_assert_size ! ( Ty ,  96 ) ; 
3056-     static_assert_size ! ( TyKind ,  72 ) ; 
3070+     static_assert_size ! ( Ty ,  80 ) ; 
3071+     static_assert_size ! ( TyKind ,  56 ) ; 
30573072    // tidy-alphabetical-end 
30583073} 
0 commit comments