@@ -2055,7 +2055,7 @@ pub enum ConstantKind<'tcx> {
2055
2055
Ty ( ty:: Const < ' tcx > ) ,
2056
2056
2057
2057
/// An unevaluated mir constant which is not part of the type system.
2058
- Unevaluated ( Unevaluated < ' tcx > , Ty < ' tcx > ) ,
2058
+ Unevaluated ( UnevaluatedConst < ' tcx > , Ty < ' tcx > ) ,
2059
2059
2060
2060
/// This constant cannot go back into the type system, as it represents
2061
2061
/// something the type system cannot handle (e.g. pointers).
@@ -2315,7 +2315,7 @@ impl<'tcx> ConstantKind<'tcx> {
2315
2315
ty:: InlineConstSubsts :: new ( tcx, ty:: InlineConstSubstsParts { parent_substs, ty } )
2316
2316
. substs ;
2317
2317
2318
- let uneval = Unevaluated {
2318
+ let uneval = UnevaluatedConst {
2319
2319
def : ty:: WithOptConstParam :: unknown ( def_id) . to_global ( ) ,
2320
2320
substs,
2321
2321
promoted : None ,
@@ -2403,7 +2403,7 @@ impl<'tcx> ConstantKind<'tcx> {
2403
2403
2404
2404
let hir_id = tcx. hir ( ) . local_def_id_to_hir_id ( def. did ) ;
2405
2405
let span = tcx. hir ( ) . span ( hir_id) ;
2406
- let uneval = Unevaluated :: new ( def. to_global ( ) , substs) ;
2406
+ let uneval = UnevaluatedConst :: new ( def. to_global ( ) , substs) ;
2407
2407
debug ! ( ?span, ?param_env) ;
2408
2408
2409
2409
match tcx. const_eval_resolve ( param_env, uneval, Some ( span) ) {
@@ -2416,7 +2416,7 @@ impl<'tcx> ConstantKind<'tcx> {
2416
2416
// Error was handled in `const_eval_resolve`. Here we just create a
2417
2417
// new unevaluated const and error hard later in codegen
2418
2418
Self :: Unevaluated (
2419
- Unevaluated {
2419
+ UnevaluatedConst {
2420
2420
def : def. to_global ( ) ,
2421
2421
substs : InternalSubsts :: identity_for_item ( tcx, def. did . to_def_id ( ) ) ,
2422
2422
promoted : None ,
@@ -2442,25 +2442,28 @@ impl<'tcx> ConstantKind<'tcx> {
2442
2442
/// An unevaluated (potentially generic) constant used in MIR.
2443
2443
#[ derive( Copy , Clone , Debug , Eq , PartialEq , PartialOrd , Ord , TyEncodable , TyDecodable , Lift ) ]
2444
2444
#[ derive( Hash , HashStable ) ]
2445
- pub struct Unevaluated < ' tcx > {
2445
+ pub struct UnevaluatedConst < ' tcx > {
2446
2446
pub def : ty:: WithOptConstParam < DefId > ,
2447
2447
pub substs : SubstsRef < ' tcx > ,
2448
2448
pub promoted : Option < Promoted > ,
2449
2449
}
2450
2450
2451
- impl < ' tcx > Unevaluated < ' tcx > {
2451
+ impl < ' tcx > UnevaluatedConst < ' tcx > {
2452
2452
// FIXME: probably should get rid of this method. It's also wrong to
2453
2453
// shrink and then later expand a promoted.
2454
2454
#[ inline]
2455
- pub fn shrink ( self ) -> ty:: Unevaluated < ' tcx > {
2456
- ty:: Unevaluated { def : self . def , substs : self . substs }
2455
+ pub fn shrink ( self ) -> ty:: UnevaluatedConst < ' tcx > {
2456
+ ty:: UnevaluatedConst { def : self . def , substs : self . substs }
2457
2457
}
2458
2458
}
2459
2459
2460
- impl < ' tcx > Unevaluated < ' tcx > {
2460
+ impl < ' tcx > UnevaluatedConst < ' tcx > {
2461
2461
#[ inline]
2462
- pub fn new ( def : ty:: WithOptConstParam < DefId > , substs : SubstsRef < ' tcx > ) -> Unevaluated < ' tcx > {
2463
- Unevaluated { def, substs, promoted : Default :: default ( ) }
2462
+ pub fn new (
2463
+ def : ty:: WithOptConstParam < DefId > ,
2464
+ substs : SubstsRef < ' tcx > ,
2465
+ ) -> UnevaluatedConst < ' tcx > {
2466
+ UnevaluatedConst { def, substs, promoted : Default :: default ( ) }
2464
2467
}
2465
2468
}
2466
2469
0 commit comments