@@ -508,13 +508,11 @@ impl Qualif for IsNotConst {
508
508
}
509
509
}
510
510
511
- // Refers to temporaries which cannot be promoted as
512
- // promote_consts decided they weren't simple enough.
513
- // FIXME(oli-obk,eddyb): Remove this flag entirely and
514
- // solely process this information via `IsNotConst`.
515
- struct IsNotPromotable ;
511
+ /// Refers to temporaries which cannot be promoted *implicitly*.
512
+ /// Explicit promotion e.g. for constant arguments declared via `rustc_args_required_const`.
513
+ struct IsNotImplicitlyPromotable ;
516
514
517
- impl Qualif for IsNotPromotable {
515
+ impl Qualif for IsNotImplicitlyPromotable {
518
516
const IDX : usize = 3 ;
519
517
520
518
fn in_call (
@@ -550,15 +548,15 @@ macro_rules! static_assert_seq_qualifs {
550
548
static_assert!( SEQ_QUALIFS : QUALIF_COUNT == $i) ;
551
549
} ;
552
550
}
553
- static_assert_seq_qualifs ! ( 0 => HasMutInterior , NeedsDrop , IsNotConst , IsNotPromotable ) ;
551
+ static_assert_seq_qualifs ! ( 0 => HasMutInterior , NeedsDrop , IsNotConst , IsNotImplicitlyPromotable ) ;
554
552
555
553
impl ConstCx < ' _ , ' tcx > {
556
554
fn qualifs_in_any_value_of_ty ( & self , ty : Ty < ' tcx > ) -> PerQualif < bool > {
557
555
let mut qualifs = PerQualif :: default ( ) ;
558
556
qualifs[ HasMutInterior ] = HasMutInterior :: in_any_value_of_ty ( self , ty) . unwrap_or ( false ) ;
559
557
qualifs[ NeedsDrop ] = NeedsDrop :: in_any_value_of_ty ( self , ty) . unwrap_or ( false ) ;
560
558
qualifs[ IsNotConst ] = IsNotConst :: in_any_value_of_ty ( self , ty) . unwrap_or ( false ) ;
561
- qualifs[ IsNotPromotable ] = IsNotPromotable :: in_any_value_of_ty ( self , ty) . unwrap_or ( false ) ;
559
+ qualifs[ IsNotImplicitlyPromotable ] = IsNotImplicitlyPromotable :: in_any_value_of_ty ( self , ty) . unwrap_or ( false ) ;
562
560
qualifs
563
561
}
564
562
@@ -567,7 +565,7 @@ impl ConstCx<'_, 'tcx> {
567
565
qualifs[ HasMutInterior ] = HasMutInterior :: in_local ( self , local) ;
568
566
qualifs[ NeedsDrop ] = NeedsDrop :: in_local ( self , local) ;
569
567
qualifs[ IsNotConst ] = IsNotConst :: in_local ( self , local) ;
570
- qualifs[ IsNotPromotable ] = IsNotPromotable :: in_local ( self , local) ;
568
+ qualifs[ IsNotImplicitlyPromotable ] = IsNotImplicitlyPromotable :: in_local ( self , local) ;
571
569
qualifs
572
570
}
573
571
@@ -576,7 +574,7 @@ impl ConstCx<'_, 'tcx> {
576
574
qualifs[ HasMutInterior ] = HasMutInterior :: in_value ( self , source) ;
577
575
qualifs[ NeedsDrop ] = NeedsDrop :: in_value ( self , source) ;
578
576
qualifs[ IsNotConst ] = IsNotConst :: in_value ( self , source) ;
579
- qualifs[ IsNotPromotable ] = IsNotPromotable :: in_value ( self , source) ;
577
+ qualifs[ IsNotImplicitlyPromotable ] = IsNotImplicitlyPromotable :: in_value ( self , source) ;
580
578
qualifs
581
579
}
582
580
}
0 commit comments