@@ -1440,9 +1440,9 @@ pub enum Subscript {
14401440 /// Optional lower bound for the slice (inclusive).
14411441 lower_bound : Option < Expr > ,
14421442 /// Optional upper bound for the slice (inclusive).
1443- upper_bound : Option < Expr > ,
1443+ upper_bound : Option < Box < Expr > > ,
14441444 /// Optional stride for the slice (step size).
1445- stride : Option < Expr > ,
1445+ stride : Option < Box < Expr > > ,
14461446 } ,
14471447}
14481448
@@ -1474,14 +1474,17 @@ impl fmt::Display for Subscript {
14741474
14751475/// An element of a [`Expr::CompoundFieldAccess`].
14761476/// It can be an expression or a subscript.
1477+ // Dot(Expr) cannot be boxed: it is used in deeply-nested patterns such as
1478+ // `AccessExpr::Dot(Expr::Function(..))` and as a fn-pointer via `.map(AccessExpr::Dot)`.
1479+ #[ allow( clippy:: large_enum_variant) ]
14771480#[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
14781481#[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
14791482#[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
14801483pub enum AccessExpr {
14811484 /// Accesses a field using dot notation, e.g. `foo.bar.baz`.
14821485 Dot ( Expr ) ,
14831486 /// Accesses a field or array element using bracket notation, e.g. `foo['bar']`.
1484- Subscript ( Subscript ) ,
1487+ Subscript ( Box < Subscript > ) ,
14851488}
14861489
14871490impl fmt:: Display for AccessExpr {
@@ -2588,7 +2591,7 @@ impl fmt::Display for CommentObject {
25882591/// Password specification variants used in user-related statements.
25892592pub enum Password {
25902593 /// A concrete password expression.
2591- Password ( Expr ) ,
2594+ Password ( Box < Expr > ) ,
25922595 /// Represents a `NULL` password.
25932596 NullPassword ,
25942597}
@@ -6813,7 +6816,7 @@ pub enum MinMaxValue {
68136816 /// NO MINVALUE / NO MAXVALUE.
68146817 None ,
68156818 /// `MINVALUE <expr>` / `MAXVALUE <expr>`.
6816- Some ( Expr ) ,
6819+ Some ( Box < Expr > ) ,
68176820}
68186821
68196822#[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
@@ -6825,7 +6828,7 @@ pub enum OnInsert {
68256828 /// ON DUPLICATE KEY UPDATE (MySQL when the key already exists, then execute an update instead)
68266829 DuplicateKeyUpdate ( Vec < Assignment > ) ,
68276830 /// ON CONFLICT is a PostgreSQL and Sqlite extension
6828- OnConflict ( OnConflict ) ,
6831+ OnConflict ( Box < OnConflict > ) ,
68296832}
68306833
68316834#[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
@@ -6878,7 +6881,7 @@ pub enum OnConflictAction {
68786881 /// Do nothing on conflict.
68796882 DoNothing ,
68806883 /// Perform an update on conflict.
6881- DoUpdate ( DoUpdate ) ,
6884+ DoUpdate ( Box < DoUpdate > ) ,
68826885}
68836886
68846887#[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
@@ -9343,7 +9346,7 @@ pub enum ShowStatementFilter {
93439346 /// Filter using ILIKE pattern.
93449347 ILike ( String ) ,
93459348 /// Filter using a WHERE expression.
9346- Where ( Expr ) ,
9349+ Where ( Box < Expr > ) ,
93479350 /// Filter provided without a keyword (raw string).
93489351 NoKeyword ( String ) ,
93499352}
@@ -10333,7 +10336,7 @@ pub enum CreateFunctionBody {
1033310336 /// AS 'MODULE_PATHNAME', 'cas_in_wrapper'
1033410337 /// ```
1033510338 /// [PostgreSQL]: https://www.postgresql.org/docs/current/sql-createfunction.html
10336- link_symbol : Option < Expr > ,
10339+ link_symbol : Option < Box < Expr > > ,
1033710340 } ,
1033810341 /// A function body expression using the 'AS' keyword and shows up
1033910342 /// after any `OPTIONS` clause.
@@ -10397,7 +10400,7 @@ pub enum CreateFunctionBody {
1039710400 /// ```
1039810401 ///
1039910402 /// [MsSql]: https://learn.microsoft.com/en-us/sql/t-sql/statements/create-function-transact-sql?view=sql-server-ver16#select_stmt
10400- AsReturnSelect ( Select ) ,
10403+ AsReturnSelect ( Box < Select > ) ,
1040110404}
1040210405
1040310406#[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
@@ -10464,7 +10467,7 @@ impl fmt::Display for MacroArg {
1046410467/// Definition for a DuckDB macro: either an expression or a table-producing query.
1046510468pub enum MacroDefinition {
1046610469 /// The macro is defined as an expression.
10467- Expr ( Expr ) ,
10470+ Expr ( Box < Expr > ) ,
1046810471 /// The macro is defined as a table (query).
1046910472 Table ( Box < Query > ) ,
1047010473}
@@ -11206,7 +11209,7 @@ pub enum TableObject {
1120611209 /// INSERT INTO TABLE FUNCTION remote('localhost', default.simple_table)
1120711210 /// ```
1120811211 /// [Clickhouse](https://clickhouse.com/docs/en/sql-reference/table-functions)
11209- TableFunction ( Function ) ,
11212+ TableFunction ( Box < Function > ) ,
1121011213
1121111214 /// Table specified through a sub-query
1121211215 /// Example:
0 commit comments