diff options
| author | b-naber <bn263@gmx.de> | 2022-09-22 12:34:23 +0200 |
|---|---|---|
| committer | b-naber <bn263@gmx.de> | 2022-09-23 14:27:34 +0200 |
| commit | a705e65605868adb0879734a984b445d3c40fd6f (patch) | |
| tree | efcbcf22d56aca46f73d412079f2f9bfa3fe7f8b /compiler/rustc_const_eval/src | |
| parent | efb908991b2c2cd43c40c8e62f563fdd17d84204 (diff) | |
| download | rust-a705e65605868adb0879734a984b445d3c40fd6f.tar.gz rust-a705e65605868adb0879734a984b445d3c40fd6f.zip | |
rename Unevaluated to UnevaluatedConst
Diffstat (limited to 'compiler/rustc_const_eval/src')
| -rw-r--r-- | compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs | 3 | ||||
| -rw-r--r-- | compiler/rustc_const_eval/src/transform/promote_consts.rs | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs b/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs index b1d140726d1..60deb0abd34 100644 --- a/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs +++ b/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs @@ -357,7 +357,7 @@ where ConstantKind::Val(..) => None, }; - if let Some(mir::Unevaluated { def, substs: _, promoted }) = uneval { + if let Some(mir::UnevaluatedConst { def, substs: _, promoted }) = uneval { // Use qualifs of the type for the promoted. Promoteds in MIR body should be possible // only for `NeedsNonConstDrop` with precise drop checking. This is the only const // check performed after the promotion. Verify that with an assertion. @@ -365,6 +365,7 @@ where // Don't peek inside trait associated constants. if promoted.is_none() && cx.tcx.trait_of_item(def.did).is_none() { + assert_eq!(def.const_param_did, None, "expected associated const: {def:?}"); let qualifs = cx.tcx.at(constant.span).mir_const_qualif(def.did); if !Q::in_qualifs(&qualifs) { diff --git a/compiler/rustc_const_eval/src/transform/promote_consts.rs b/compiler/rustc_const_eval/src/transform/promote_consts.rs index 733683bf7ba..4b219300739 100644 --- a/compiler/rustc_const_eval/src/transform/promote_consts.rs +++ b/compiler/rustc_const_eval/src/transform/promote_consts.rs @@ -841,7 +841,7 @@ impl<'a, 'tcx> Promoter<'a, 'tcx> { promoted.span = span; promoted.local_decls[RETURN_PLACE] = LocalDecl::new(ty, span); let substs = tcx.erase_regions(InternalSubsts::identity_for_item(tcx, def.did)); - let uneval = mir::Unevaluated { def, substs, promoted: Some(promoted_id) }; + let uneval = mir::UnevaluatedConst { def, substs, promoted: Some(promoted_id) }; Operand::Constant(Box::new(Constant { span, |
