@@ -1378,15 +1378,6 @@ pub enum UnsafeSource {
13781378 UserProvided ,
13791379}
13801380
1381- /// Track whether under `feature(min_generic_const_args)` this anon const
1382- /// was explicitly disambiguated as an anon const or not through the use of
1383- /// `const { ... }` syntax.
1384- #[ derive( Clone , PartialEq , Encodable , Decodable , Debug , Copy , Walkable ) ]
1385- pub enum MgcaDisambiguation {
1386- AnonConst ,
1387- Direct ,
1388- }
1389-
13901381/// A constant (expression) that's not an item or associated item,
13911382/// but needs its own `DefId` for type-checking, const-eval, etc.
13921383/// These are usually found nested inside types (e.g., array lengths)
@@ -1396,7 +1387,6 @@ pub enum MgcaDisambiguation {
13961387pub struct AnonConst {
13971388 pub id : NodeId ,
13981389 pub value : Box < Expr > ,
1399- pub mgca_disambiguation : MgcaDisambiguation ,
14001390}
14011391
14021392/// An expression.
@@ -1627,6 +1617,7 @@ impl Expr {
16271617 | ExprKind :: UnsafeBinderCast ( ..)
16281618 | ExprKind :: While ( ..)
16291619 | ExprKind :: Yield ( YieldKind :: Postfix ( ..) )
1620+ | ExprKind :: DirectConstArg ( ..)
16301621 | ExprKind :: Err ( _)
16311622 | ExprKind :: Dummy => prefix_attrs_precedence ( & self . attrs ) ,
16321623 }
@@ -1920,6 +1911,9 @@ pub enum ExprKind {
19201911
19211912 UnsafeBinderCast ( UnsafeBinderCastKind , Box < Expr > , Option < Box < Ty > > ) ,
19221913
1914+ /// An mGCA `direct_const_arg!()` expression.
1915+ DirectConstArg ( Box < Expr > ) ,
1916+
19231917 /// Placeholder for an expression that wasn't syntactically well formed in some way.
19241918 Err ( ErrorGuaranteed ) ,
19251919
@@ -2566,6 +2560,8 @@ pub enum TyKind {
25662560 FieldOf ( Box < Ty > , Option < Ident > , Ident ) ,
25672561 /// A view of a type. `T.{ field_1, field_2 }`.
25682562 View ( Box < Ty > , #[ visitable( ignore) ] ThinVec < Ident > ) ,
2563+ /// An mGCA `direct_const_arg!()` expression.
2564+ DirectConstArg ( Box < Expr > ) ,
25692565 /// Sometimes we need a dummy value when no error has occurred.
25702566 Dummy ,
25712567 /// Placeholder for a kind that has failed to be defined.
@@ -3066,6 +3062,9 @@ impl FnDecl {
30663062 /// Must have the same value as `FnSigKind::NO_SPLATTED_ARG_INDEX` and `FnDeclFlags::NO_SPLATTED_ARG_INDEX`.
30673063 pub const NO_SPLATTED_ARG_INDEX : u8 = u8:: MAX ;
30683064
3065+ /// The maximum valid splatted argument index.
3066+ pub const MAX_VALID_SPLATTED_ARG_INDEX : u8 = Self :: NO_SPLATTED_ARG_INDEX - 1 ;
3067+
30693068 /// Returns a splatted argument index, if any are present.
30703069 pub fn splatted ( & self ) -> Option < u8 > {
30713070 self . inputs . iter ( ) . enumerate ( ) . find_map ( |( index, arg) | {
0 commit comments