about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBastian Kauschke <bastian_kauschke@hotmail.de>2020-07-15 10:50:54 +0200
committerBastian Kauschke <bastian_kauschke@hotmail.de>2020-07-15 13:06:47 +0200
commita909eb6b653080683b49b2be5e6621ca08cecf01 (patch)
tree2effc1f6c9bfc48bbd3c664742768306cce76803
parent805c44d5d32d23e18d962f14e34869ddcef588fd (diff)
downloadrust-a909eb6b653080683b49b2be5e6621ca08cecf01.tar.gz
rust-a909eb6b653080683b49b2be5e6621ca08cecf01.zip
improve naming
-rw-r--r--src/librustc_infer/infer/mod.rs2
-rw-r--r--src/librustc_interface/passes.rs2
-rw-r--r--src/librustc_middle/mir/interpret/queries.rs2
-rw-r--r--src/librustc_middle/mir/query.rs13
-rw-r--r--src/librustc_middle/query/mod.rs14
-rw-r--r--src/librustc_middle/ty/context.rs4
-rw-r--r--src/librustc_middle/ty/instance.rs10
-rw-r--r--src/librustc_middle/ty/mod.rs36
-rw-r--r--src/librustc_middle/ty/query/keys.rs2
-rw-r--r--src/librustc_middle/ty/sty.rs8
-rw-r--r--src/librustc_mir/borrow_check/mod.rs10
-rw-r--r--src/librustc_mir/borrow_check/nll.rs2
-rw-r--r--src/librustc_mir/borrow_check/universal_regions.rs4
-rw-r--r--src/librustc_mir/transform/check_unsafety.rs11
-rw-r--r--src/librustc_mir/transform/mod.rs70
-rw-r--r--src/librustc_mir/transform/promote_consts.rs4
-rw-r--r--src/librustc_mir/util/pretty.rs2
-rw-r--r--src/librustc_mir_build/build/mod.rs10
-rw-r--r--src/librustc_mir_build/hair/cx/expr.rs8
-rw-r--r--src/librustc_mir_build/hair/cx/mod.rs2
-rw-r--r--src/librustc_ty/instance.rs16
-rw-r--r--src/librustc_typeck/astconv.rs6
-rw-r--r--src/librustc_typeck/check/mod.rs6
-rw-r--r--src/librustc_typeck/check/wfcheck.rs2
-rw-r--r--src/test/mir-opt/const-promotion-extern-static/rustc.BAR.PromoteTemps.diff4
-rw-r--r--src/test/mir-opt/const-promotion-extern-static/rustc.FOO.PromoteTemps.diff4
-rw-r--r--src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices/32bit/rustc.main.ConstProp.diff4
-rw-r--r--src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices/64bit/rustc.main.ConstProp.diff4
-rw-r--r--src/test/mir-opt/const_prop/const_prop_fails_gracefully/rustc.main.ConstProp.diff4
-rw-r--r--src/test/mir-opt/const_prop/control-flow-simplification/rustc.hello.ConstProp.diff4
-rw-r--r--src/test/mir-opt/const_prop/ref_deref/rustc.main.ConstProp.diff4
-rw-r--r--src/test/mir-opt/const_prop/ref_deref/rustc.main.PromoteTemps.diff4
-rw-r--r--src/test/mir-opt/const_prop/ref_deref_project/rustc.main.ConstProp.diff4
-rw-r--r--src/test/mir-opt/const_prop/ref_deref_project/rustc.main.PromoteTemps.diff4
-rw-r--r--src/test/mir-opt/const_prop/slice_len/32bit/rustc.main.ConstProp.diff4
-rw-r--r--src/test/mir-opt/const_prop/slice_len/64bit/rustc.main.ConstProp.diff4
-rw-r--r--src/test/mir-opt/inline/inline-retag/rustc.bar.Inline.after.mir8
-rw-r--r--src/test/mir-opt/issue-73223/32bit/rustc.main.PreCodegen.diff8
-rw-r--r--src/test/mir-opt/issue-73223/32bit/rustc.main.SimplifyArmIdentity.diff8
-rw-r--r--src/test/mir-opt/issue-73223/64bit/rustc.main.PreCodegen.diff8
-rw-r--r--src/test/mir-opt/issue-73223/64bit/rustc.main.SimplifyArmIdentity.diff8
-rw-r--r--src/test/mir-opt/match_false_edges/rustc.full_tested_match.PromoteTemps.after.mir4
-rw-r--r--src/test/mir-opt/retag/rustc.main.SimplifyCfg-elaborate-drops.after.mir4
-rw-r--r--src/tools/clippy/clippy_lints/src/consts.rs2
44 files changed, 184 insertions, 160 deletions
diff --git a/src/librustc_infer/infer/mod.rs b/src/librustc_infer/infer/mod.rs
index 85c568cbd65..00503a69928 100644
--- a/src/librustc_infer/infer/mod.rs
+++ b/src/librustc_infer/infer/mod.rs
@@ -1536,7 +1536,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
     pub fn const_eval_resolve(
         &self,
         param_env: ty::ParamEnv<'tcx>,
-        def: ty::WithOptParam<DefId>,
+        def: ty::WithOptConstParam<DefId>,
         substs: SubstsRef<'tcx>,
         promoted: Option<mir::Promoted>,
         span: Option<Span>,
diff --git a/src/librustc_interface/passes.rs b/src/librustc_interface/passes.rs
index 5152e62f072..4357f11776c 100644
--- a/src/librustc_interface/passes.rs
+++ b/src/librustc_interface/passes.rs
@@ -892,7 +892,7 @@ fn analysis(tcx: TyCtxt<'_>, cnum: CrateNum) -> Result<()> {
 
             if tcx.hir().body_const_context(def_id).is_some() {
                 tcx.ensure()
-                    .mir_drops_elaborated_and_const_checked(ty::WithOptParam::dummy(def_id));
+                    .mir_drops_elaborated_and_const_checked(ty::WithOptConstParam::dummy(def_id));
             }
         }
     });
diff --git a/src/librustc_middle/mir/interpret/queries.rs b/src/librustc_middle/mir/interpret/queries.rs
index bbaead535f6..0a9c2ac9475 100644
--- a/src/librustc_middle/mir/interpret/queries.rs
+++ b/src/librustc_middle/mir/interpret/queries.rs
@@ -34,7 +34,7 @@ impl<'tcx> TyCtxt<'tcx> {
     pub fn const_eval_resolve(
         self,
         param_env: ty::ParamEnv<'tcx>,
-        def: ty::WithOptParam<DefId>,
+        def: ty::WithOptConstParam<DefId>,
         substs: SubstsRef<'tcx>,
         promoted: Option<mir::Promoted>,
         span: Option<Span>,
diff --git a/src/librustc_middle/mir/query.rs b/src/librustc_middle/mir/query.rs
index 884067347a6..560a8421c17 100644
--- a/src/librustc_middle/mir/query.rs
+++ b/src/librustc_middle/mir/query.rs
@@ -328,17 +328,20 @@ pub struct CoverageInfo {
 impl<'tcx> TyCtxt<'tcx> {
     pub fn mir_borrowck_opt_const_arg(
         self,
-        def: ty::WithOptParam<LocalDefId>,
+        def: ty::WithOptConstParam<LocalDefId>,
     ) -> &'tcx BorrowCheckResult<'tcx> {
-        if let Some(param_did) = def.param_did {
+        if let Some(param_did) = def.const_param_did {
             self.mir_borrowck_const_arg((def.did, param_did))
         } else {
             self.mir_borrowck(def.did)
         }
     }
 
-    pub fn mir_const_qualif_opt_const_arg(self, def: ty::WithOptParam<LocalDefId>) -> ConstQualifs {
-        if let Some(param_did) = def.param_did {
+    pub fn mir_const_qualif_opt_const_arg(
+        self,
+        def: ty::WithOptConstParam<LocalDefId>,
+    ) -> ConstQualifs {
+        if let Some(param_did) = def.const_param_did {
             self.mir_const_qualif_const_arg((def.did, param_did))
         } else {
             self.mir_const_qualif(def.did)
@@ -347,7 +350,7 @@ impl<'tcx> TyCtxt<'tcx> {
 
     pub fn promoted_mir_of_opt_const_arg(
         self,
-        def: ty::WithOptParam<DefId>,
+        def: ty::WithOptConstParam<DefId>,
     ) -> &'tcx IndexVec<Promoted, Body<'tcx>> {
         if let Some((did, param_did)) = def.as_const_arg() {
             self.promoted_mir_of_const_arg((did, param_did))
diff --git a/src/librustc_middle/query/mod.rs b/src/librustc_middle/query/mod.rs
index fbd4f4b7f54..edeefab4342 100644
--- a/src/librustc_middle/query/mod.rs
+++ b/src/librustc_middle/query/mod.rs
@@ -105,7 +105,7 @@ rustc_queries! {
         /// ```
         query opt_const_param_of(key: LocalDefId) -> Option<DefId> {
             desc { |tcx| "computing the optional const parameter of `{}`", tcx.def_path_str(key.to_def_id()) }
-            // FIXME: consider storing this query on disk.
+            // FIXME(#74113): consider storing this query on disk.
         }
 
         /// Records the type of every item.
@@ -219,7 +219,7 @@ rustc_queries! {
 
         /// Fetch the MIR for a given `DefId` right after it's built - this includes
         /// unreachable code.
-        query mir_built(key: ty::WithOptParam<LocalDefId>) -> &'tcx Steal<mir::Body<'tcx>> {
+        query mir_built(key: ty::WithOptConstParam<LocalDefId>) -> &'tcx Steal<mir::Body<'tcx>> {
             desc { |tcx| "building MIR for `{}`", tcx.def_path_str(key.did.to_def_id()) }
         }
 
@@ -227,23 +227,23 @@ rustc_queries! {
         /// ready for const qualification.
         ///
         /// See the README for the `mir` module for details.
-        query mir_const(key: ty::WithOptParam<LocalDefId>) -> &'tcx Steal<mir::Body<'tcx>> {
+        query mir_const(key: ty::WithOptConstParam<LocalDefId>) -> &'tcx Steal<mir::Body<'tcx>> {
             desc {
                 |tcx| "processing MIR for {}`{}`",
-                if key.param_did.is_some() { "the const argument " } else { "" },
+                if key.const_param_did.is_some() { "the const argument " } else { "" },
                 tcx.def_path_str(key.did.to_def_id()),
             }
             no_hash
         }
 
         query mir_drops_elaborated_and_const_checked(
-            key: ty::WithOptParam<LocalDefId>
+            key: ty::WithOptConstParam<LocalDefId>
         ) -> &'tcx Steal<mir::Body<'tcx>> {
             no_hash
             desc { |tcx| "elaborating drops for `{}`", tcx.def_path_str(key.did.to_def_id()) }
         }
 
-        query mir_validated(key: ty::WithOptParam<LocalDefId>) ->
+        query mir_validated(key: ty::WithOptConstParam<LocalDefId>) ->
             (
                 &'tcx Steal<mir::Body<'tcx>>,
                 &'tcx Steal<IndexVec<mir::Promoted, mir::Body<'tcx>>>
@@ -251,7 +251,7 @@ rustc_queries! {
             no_hash
             desc {
                 |tcx| "processing {}`{}`",
-                if key.param_did.is_some() { "the const argument " } else { "" },
+                if key.const_param_did.is_some() { "the const argument " } else { "" },
                 tcx.def_path_str(key.did.to_def_id()),
             }
         }
diff --git a/src/librustc_middle/ty/context.rs b/src/librustc_middle/ty/context.rs
index fd7be0dbc0b..bb5dd53a7e6 100644
--- a/src/librustc_middle/ty/context.rs
+++ b/src/librustc_middle/ty/context.rs
@@ -982,9 +982,9 @@ pub struct GlobalCtxt<'tcx> {
 impl<'tcx> TyCtxt<'tcx> {
     pub fn typeck_tables_of_opt_const_arg(
         self,
-        def: ty::WithOptParam<LocalDefId>,
+        def: ty::WithOptConstParam<LocalDefId>,
     ) -> &'tcx TypeckTables<'tcx> {
-        if let Some(param_did) = def.param_did {
+        if let Some(param_did) = def.const_param_did {
             self.typeck_tables_of_const_arg((def.did, param_did))
         } else {
             self.typeck_tables_of(def.did)
diff --git a/src/librustc_middle/ty/instance.rs b/src/librustc_middle/ty/instance.rs
index a00afab9599..114ce491f27 100644
--- a/src/librustc_middle/ty/instance.rs
+++ b/src/librustc_middle/ty/instance.rs
@@ -29,7 +29,7 @@ pub enum InstanceDef<'tcx> {
     /// - `fn` items
     /// - closures
     /// - generators
-    Item(ty::WithOptParam<DefId>),
+    Item(ty::WithOptConstParam<DefId>),
 
     /// An intrinsic `fn` item (with `"rust-intrinsic"` or `"platform-intrinsic"` ABI).
     ///
@@ -186,7 +186,7 @@ impl<'tcx> InstanceDef<'tcx> {
     }
 
     #[inline]
-    pub fn with_opt_param(self) -> ty::WithOptParam<DefId> {
+    pub fn with_opt_param(self) -> ty::WithOptConstParam<DefId> {
         match self {
             InstanceDef::Item(def) => def,
             InstanceDef::VtableShim(def_id)
@@ -196,7 +196,7 @@ impl<'tcx> InstanceDef<'tcx> {
             | InstanceDef::Intrinsic(def_id)
             | InstanceDef::ClosureOnceShim { call_once: def_id }
             | InstanceDef::DropGlue(def_id, _)
-            | InstanceDef::CloneShim(def_id, _) => ty::WithOptParam::dummy(def_id),
+            | InstanceDef::CloneShim(def_id, _) => ty::WithOptConstParam::dummy(def_id),
         }
     }
 
@@ -298,7 +298,7 @@ impl<'tcx> Instance<'tcx> {
             def_id,
             substs
         );
-        Instance { def: InstanceDef::Item(ty::WithOptParam::dummy(def_id)), substs }
+        Instance { def: InstanceDef::Item(ty::WithOptConstParam::dummy(def_id)), substs }
     }
 
     pub fn mono(tcx: TyCtxt<'tcx>, def_id: DefId) -> Instance<'tcx> {
@@ -355,7 +355,7 @@ impl<'tcx> Instance<'tcx> {
     pub fn resolve_const_arg(
         tcx: TyCtxt<'tcx>,
         param_env: ty::ParamEnv<'tcx>,
-        def: ty::WithOptParam<DefId>,
+        def: ty::WithOptConstParam<DefId>,
         substs: SubstsRef<'tcx>,
     ) -> Result<Option<Instance<'tcx>>, ErrorReported> {
         let substs = tcx.erase_regions(&substs);
diff --git a/src/librustc_middle/ty/mod.rs b/src/librustc_middle/ty/mod.rs
index 5e2cce42d93..35b3ad66f01 100644
--- a/src/librustc_middle/ty/mod.rs
+++ b/src/librustc_middle/ty/mod.rs
@@ -1099,7 +1099,7 @@ pub enum PredicateKind<'tcx> {
     Subtype(PolySubtypePredicate<'tcx>),
 
     /// Constant initializer must evaluate successfully.
-    ConstEvaluatable(ty::WithOptParam<DefId>, SubstsRef<'tcx>),
+    ConstEvaluatable(ty::WithOptConstParam<DefId>, SubstsRef<'tcx>),
 
     /// Constants must be equal. The first component is the const that is expected.
     ConstEquate(&'tcx Const<'tcx>, &'tcx Const<'tcx>),
@@ -1601,40 +1601,42 @@ pub type PlaceholderConst = Placeholder<BoundVar>;
 #[derive(Copy, Clone, Debug, TypeFoldable, Lift, RustcEncodable, RustcDecodable)]
 #[derive(PartialEq, Eq, PartialOrd, Ord)]
 #[derive(Hash, HashStable)]
-pub struct WithOptParam<T> {
+pub struct WithOptConstParam<T> {
     pub did: T,
     /// The `DefId` of the corresponding generic paramter in case `did` is
     /// a const argument.
     ///
     /// Note that even if `did` is a const argument, this may still be `None`.
-    /// All queries taking `WithOptParam` start by calling `tcx.opt_const_param_of(def.did)`
+    /// All queries taking `WithOptConstParam` start by calling `tcx.opt_const_param_of(def.did)`
     /// to potentially update `param_did` in case it `None`.
-    pub param_did: Option<DefId>,
+    pub const_param_did: Option<DefId>,
 }
 
-impl<T> WithOptParam<T> {
-    pub fn dummy(did: T) -> WithOptParam<T> {
-        WithOptParam { did, param_did: None }
+impl<T> WithOptConstParam<T> {
+    pub fn dummy(did: T) -> WithOptConstParam<T> {
+        WithOptConstParam { did, const_param_did: None }
     }
 }
 
-impl WithOptParam<LocalDefId> {
-    pub fn to_global(self) -> WithOptParam<DefId> {
-        WithOptParam { did: self.did.to_def_id(), param_did: self.param_did }
+impl WithOptConstParam<LocalDefId> {
+    pub fn to_global(self) -> WithOptConstParam<DefId> {
+        WithOptConstParam { did: self.did.to_def_id(), const_param_did: self.const_param_did }
     }
 
     pub fn ty_def_id(self) -> DefId {
-        if let Some(did) = self.param_did { did } else { self.did.to_def_id() }
+        if let Some(did) = self.const_param_did { did } else { self.did.to_def_id() }
     }
 }
 
-impl WithOptParam<DefId> {
-    pub fn as_local(self) -> Option<WithOptParam<LocalDefId>> {
-        self.did.as_local().map(|did| WithOptParam { did, param_did: self.param_did })
+impl WithOptConstParam<DefId> {
+    pub fn as_local(self) -> Option<WithOptConstParam<LocalDefId>> {
+        self.did
+            .as_local()
+            .map(|did| WithOptConstParam { did, const_param_did: self.const_param_did })
     }
 
     pub fn as_const_arg(self) -> Option<(LocalDefId, DefId)> {
-        if let Some(param_did) = self.param_did {
+        if let Some(param_did) = self.const_param_did {
             if let Some(did) = self.did.as_local() {
                 return Some((did, param_did));
             }
@@ -1643,7 +1645,7 @@ impl WithOptParam<DefId> {
         None
     }
 
-    pub fn expect_local(self) -> WithOptParam<LocalDefId> {
+    pub fn expect_local(self) -> WithOptConstParam<LocalDefId> {
         self.as_local().unwrap()
     }
 
@@ -1652,7 +1654,7 @@ impl WithOptParam<DefId> {
     }
 
     pub fn ty_def_id(self) -> DefId {
-        self.param_did.unwrap_or(self.did)
+        self.const_param_did.unwrap_or(self.did)
     }
 }
 
diff --git a/src/librustc_middle/ty/query/keys.rs b/src/librustc_middle/ty/query/keys.rs
index 557f64d3c19..cb2b7a662cb 100644
--- a/src/librustc_middle/ty/query/keys.rs
+++ b/src/librustc_middle/ty/query/keys.rs
@@ -105,7 +105,7 @@ impl Key for DefId {
     }
 }
 
-impl Key for ty::WithOptParam<LocalDefId> {
+impl Key for ty::WithOptConstParam<LocalDefId> {
     type CacheSelector = DefaultCacheSelector;
 
     fn query_crate(&self) -> CrateNum {
diff --git a/src/librustc_middle/ty/sty.rs b/src/librustc_middle/ty/sty.rs
index 3d16a9f92c9..c968e2fbde8 100644
--- a/src/librustc_middle/ty/sty.rs
+++ b/src/librustc_middle/ty/sty.rs
@@ -2210,12 +2210,12 @@ impl<'tcx> Const<'tcx> {
     /// Literals and const generic parameters are eagerly converted to a constant, everything else
     /// becomes `Unevaluated`.
     pub fn from_anon_const(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> &'tcx Self {
-        Self::const_arg_from_anon_const(tcx, ty::WithOptParam::dummy(def_id))
+        Self::from_opt_const_arg_anon_const(tcx, ty::WithOptConstParam::dummy(def_id))
     }
 
-    pub fn const_arg_from_anon_const(
+    pub fn from_opt_const_arg_anon_const(
         tcx: TyCtxt<'tcx>,
-        def: ty::WithOptParam<LocalDefId>,
+        def: ty::WithOptConstParam<LocalDefId>,
     ) -> &'tcx Self {
         debug!("Const::from_anon_const(def={:?})", def);
 
@@ -2433,7 +2433,7 @@ pub enum ConstKind<'tcx> {
 
     /// Used in the HIR by using `Unevaluated` everywhere and later normalizing to one of the other
     /// variants when the code is monomorphic enough for that.
-    Unevaluated(ty::WithOptParam<DefId>, SubstsRef<'tcx>, Option<Promoted>),
+    Unevaluated(ty::WithOptConstParam<DefId>, SubstsRef<'tcx>, Option<Promoted>),
 
     /// Used to hold computed value.
     Value(ConstValue<'tcx>),
diff --git a/src/librustc_mir/borrow_check/mod.rs b/src/librustc_mir/borrow_check/mod.rs
index 0ca165ee847..348c50720be 100644
--- a/src/librustc_mir/borrow_check/mod.rs
+++ b/src/librustc_mir/borrow_check/mod.rs
@@ -88,9 +88,9 @@ const DEREF_PROJECTION: &[PlaceElem<'_>; 1] = &[ProjectionElem::Deref];
 
 pub fn provide(providers: &mut Providers) {
     *providers = Providers {
-        mir_borrowck: |tcx, did| mir_borrowck(tcx, ty::WithOptParam::dummy(did)),
+        mir_borrowck: |tcx, did| mir_borrowck(tcx, ty::WithOptConstParam::dummy(did)),
         mir_borrowck_const_arg: |tcx, (did, param_did)| {
-            mir_borrowck(tcx, ty::WithOptParam { did, param_did: Some(param_did) })
+            mir_borrowck(tcx, ty::WithOptConstParam { did, const_param_did: Some(param_did) })
         },
         ..*providers
     };
@@ -98,9 +98,9 @@ pub fn provide(providers: &mut Providers) {
 
 fn mir_borrowck<'tcx>(
     tcx: TyCtxt<'tcx>,
-    def: ty::WithOptParam<LocalDefId>,
+    def: ty::WithOptConstParam<LocalDefId>,
 ) -> &'tcx BorrowCheckResult<'tcx> {
-    if def.param_did.is_none() {
+    if def.const_param_did.is_none() {
         if let Some(param_did) = tcx.opt_const_param_of(def.did) {
             return tcx.mir_borrowck_const_arg((def.did, param_did));
         }
@@ -123,7 +123,7 @@ fn do_mir_borrowck<'a, 'tcx>(
     infcx: &InferCtxt<'a, 'tcx>,
     input_body: &Body<'tcx>,
     input_promoted: &IndexVec<Promoted, Body<'tcx>>,
-    def: ty::WithOptParam<LocalDefId>,
+    def: ty::WithOptConstParam<LocalDefId>,
 ) -> BorrowCheckResult<'tcx> {
     debug!("do_mir_borrowck(def = {:?})", def);
 
diff --git a/src/librustc_mir/borrow_check/nll.rs b/src/librustc_mir/borrow_check/nll.rs
index f1e7f4c26f4..f6b3be59d95 100644
--- a/src/librustc_mir/borrow_check/nll.rs
+++ b/src/librustc_mir/borrow_check/nll.rs
@@ -59,7 +59,7 @@ crate struct NllOutput<'tcx> {
 /// `compute_regions`.
 pub(in crate::borrow_check) fn replace_regions_in_mir<'cx, 'tcx>(
     infcx: &InferCtxt<'cx, 'tcx>,
-    def: ty::WithOptParam<LocalDefId>,
+    def: ty::WithOptConstParam<LocalDefId>,
     param_env: ty::ParamEnv<'tcx>,
     body: &mut Body<'tcx>,
     promoted: &mut IndexVec<Promoted, Body<'tcx>>,
diff --git a/src/librustc_mir/borrow_check/universal_regions.rs b/src/librustc_mir/borrow_check/universal_regions.rs
index 1e2d94a1df4..2faf7fa9022 100644
--- a/src/librustc_mir/borrow_check/universal_regions.rs
+++ b/src/librustc_mir/borrow_check/universal_regions.rs
@@ -227,7 +227,7 @@ impl<'tcx> UniversalRegions<'tcx> {
     /// known between those regions.
     pub fn new(
         infcx: &InferCtxt<'_, 'tcx>,
-        mir_def: ty::WithOptParam<LocalDefId>,
+        mir_def: ty::WithOptConstParam<LocalDefId>,
         param_env: ty::ParamEnv<'tcx>,
     ) -> Self {
         let tcx = infcx.tcx;
@@ -388,7 +388,7 @@ impl<'tcx> UniversalRegions<'tcx> {
 
 struct UniversalRegionsBuilder<'cx, 'tcx> {
     infcx: &'cx InferCtxt<'cx, 'tcx>,
-    mir_def: ty::WithOptParam<LocalDefId>,
+    mir_def: ty::WithOptConstParam<LocalDefId>,
     mir_hir_id: HirId,
     param_env: ty::ParamEnv<'tcx>,
 }
diff --git a/src/librustc_mir/transform/check_unsafety.rs b/src/librustc_mir/transform/check_unsafety.rs
index 5ee93dfc446..42ac4d126a1 100644
--- a/src/librustc_mir/transform/check_unsafety.rs
+++ b/src/librustc_mir/transform/check_unsafety.rs
@@ -491,10 +491,13 @@ impl<'a, 'tcx> UnsafetyChecker<'a, 'tcx> {
 pub(crate) fn provide(providers: &mut Providers) {
     *providers = Providers {
         unsafety_check_result: |tcx, def_id| {
-            unsafety_check_result(tcx, ty::WithOptParam::dummy(def_id))
+            unsafety_check_result(tcx, ty::WithOptConstParam::dummy(def_id))
         },
         unsafety_check_result_const_arg: |tcx, (did, param_did)| {
-            unsafety_check_result(tcx, ty::WithOptParam { did, param_did: Some(param_did) })
+            unsafety_check_result(
+                tcx,
+                ty::WithOptConstParam { did, const_param_did: Some(param_did) },
+            )
         },
         unsafe_derive_on_repr_packed,
         ..*providers
@@ -546,9 +549,9 @@ fn check_unused_unsafe(
 
 fn unsafety_check_result<'tcx>(
     tcx: TyCtxt<'tcx>,
-    def: ty::WithOptParam<LocalDefId>,
+    def: ty::WithOptConstParam<LocalDefId>,
 ) -> &'tcx UnsafetyCheckResult {
-    if def.param_did.is_none() {
+    if def.const_param_did.is_none() {
         if let Some(param_did) = tcx.opt_const_param_of(def.did) {
             return tcx.unsafety_check_result_const_arg((def.did, param_did));
         }
diff --git a/src/librustc_mir/transform/mod.rs b/src/librustc_mir/transform/mod.rs
index f2d6efae019..ce8e71d878b 100644
--- a/src/librustc_mir/transform/mod.rs
+++ b/src/librustc_mir/transform/mod.rs
@@ -49,10 +49,10 @@ pub(crate) fn provide(providers: &mut Providers) {
         mir_keys,
         mir_const,
         mir_const_qualif: |tcx, did| {
-            mir_const_qualif(tcx, ty::WithOptParam::dummy(did.expect_local()))
+            mir_const_qualif(tcx, ty::WithOptConstParam::dummy(did.expect_local()))
         },
         mir_const_qualif_const_arg: |tcx, (did, param_did)| {
-            mir_const_qualif(tcx, ty::WithOptParam { did, param_did: Some(param_did) })
+            mir_const_qualif(tcx, ty::WithOptConstParam { did, const_param_did: Some(param_did) })
         },
         mir_validated,
         mir_drops_elaborated_and_const_checked,
@@ -60,10 +60,10 @@ pub(crate) fn provide(providers: &mut Providers) {
         optimized_mir_of_const_arg,
         is_mir_available,
         promoted_mir: |tcx, def_id| {
-            promoted_mir(tcx, ty::WithOptParam::dummy(def_id.expect_local()))
+            promoted_mir(tcx, ty::WithOptConstParam::dummy(def_id.expect_local()))
         },
         promoted_mir_of_const_arg: |tcx, (did, param_did)| {
-            promoted_mir(tcx, ty::WithOptParam { did, param_did: Some(param_did) })
+            promoted_mir(tcx, ty::WithOptConstParam { did, const_param_did: Some(param_did) })
         },
         ..*providers
     };
@@ -127,10 +127,13 @@ pub struct MirSource<'tcx> {
 
 impl<'tcx> MirSource<'tcx> {
     pub fn item(def_id: DefId) -> Self {
-        MirSource { instance: InstanceDef::Item(ty::WithOptParam::dummy(def_id)), promoted: None }
+        MirSource {
+            instance: InstanceDef::Item(ty::WithOptConstParam::dummy(def_id)),
+            promoted: None,
+        }
     }
 
-    pub fn with_opt_param(self) -> ty::WithOptParam<DefId> {
+    pub fn with_opt_param(self) -> ty::WithOptConstParam<DefId> {
         self.instance.with_opt_param()
     }
 
@@ -217,8 +220,8 @@ pub fn run_passes(
     }
 }
 
-fn mir_const_qualif(tcx: TyCtxt<'_>, def: ty::WithOptParam<LocalDefId>) -> ConstQualifs {
-    if def.param_did.is_none() {
+fn mir_const_qualif(tcx: TyCtxt<'_>, def: ty::WithOptConstParam<LocalDefId>) -> ConstQualifs {
+    if def.const_param_did.is_none() {
         if let Some(param_did) = tcx.opt_const_param_of(def.did) {
             return tcx.mir_const_qualif_const_arg((def.did, param_did));
         }
@@ -261,16 +264,16 @@ fn mir_const_qualif(tcx: TyCtxt<'_>, def: ty::WithOptParam<LocalDefId>) -> Const
 /// Make MIR ready for const evaluation. This is run on all MIR, not just on consts!
 fn mir_const<'tcx>(
     tcx: TyCtxt<'tcx>,
-    def: ty::WithOptParam<LocalDefId>,
+    def: ty::WithOptConstParam<LocalDefId>,
 ) -> &'tcx Steal<Body<'tcx>> {
-    if def.param_did.is_none() {
-        if let param_did @ Some(_) = tcx.opt_const_param_of(def.did) {
-            return tcx.mir_const(ty::WithOptParam { param_did, ..def });
+    if def.const_param_did.is_none() {
+        if let const_param_did @ Some(_) = tcx.opt_const_param_of(def.did) {
+            return tcx.mir_const(ty::WithOptConstParam { const_param_did, ..def });
         }
     }
 
     // Unsafety check uses the raw mir, so make sure it is run.
-    if let Some(param_did) = def.param_did {
+    if let Some(param_did) = def.const_param_did {
         tcx.ensure().unsafety_check_result_const_arg((def.did, param_did));
     } else {
         tcx.ensure().unsafety_check_result(def.did);
@@ -307,11 +310,11 @@ fn mir_const<'tcx>(
 
 fn mir_validated(
     tcx: TyCtxt<'tcx>,
-    def: ty::WithOptParam<LocalDefId>,
+    def: ty::WithOptConstParam<LocalDefId>,
 ) -> (&'tcx Steal<Body<'tcx>>, &'tcx Steal<IndexVec<Promoted, Body<'tcx>>>) {
-    if def.param_did.is_none() {
-        if let param_did @ Some(_) = tcx.opt_const_param_of(def.did) {
-            return tcx.mir_validated(ty::WithOptParam { param_did, ..def });
+    if def.const_param_did.is_none() {
+        if let const_param_did @ Some(_) = tcx.opt_const_param_of(def.did) {
+            return tcx.mir_validated(ty::WithOptConstParam { const_param_did, ..def });
         }
     }
 
@@ -352,18 +355,20 @@ fn mir_validated(
 
 fn mir_drops_elaborated_and_const_checked<'tcx>(
     tcx: TyCtxt<'tcx>,
-    def: ty::WithOptParam<LocalDefId>,
+    def: ty::WithOptConstParam<LocalDefId>,
 ) -> &'tcx Steal<Body<'tcx>> {
-    if def.param_did.is_none() {
-        if let param_did @ Some(_) = tcx.opt_const_param_of(def.did) {
-            return tcx
-                .mir_drops_elaborated_and_const_checked(ty::WithOptParam { param_did, ..def });
+    if def.const_param_did.is_none() {
+        if let const_param_did @ Some(_) = tcx.opt_const_param_of(def.did) {
+            return tcx.mir_drops_elaborated_and_const_checked(ty::WithOptConstParam {
+                const_param_did,
+                ..def
+            });
         }
     }
 
     // (Mir-)Borrowck uses `mir_validated`, so we have to force it to
     // execute before we can steal.
-    if let Some(param_did) = def.param_did {
+    if let Some(param_did) = def.const_param_did {
         tcx.ensure().mir_borrowck_const_arg((def.did, param_did));
     } else {
         tcx.ensure().mir_borrowck(def.did);
@@ -409,7 +414,7 @@ fn run_post_borrowck_cleanup_passes<'tcx>(
     run_passes(
         tcx,
         body,
-        InstanceDef::Item(ty::WithOptParam::dummy(def_id.to_def_id())),
+        InstanceDef::Item(ty::WithOptConstParam::dummy(def_id.to_def_id())),
         promoted,
         MirPhase::DropElab,
         &[post_borrowck_cleanup],
@@ -473,7 +478,7 @@ fn run_optimization_passes<'tcx>(
     run_passes(
         tcx,
         body,
-        InstanceDef::Item(ty::WithOptParam::dummy(def_id.to_def_id())),
+        InstanceDef::Item(ty::WithOptConstParam::dummy(def_id.to_def_id())),
         promoted,
         MirPhase::Optimized,
         &[
@@ -488,7 +493,7 @@ fn optimized_mir<'tcx>(tcx: TyCtxt<'tcx>, did: DefId) -> &'tcx Body<'tcx> {
     if let Some(param_did) = tcx.opt_const_param_of(did) {
         tcx.optimized_mir_of_const_arg((did, param_did))
     } else {
-        tcx.arena.alloc(inner_optimized_mir(tcx, ty::WithOptParam::dummy(did)))
+        tcx.arena.alloc(inner_optimized_mir(tcx, ty::WithOptConstParam::dummy(did)))
     }
 }
 
@@ -496,10 +501,13 @@ fn optimized_mir_of_const_arg<'tcx>(
     tcx: TyCtxt<'tcx>,
     (did, param_did): (LocalDefId, DefId),
 ) -> &'tcx Body<'tcx> {
-    tcx.arena.alloc(inner_optimized_mir(tcx, ty::WithOptParam { did, param_did: Some(param_did) }))
+    tcx.arena.alloc(inner_optimized_mir(
+        tcx,
+        ty::WithOptConstParam { did, const_param_did: Some(param_did) },
+    ))
 }
 
-fn inner_optimized_mir(tcx: TyCtxt<'_>, def: ty::WithOptParam<LocalDefId>) -> Body<'_> {
+fn inner_optimized_mir(tcx: TyCtxt<'_>, def: ty::WithOptConstParam<LocalDefId>) -> Body<'_> {
     if tcx.is_constructor(def.did.to_def_id()) {
         // There's no reason to run all of the MIR passes on constructors when
         // we can just output the MIR we want directly. This also saves const
@@ -518,9 +526,9 @@ fn inner_optimized_mir(tcx: TyCtxt<'_>, def: ty::WithOptParam<LocalDefId>) -> Bo
 
 fn promoted_mir<'tcx>(
     tcx: TyCtxt<'tcx>,
-    def: ty::WithOptParam<LocalDefId>,
+    def: ty::WithOptConstParam<LocalDefId>,
 ) -> &'tcx IndexVec<Promoted, Body<'tcx>> {
-    if def.param_did.is_none() {
+    if def.const_param_did.is_none() {
         if let Some(param_did) = tcx.opt_const_param_of(def.did) {
             return tcx.promoted_mir_of_const_arg((def.did, param_did));
         }
@@ -530,7 +538,7 @@ fn promoted_mir<'tcx>(
         return tcx.arena.alloc(IndexVec::new());
     }
 
-    if let Some(param_did) = def.param_did {
+    if let Some(param_did) = def.const_param_did {
         tcx.ensure().mir_borrowck_const_arg((def.did, param_did));
     } else {
         tcx.ensure().mir_borrowck(def.did);
diff --git a/src/librustc_mir/transform/promote_consts.rs b/src/librustc_mir/transform/promote_consts.rs
index 292ff17f4c5..59a8415ef96 100644
--- a/src/librustc_mir/transform/promote_consts.rs
+++ b/src/librustc_mir/transform/promote_consts.rs
@@ -936,7 +936,7 @@ impl<'a, 'tcx> Promoter<'a, 'tcx> {
 
     fn promote_candidate(
         mut self,
-        def: ty::WithOptParam<DefId>,
+        def: ty::WithOptConstParam<DefId>,
         candidate: Candidate,
         next_promoted_id: usize,
     ) -> Option<Body<'tcx>> {
@@ -1099,7 +1099,7 @@ impl<'a, 'tcx> MutVisitor<'tcx> for Promoter<'a, 'tcx> {
 }
 
 pub fn promote_candidates<'tcx>(
-    def: ty::WithOptParam<DefId>,
+    def: ty::WithOptConstParam<DefId>,
     body: &mut Body<'tcx>,
     tcx: TyCtxt<'tcx>,
     mut temps: IndexVec<Local, TempState>,
diff --git a/src/librustc_mir/util/pretty.rs b/src/librustc_mir/util/pretty.rs
index 9b6dd2dc268..e01badde217 100644
--- a/src/librustc_mir/util/pretty.rs
+++ b/src/librustc_mir/util/pretty.rs
@@ -249,7 +249,7 @@ pub fn write_mir_pretty<'tcx>(
         for (i, body) in tcx.promoted_mir(def_id).iter_enumerated() {
             writeln!(w)?;
             let src = MirSource {
-                instance: ty::InstanceDef::Item(ty::WithOptParam::dummy(def_id)),
+                instance: ty::InstanceDef::Item(ty::WithOptConstParam::dummy(def_id)),
                 promoted: Some(i),
             };
             write_mir_fn(tcx, src, body, &mut |_, _| Ok(()), w)?;
diff --git a/src/librustc_mir_build/build/mod.rs b/src/librustc_mir_build/build/mod.rs
index 4aa3e87d415..21a5ea0aae3 100644
--- a/src/librustc_mir_build/build/mod.rs
+++ b/src/librustc_mir_build/build/mod.rs
@@ -21,10 +21,10 @@ use rustc_target::spec::PanicStrategy;
 
 use super::lints;
 
-crate fn mir_built<'tcx>(tcx: TyCtxt<'tcx>, def: ty::WithOptParam<LocalDefId>) -> &'tcx ty::steal::Steal<Body<'tcx>> {
-    if def.param_did.is_none() {
-        if let param_did @ Some(_) = tcx.opt_const_param_of(def.did) {
-            return tcx.mir_built(ty::WithOptParam { param_did, ..def });
+crate fn mir_built<'tcx>(tcx: TyCtxt<'tcx>, def: ty::WithOptConstParam<LocalDefId>) -> &'tcx ty::steal::Steal<Body<'tcx>> {
+    if def.const_param_did.is_none() {
+        if let const_param_did @ Some(_) = tcx.opt_const_param_of(def.did) {
+            return tcx.mir_built(ty::WithOptConstParam { const_param_did, ..def });
         }
     }
 
@@ -32,7 +32,7 @@ crate fn mir_built<'tcx>(tcx: TyCtxt<'tcx>, def: ty::WithOptParam<LocalDefId>) -
 }
 
 /// Construct the MIR for a given `DefId`.
-fn mir_build(tcx: TyCtxt<'_>, def: ty::WithOptParam<LocalDefId>) -> Body<'_> {
+fn mir_build(tcx: TyCtxt<'_>, def: ty::WithOptConstParam<LocalDefId>) -> Body<'_> {
     let id = tcx.hir().as_local_hir_id(def.did);
 
     // Figure out what primary body this item has.
diff --git a/src/librustc_mir_build/hair/cx/expr.rs b/src/librustc_mir_build/hair/cx/expr.rs
index 025ef1ece46..8692363d006 100644
--- a/src/librustc_mir_build/hair/cx/expr.rs
+++ b/src/librustc_mir_build/hair/cx/expr.rs
@@ -601,7 +601,7 @@ fn make_mirror_unadjusted<'a, 'tcx>(
                             let substs = InternalSubsts::identity_for_item(cx.tcx(), did);
                             let lhs = mk_const(cx.tcx().mk_const(ty::Const {
                                 val: ty::ConstKind::Unevaluated(
-                                    ty::WithOptParam::dummy(did),
+                                    ty::WithOptConstParam::dummy(did),
                                     substs,
                                     None,
                                 ),
@@ -800,7 +800,11 @@ fn convert_path_expr<'a, 'tcx>(
             debug!("convert_path_expr: (const) user_ty={:?}", user_ty);
             ExprKind::Literal {
                 literal: cx.tcx.mk_const(ty::Const {
-                    val: ty::ConstKind::Unevaluated(ty::WithOptParam::dummy(def_id), substs, None),
+                    val: ty::ConstKind::Unevaluated(
+                        ty::WithOptConstParam::dummy(def_id),
+                        substs,
+                        None,
+                    ),
                     ty: cx.tables().node_type(expr.hir_id),
                 }),
                 user_ty,
diff --git a/src/librustc_mir_build/hair/cx/mod.rs b/src/librustc_mir_build/hair/cx/mod.rs
index 7daf7b629d8..12d1c637fb0 100644
--- a/src/librustc_mir_build/hair/cx/mod.rs
+++ b/src/librustc_mir_build/hair/cx/mod.rs
@@ -52,7 +52,7 @@ crate struct Cx<'a, 'tcx> {
 impl<'a, 'tcx> Cx<'a, 'tcx> {
     crate fn new(
         infcx: &'a InferCtxt<'a, 'tcx>,
-        def: ty::WithOptParam<LocalDefId>,
+        def: ty::WithOptConstParam<LocalDefId>,
         src_id: hir::HirId,
     ) -> Cx<'a, 'tcx> {
         let tcx = infcx.tcx;
diff --git a/src/librustc_ty/instance.rs b/src/librustc_ty/instance.rs
index 0a1d8c1077a..6de08bd0489 100644
--- a/src/librustc_ty/instance.rs
+++ b/src/librustc_ty/instance.rs
@@ -21,24 +21,26 @@ fn resolve_instance<'tcx>(
         }
     }
 
-    inner_resolve_instance(tcx, param_env.and((ty::WithOptParam::dummy(did), substs)))
+    inner_resolve_instance(tcx, param_env.and((ty::WithOptConstParam::dummy(did), substs)))
 }
 
 fn resolve_instance_of_const_arg<'tcx>(
     tcx: TyCtxt<'tcx>,
     key: ty::ParamEnvAnd<'tcx, (LocalDefId, DefId, SubstsRef<'tcx>)>,
 ) -> Result<Option<Instance<'tcx>>, ErrorReported> {
-    let (param_env, (did, param_did, substs)) = key.into_parts();
+    let (param_env, (did, const_param_did, substs)) = key.into_parts();
     inner_resolve_instance(
         tcx,
-        param_env
-            .and((ty::WithOptParam { did: did.to_def_id(), param_did: Some(param_did) }, substs)),
+        param_env.and((
+            ty::WithOptConstParam { did: did.to_def_id(), const_param_did: Some(const_param_did) },
+            substs,
+        )),
     )
 }
 
 fn inner_resolve_instance<'tcx>(
     tcx: TyCtxt<'tcx>,
-    key: ty::ParamEnvAnd<'tcx, (ty::WithOptParam<DefId>, SubstsRef<'tcx>)>,
+    key: ty::ParamEnvAnd<'tcx, (ty::WithOptConstParam<DefId>, SubstsRef<'tcx>)>,
 ) -> Result<Option<Instance<'tcx>>, ErrorReported> {
     let (param_env, (def, substs)) = key.into_parts();
 
@@ -208,7 +210,9 @@ fn resolve_associated_item<'tcx>(
             Some(ty::Instance::new(leaf_def.item.def_id, substs))
         }
         traits::ImplSourceGenerator(generator_data) => Some(Instance {
-            def: ty::InstanceDef::Item(ty::WithOptParam::dummy(generator_data.generator_def_id)),
+            def: ty::InstanceDef::Item(ty::WithOptConstParam::dummy(
+                generator_data.generator_def_id,
+            )),
             substs: generator_data.substs,
         }),
         traits::ImplSourceClosure(closure_data) => {
diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs
index eeb14352ca0..37f48f82ea6 100644
--- a/src/librustc_typeck/astconv.rs
+++ b/src/librustc_typeck/astconv.rs
@@ -886,11 +886,11 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
                     }
                 }
                 (GenericParamDefKind::Const, GenericArg::Const(ct)) => {
-                    ty::Const::const_arg_from_anon_const(
+                    ty::Const::from_opt_const_arg_anon_const(
                         tcx,
-                        ty::WithOptParam {
+                        ty::WithOptConstParam {
                             did: tcx.hir().local_def_id(ct.value.hir_id),
-                            param_did: Some(param.def_id),
+                            const_param_did: Some(param.def_id),
                         },
                     )
                     .into()
diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs
index fd2a0175cf6..9a8d78940ba 100644
--- a/src/librustc_typeck/check/mod.rs
+++ b/src/librustc_typeck/check/mod.rs
@@ -3560,11 +3560,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
         ast_c: &hir::AnonConst,
         param_def_id: DefId,
     ) -> &'tcx ty::Const<'tcx> {
-        let const_def = ty::WithOptParam {
+        let const_def = ty::WithOptConstParam {
             did: self.tcx.hir().local_def_id(ast_c.hir_id),
-            param_did: Some(param_def_id),
+            const_param_did: Some(param_def_id),
         };
-        let c = ty::Const::const_arg_from_anon_const(self.tcx, const_def);
+        let c = ty::Const::from_opt_const_arg_anon_const(self.tcx, const_def);
         self.register_wf_obligation(
             c.into(),
             self.tcx.hir().span(ast_c.hir_id),
diff --git a/src/librustc_typeck/check/wfcheck.rs b/src/librustc_typeck/check/wfcheck.rs
index f64dce5132d..30aa861e55d 100644
--- a/src/librustc_typeck/check/wfcheck.rs
+++ b/src/librustc_typeck/check/wfcheck.rs
@@ -424,7 +424,7 @@ fn check_type_defn<'tcx, F>(
                     cause,
                     fcx.param_env,
                     ty::PredicateKind::ConstEvaluatable(
-                        ty::WithOptParam::dummy(discr_def_id.to_def_id()),
+                        ty::WithOptConstParam::dummy(discr_def_id.to_def_id()),
                         discr_substs,
                     )
                     .to_predicate(fcx.tcx),
diff --git a/src/test/mir-opt/const-promotion-extern-static/rustc.BAR.PromoteTemps.diff b/src/test/mir-opt/const-promotion-extern-static/rustc.BAR.PromoteTemps.diff
index a39ad967392..0e0d8ea9063 100644
--- a/src/test/mir-opt/const-promotion-extern-static/rustc.BAR.PromoteTemps.diff
+++ b/src/test/mir-opt/const-promotion-extern-static/rustc.BAR.PromoteTemps.diff
@@ -22,7 +22,7 @@
 -                                          // + ty: &i32
 -                                          // + val: Value(Scalar(alloc0))
 +                                          // + ty: &[&i32; 1]
-+                                          // + val: Unevaluated(WithOptParam { did: DefId(0:6 ~ const_promotion_extern_static[317d]::BAR[0]), param_did: None }, [], Some(promoted[0]))
++                                          // + val: Unevaluated(WithOptConstParam { did: DefId(0:6 ~ const_promotion_extern_static[317d]::BAR[0]), const_param_did: None }, [], Some(promoted[0]))
                                            // mir::Constant
 -                                          // + span: $DIR/const-promotion-extern-static.rs:9:33: 9:34
 -                                          // + literal: Const { ty: &i32, val: Value(Scalar(alloc0)) }
@@ -30,7 +30,7 @@
 -         _3 = [move _4];                  // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
 -         _2 = &_3;                        // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
 +                                          // + span: $DIR/const-promotion-extern-static.rs:9:31: 9:35
-+                                          // + literal: Const { ty: &[&i32; 1], val: Unevaluated(WithOptParam { did: DefId(0:6 ~ const_promotion_extern_static[317d]::BAR[0]), param_did: None }, [], Some(promoted[0])) }
++                                          // + literal: Const { ty: &[&i32; 1], val: Unevaluated(WithOptConstParam { did: DefId(0:6 ~ const_promotion_extern_static[317d]::BAR[0]), const_param_did: None }, [], Some(promoted[0])) }
 +         _2 = &(*_6);                     // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
           _1 = move _2 as &[&i32] (Pointer(Unsize)); // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
           _0 = const core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb2, unwind: bb1]; // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44
diff --git a/src/test/mir-opt/const-promotion-extern-static/rustc.FOO.PromoteTemps.diff b/src/test/mir-opt/const-promotion-extern-static/rustc.FOO.PromoteTemps.diff
index e9ca0641299..a885b4d3bae 100644
--- a/src/test/mir-opt/const-promotion-extern-static/rustc.FOO.PromoteTemps.diff
+++ b/src/test/mir-opt/const-promotion-extern-static/rustc.FOO.PromoteTemps.diff
@@ -24,7 +24,7 @@
 -                                          // + ty: &i32
 -                                          // + val: Value(Scalar(alloc2))
 +                                          // + ty: &[&i32; 1]
-+                                          // + val: Unevaluated(WithOptParam { did: DefId(0:7 ~ const_promotion_extern_static[317d]::FOO[0]), param_did: None }, [], Some(promoted[0]))
++                                          // + val: Unevaluated(WithOptConstParam { did: DefId(0:7 ~ const_promotion_extern_static[317d]::FOO[0]), const_param_did: None }, [], Some(promoted[0]))
                                            // mir::Constant
 -                                          // + span: $DIR/const-promotion-extern-static.rs:13:42: 13:43
 -                                          // + literal: Const { ty: &i32, val: Value(Scalar(alloc2)) }
@@ -32,7 +32,7 @@
 -         _3 = [move _4];                  // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
 -         _2 = &_3;                        // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
 +                                          // + span: $DIR/const-promotion-extern-static.rs:13:31: 13:46
-+                                          // + literal: Const { ty: &[&i32; 1], val: Unevaluated(WithOptParam { did: DefId(0:7 ~ const_promotion_extern_static[317d]::FOO[0]), param_did: None }, [], Some(promoted[0])) }
++                                          // + literal: Const { ty: &[&i32; 1], val: Unevaluated(WithOptConstParam { did: DefId(0:7 ~ const_promotion_extern_static[317d]::FOO[0]), const_param_did: None }, [], Some(promoted[0])) }
 +         _2 = &(*_6);                     // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
           _1 = move _2 as &[&i32] (Pointer(Unsize)); // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
           _0 = const core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb2, unwind: bb1]; // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
diff --git a/src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices/32bit/rustc.main.ConstProp.diff b/src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices/32bit/rustc.main.ConstProp.diff
index 0ad68b9f6c7..0f9c81943ed 100644
--- a/src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices/32bit/rustc.main.ConstProp.diff
+++ b/src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices/32bit/rustc.main.ConstProp.diff
@@ -28,10 +28,10 @@
           _9 = const main::promoted[0];    // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
                                            // ty::Const
                                            // + ty: &[i32; 3]
-                                           // + val: Unevaluated(WithOptParam { did: DefId(0:3 ~ bad_op_unsafe_oob_for_slices[317d]::main[0]), param_did: None }, [], Some(promoted[0]))
+                                           // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ bad_op_unsafe_oob_for_slices[317d]::main[0]), const_param_did: None }, [], Some(promoted[0]))
                                            // mir::Constant
                                            // + span: $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
-                                           // + literal: Const { ty: &[i32; 3], val: Unevaluated(WithOptParam { did: DefId(0:3 ~ bad_op_unsafe_oob_for_slices[317d]::main[0]), param_did: None }, [], Some(promoted[0])) }
+                                           // + literal: Const { ty: &[i32; 3], val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ bad_op_unsafe_oob_for_slices[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) }
           _3 = _9;                         // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
           _2 = &raw const (*_3);           // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
           _1 = move _2 as *const [i32] (Pointer(Unsize)); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
diff --git a/src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices/64bit/rustc.main.ConstProp.diff b/src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices/64bit/rustc.main.ConstProp.diff
index c7683305da0..da2c8dffb24 100644
--- a/src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices/64bit/rustc.main.ConstProp.diff
+++ b/src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices/64bit/rustc.main.ConstProp.diff
@@ -28,10 +28,10 @@
           _9 = const main::promoted[0];    // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
                                            // ty::Const
                                            // + ty: &[i32; 3]
-                                           // + val: Unevaluated(WithOptParam { did: DefId(0:3 ~ bad_op_unsafe_oob_for_slices[317d]::main[0]), param_did: None }, [], Some(promoted[0]))
+                                           // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ bad_op_unsafe_oob_for_slices[317d]::main[0]), const_param_did: None }, [], Some(promoted[0]))
                                            // mir::Constant
                                            // + span: $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
-                                           // + literal: Const { ty: &[i32; 3], val: Unevaluated(WithOptParam { did: DefId(0:3 ~ bad_op_unsafe_oob_for_slices[317d]::main[0]), param_did: None }, [], Some(promoted[0])) }
+                                           // + literal: Const { ty: &[i32; 3], val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ bad_op_unsafe_oob_for_slices[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) }
           _3 = _9;                         // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
           _2 = &raw const (*_3);           // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
           _1 = move _2 as *const [i32] (Pointer(Unsize)); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
diff --git a/src/test/mir-opt/const_prop/const_prop_fails_gracefully/rustc.main.ConstProp.diff b/src/test/mir-opt/const_prop/const_prop_fails_gracefully/rustc.main.ConstProp.diff
index b09bbead410..f3efef387a3 100644
--- a/src/test/mir-opt/const_prop/const_prop_fails_gracefully/rustc.main.ConstProp.diff
+++ b/src/test/mir-opt/const_prop/const_prop_fails_gracefully/rustc.main.ConstProp.diff
@@ -19,10 +19,10 @@
           _3 = const main::FOO;            // scope 0 at $DIR/const_prop_fails_gracefully.rs:7:13: 7:16
                                            // ty::Const
                                            // + ty: &i32
-                                           // + val: Unevaluated(WithOptParam { did: DefId(0:5 ~ const_prop_fails_gracefully[317d]::main[0]::FOO[0]), param_did: None }, [], None)
+                                           // + val: Unevaluated(WithOptConstParam { did: DefId(0:5 ~ const_prop_fails_gracefully[317d]::main[0]::FOO[0]), const_param_did: None }, [], None)
                                            // mir::Constant
                                            // + span: $DIR/const_prop_fails_gracefully.rs:7:13: 7:16
-                                           // + literal: Const { ty: &i32, val: Unevaluated(WithOptParam { did: DefId(0:5 ~ const_prop_fails_gracefully[317d]::main[0]::FOO[0]), param_did: None }, [], None) }
+                                           // + literal: Const { ty: &i32, val: Unevaluated(WithOptConstParam { did: DefId(0:5 ~ const_prop_fails_gracefully[317d]::main[0]::FOO[0]), const_param_did: None }, [], None) }
           _2 = &raw const (*_3);           // scope 0 at $DIR/const_prop_fails_gracefully.rs:7:13: 7:16
           _1 = move _2 as usize (Misc);    // scope 0 at $DIR/const_prop_fails_gracefully.rs:7:13: 7:39
           StorageDead(_2);                 // scope 0 at $DIR/const_prop_fails_gracefully.rs:7:38: 7:39
diff --git a/src/test/mir-opt/const_prop/control-flow-simplification/rustc.hello.ConstProp.diff b/src/test/mir-opt/const_prop/control-flow-simplification/rustc.hello.ConstProp.diff
index d8be755632f..68527a86aeb 100644
--- a/src/test/mir-opt/const_prop/control-flow-simplification/rustc.hello.ConstProp.diff
+++ b/src/test/mir-opt/const_prop/control-flow-simplification/rustc.hello.ConstProp.diff
@@ -12,11 +12,11 @@
 +         _1 = const false;                // scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21
                                            // ty::Const
                                            // + ty: bool
--                                          // + val: Unevaluated(WithOptParam { did: DefId(0:4 ~ control_flow_simplification[317d]::NeedsDrop[0]::NEEDS[0]), param_did: None }, [bool], None)
+-                                          // + val: Unevaluated(WithOptConstParam { did: DefId(0:4 ~ control_flow_simplification[317d]::NeedsDrop[0]::NEEDS[0]), const_param_did: None }, [bool], None)
 +                                          // + val: Value(Scalar(0x00))
                                            // mir::Constant
                                            // + span: $DIR/control-flow-simplification.rs:12:8: 12:21
--                                          // + literal: Const { ty: bool, val: Unevaluated(WithOptParam { did: DefId(0:4 ~ control_flow_simplification[317d]::NeedsDrop[0]::NEEDS[0]), param_did: None }, [bool], None) }
+-                                          // + literal: Const { ty: bool, val: Unevaluated(WithOptConstParam { did: DefId(0:4 ~ control_flow_simplification[317d]::NeedsDrop[0]::NEEDS[0]), const_param_did: None }, [bool], None) }
 -         switchInt(_1) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/control-flow-simplification.rs:12:5: 14:6
 +                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
 +         switchInt(const false) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/control-flow-simplification.rs:12:5: 14:6
diff --git a/src/test/mir-opt/const_prop/ref_deref/rustc.main.ConstProp.diff b/src/test/mir-opt/const_prop/ref_deref/rustc.main.ConstProp.diff
index 0182cb83a96..ba5ac8d3ddf 100644
--- a/src/test/mir-opt/const_prop/ref_deref/rustc.main.ConstProp.diff
+++ b/src/test/mir-opt/const_prop/ref_deref/rustc.main.ConstProp.diff
@@ -14,10 +14,10 @@
           _4 = const main::promoted[0];    // scope 0 at $DIR/ref_deref.rs:5:6: 5:10
                                            // ty::Const
                                            // + ty: &i32
-                                           // + val: Unevaluated(WithOptParam { did: DefId(0:3 ~ ref_deref[317d]::main[0]), param_did: None }, [], Some(promoted[0]))
+                                           // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ ref_deref[317d]::main[0]), const_param_did: None }, [], Some(promoted[0]))
                                            // mir::Constant
                                            // + span: $DIR/ref_deref.rs:5:6: 5:10
-                                           // + literal: Const { ty: &i32, val: Unevaluated(WithOptParam { did: DefId(0:3 ~ ref_deref[317d]::main[0]), param_did: None }, [], Some(promoted[0])) }
+                                           // + literal: Const { ty: &i32, val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ ref_deref[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) }
           _2 = _4;                         // scope 0 at $DIR/ref_deref.rs:5:6: 5:10
 -         _1 = (*_2);                      // scope 0 at $DIR/ref_deref.rs:5:5: 5:10
 +         _1 = const 4_i32;                // scope 0 at $DIR/ref_deref.rs:5:5: 5:10
diff --git a/src/test/mir-opt/const_prop/ref_deref/rustc.main.PromoteTemps.diff b/src/test/mir-opt/const_prop/ref_deref/rustc.main.PromoteTemps.diff
index da915585f82..fa68eb34818 100644
--- a/src/test/mir-opt/const_prop/ref_deref/rustc.main.PromoteTemps.diff
+++ b/src/test/mir-opt/const_prop/ref_deref/rustc.main.PromoteTemps.diff
@@ -18,13 +18,13 @@
 -                                          // + ty: i32
 -                                          // + val: Value(Scalar(0x00000004))
 +                                          // + ty: &i32
-+                                          // + val: Unevaluated(WithOptParam { did: DefId(0:3 ~ ref_deref[317d]::main[0]), param_did: None }, [], Some(promoted[0]))
++                                          // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ ref_deref[317d]::main[0]), const_param_did: None }, [], Some(promoted[0]))
                                            // mir::Constant
 -                                          // + span: $DIR/ref_deref.rs:5:8: 5:9
 -                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) }
 -         _2 = &_3;                        // scope 0 at $DIR/ref_deref.rs:5:6: 5:10
 +                                          // + span: $DIR/ref_deref.rs:5:6: 5:10
-+                                          // + literal: Const { ty: &i32, val: Unevaluated(WithOptParam { did: DefId(0:3 ~ ref_deref[317d]::main[0]), param_did: None }, [], Some(promoted[0])) }
++                                          // + literal: Const { ty: &i32, val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ ref_deref[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) }
 +         _2 = &(*_4);                     // scope 0 at $DIR/ref_deref.rs:5:6: 5:10
           _1 = (*_2);                      // scope 0 at $DIR/ref_deref.rs:5:5: 5:10
 -         StorageDead(_3);                 // scope 0 at $DIR/ref_deref.rs:5:10: 5:11
diff --git a/src/test/mir-opt/const_prop/ref_deref_project/rustc.main.ConstProp.diff b/src/test/mir-opt/const_prop/ref_deref_project/rustc.main.ConstProp.diff
index 7ce4635eeb5..483e5f1b9a4 100644
--- a/src/test/mir-opt/const_prop/ref_deref_project/rustc.main.ConstProp.diff
+++ b/src/test/mir-opt/const_prop/ref_deref_project/rustc.main.ConstProp.diff
@@ -14,10 +14,10 @@
           _4 = const main::promoted[0];    // scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
                                            // ty::Const
                                            // + ty: &(i32, i32)
-                                           // + val: Unevaluated(WithOptParam { did: DefId(0:3 ~ ref_deref_project[317d]::main[0]), param_did: None }, [], Some(promoted[0]))
+                                           // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ ref_deref_project[317d]::main[0]), const_param_did: None }, [], Some(promoted[0]))
                                            // mir::Constant
                                            // + span: $DIR/ref_deref_project.rs:5:6: 5:17
-                                           // + literal: Const { ty: &(i32, i32), val: Unevaluated(WithOptParam { did: DefId(0:3 ~ ref_deref_project[317d]::main[0]), param_did: None }, [], Some(promoted[0])) }
+                                           // + literal: Const { ty: &(i32, i32), val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ ref_deref_project[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) }
           _2 = &((*_4).1: i32);            // scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
           _1 = (*_2);                      // scope 0 at $DIR/ref_deref_project.rs:5:5: 5:17
           StorageDead(_2);                 // scope 0 at $DIR/ref_deref_project.rs:5:17: 5:18
diff --git a/src/test/mir-opt/const_prop/ref_deref_project/rustc.main.PromoteTemps.diff b/src/test/mir-opt/const_prop/ref_deref_project/rustc.main.PromoteTemps.diff
index 535da0655d5..86e6aacab45 100644
--- a/src/test/mir-opt/const_prop/ref_deref_project/rustc.main.PromoteTemps.diff
+++ b/src/test/mir-opt/const_prop/ref_deref_project/rustc.main.PromoteTemps.diff
@@ -18,7 +18,7 @@
 -                                          // + ty: i32
 -                                          // + val: Value(Scalar(0x00000004))
 +                                          // + ty: &(i32, i32)
-+                                          // + val: Unevaluated(WithOptParam { did: DefId(0:3 ~ ref_deref_project[317d]::main[0]), param_did: None }, [], Some(promoted[0]))
++                                          // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ ref_deref_project[317d]::main[0]), const_param_did: None }, [], Some(promoted[0]))
                                            // mir::Constant
 -                                          // + span: $DIR/ref_deref_project.rs:5:9: 5:10
 -                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) }
@@ -30,7 +30,7 @@
 -                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000005)) }
 -         _2 = &(_3.1: i32);               // scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
 +                                          // + span: $DIR/ref_deref_project.rs:5:6: 5:17
-+                                          // + literal: Const { ty: &(i32, i32), val: Unevaluated(WithOptParam { did: DefId(0:3 ~ ref_deref_project[317d]::main[0]), param_did: None }, [], Some(promoted[0])) }
++                                          // + literal: Const { ty: &(i32, i32), val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ ref_deref_project[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) }
 +         _2 = &((*_4).1: i32);            // scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
           _1 = (*_2);                      // scope 0 at $DIR/ref_deref_project.rs:5:5: 5:17
 -         StorageDead(_3);                 // scope 0 at $DIR/ref_deref_project.rs:5:17: 5:18
diff --git a/src/test/mir-opt/const_prop/slice_len/32bit/rustc.main.ConstProp.diff b/src/test/mir-opt/const_prop/slice_len/32bit/rustc.main.ConstProp.diff
index 7176428d82a..6eb64f75ef1 100644
--- a/src/test/mir-opt/const_prop/slice_len/32bit/rustc.main.ConstProp.diff
+++ b/src/test/mir-opt/const_prop/slice_len/32bit/rustc.main.ConstProp.diff
@@ -21,10 +21,10 @@
           _9 = const main::promoted[0];    // scope 0 at $DIR/slice_len.rs:5:6: 5:19
                                            // ty::Const
                                            // + ty: &[u32; 3]
-                                           // + val: Unevaluated(WithOptParam { did: DefId(0:3 ~ slice_len[317d]::main[0]), param_did: None }, [], Some(promoted[0]))
+                                           // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ slice_len[317d]::main[0]), const_param_did: None }, [], Some(promoted[0]))
                                            // mir::Constant
                                            // + span: $DIR/slice_len.rs:5:6: 5:19
-                                           // + literal: Const { ty: &[u32; 3], val: Unevaluated(WithOptParam { did: DefId(0:3 ~ slice_len[317d]::main[0]), param_did: None }, [], Some(promoted[0])) }
+                                           // + literal: Const { ty: &[u32; 3], val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ slice_len[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) }
           _4 = _9;                         // scope 0 at $DIR/slice_len.rs:5:6: 5:19
           _3 = _4;                         // scope 0 at $DIR/slice_len.rs:5:6: 5:19
           _2 = move _3 as &[u32] (Pointer(Unsize)); // scope 0 at $DIR/slice_len.rs:5:6: 5:19
diff --git a/src/test/mir-opt/const_prop/slice_len/64bit/rustc.main.ConstProp.diff b/src/test/mir-opt/const_prop/slice_len/64bit/rustc.main.ConstProp.diff
index 676e54598a2..2b641bef1d8 100644
--- a/src/test/mir-opt/const_prop/slice_len/64bit/rustc.main.ConstProp.diff
+++ b/src/test/mir-opt/const_prop/slice_len/64bit/rustc.main.ConstProp.diff
@@ -21,10 +21,10 @@
           _9 = const main::promoted[0];    // scope 0 at $DIR/slice_len.rs:5:6: 5:19
                                            // ty::Const
                                            // + ty: &[u32; 3]
-                                           // + val: Unevaluated(WithOptParam { did: DefId(0:3 ~ slice_len[317d]::main[0]), param_did: None }, [], Some(promoted[0]))
+                                           // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ slice_len[317d]::main[0]), const_param_did: None }, [], Some(promoted[0]))
                                            // mir::Constant
                                            // + span: $DIR/slice_len.rs:5:6: 5:19
-                                           // + literal: Const { ty: &[u32; 3], val: Unevaluated(WithOptParam { did: DefId(0:3 ~ slice_len[317d]::main[0]), param_did: None }, [], Some(promoted[0])) }
+                                           // + literal: Const { ty: &[u32; 3], val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ slice_len[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) }
           _4 = _9;                         // scope 0 at $DIR/slice_len.rs:5:6: 5:19
           _3 = _4;                         // scope 0 at $DIR/slice_len.rs:5:6: 5:19
           _2 = move _3 as &[u32] (Pointer(Unsize)); // scope 0 at $DIR/slice_len.rs:5:6: 5:19
diff --git a/src/test/mir-opt/inline/inline-retag/rustc.bar.Inline.after.mir b/src/test/mir-opt/inline/inline-retag/rustc.bar.Inline.after.mir
index 2149200cefb..d6ac1c57a63 100644
--- a/src/test/mir-opt/inline/inline-retag/rustc.bar.Inline.after.mir
+++ b/src/test/mir-opt/inline/inline-retag/rustc.bar.Inline.after.mir
@@ -38,10 +38,10 @@ fn bar() -> bool {
         _10 = const bar::promoted[1];    // scope 1 at $DIR/inline-retag.rs:12:7: 12:9
                                          // ty::Const
                                          // + ty: &i32
-                                         // + val: Unevaluated(WithOptParam { did: DefId(0:4 ~ inline_retag[317d]::bar[0]), param_did: None }, [], Some(promoted[1]))
+                                         // + val: Unevaluated(WithOptConstParam { did: DefId(0:4 ~ inline_retag[317d]::bar[0]), const_param_did: None }, [], Some(promoted[1]))
                                          // mir::Constant
                                          // + span: $DIR/inline-retag.rs:12:7: 12:9
-                                         // + literal: Const { ty: &i32, val: Unevaluated(WithOptParam { did: DefId(0:4 ~ inline_retag[317d]::bar[0]), param_did: None }, [], Some(promoted[1])) }
+                                         // + literal: Const { ty: &i32, val: Unevaluated(WithOptConstParam { did: DefId(0:4 ~ inline_retag[317d]::bar[0]), const_param_did: None }, [], Some(promoted[1])) }
         Retag(_10);                      // scope 1 at $DIR/inline-retag.rs:12:7: 12:9
         _4 = &(*_10);                    // scope 1 at $DIR/inline-retag.rs:12:7: 12:9
         Retag(_4);                       // scope 1 at $DIR/inline-retag.rs:12:7: 12:9
@@ -52,10 +52,10 @@ fn bar() -> bool {
         _9 = const bar::promoted[0];     // scope 1 at $DIR/inline-retag.rs:12:11: 12:14
                                          // ty::Const
                                          // + ty: &i32
-                                         // + val: Unevaluated(WithOptParam { did: DefId(0:4 ~ inline_retag[317d]::bar[0]), param_did: None }, [], Some(promoted[0]))
+                                         // + val: Unevaluated(WithOptConstParam { did: DefId(0:4 ~ inline_retag[317d]::bar[0]), const_param_did: None }, [], Some(promoted[0]))
                                          // mir::Constant
                                          // + span: $DIR/inline-retag.rs:12:11: 12:14
-                                         // + literal: Const { ty: &i32, val: Unevaluated(WithOptParam { did: DefId(0:4 ~ inline_retag[317d]::bar[0]), param_did: None }, [], Some(promoted[0])) }
+                                         // + literal: Const { ty: &i32, val: Unevaluated(WithOptConstParam { did: DefId(0:4 ~ inline_retag[317d]::bar[0]), const_param_did: None }, [], Some(promoted[0])) }
         Retag(_9);                       // scope 1 at $DIR/inline-retag.rs:12:11: 12:14
         _7 = &(*_9);                     // scope 1 at $DIR/inline-retag.rs:12:11: 12:14
         Retag(_7);                       // scope 1 at $DIR/inline-retag.rs:12:11: 12:14
diff --git a/src/test/mir-opt/issue-73223/32bit/rustc.main.PreCodegen.diff b/src/test/mir-opt/issue-73223/32bit/rustc.main.PreCodegen.diff
index ebbfd5eaedb..cf5d1f3f6c6 100644
--- a/src/test/mir-opt/issue-73223/32bit/rustc.main.PreCodegen.diff
+++ b/src/test/mir-opt/issue-73223/32bit/rustc.main.PreCodegen.diff
@@ -96,10 +96,10 @@
           (_5.1: &i32) = const main::promoted[1]; // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
                                            // ty::Const
                                            // + ty: &i32
-                                           // + val: Unevaluated(WithOptParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), param_did: None }, [], Some(promoted[1]))
+                                           // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), const_param_did: None }, [], Some(promoted[1]))
                                            // mir::Constant
                                            // + span: $SRC_DIR/libcore/macros/mod.rs:LL:COL
-                                           // + literal: Const { ty: &i32, val: Unevaluated(WithOptParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), param_did: None }, [], Some(promoted[1])) }
+                                           // + literal: Const { ty: &i32, val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), const_param_did: None }, [], Some(promoted[1])) }
           StorageDead(_6);                 // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
           StorageLive(_7);                 // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
           _7 = (_5.0: &i32);               // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
@@ -140,10 +140,10 @@
           _15 = const main::promoted[0] as &[&str] (Pointer(Unsize)); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
                                            // ty::Const
                                            // + ty: &[&str; 3]
-                                           // + val: Unevaluated(WithOptParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), param_did: None }, [], Some(promoted[0]))
+                                           // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), const_param_did: None }, [], Some(promoted[0]))
                                            // mir::Constant
                                            // + span: $SRC_DIR/libcore/macros/mod.rs:LL:COL
-                                           // + literal: Const { ty: &[&str; 3], val: Unevaluated(WithOptParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), param_did: None }, [], Some(promoted[0])) }
+                                           // + literal: Const { ty: &[&str; 3], val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) }
           StorageLive(_18);                // scope 4 at $SRC_DIR/libstd/macros.rs:LL:COL
           StorageLive(_19);                // scope 4 at $SRC_DIR/libstd/macros.rs:LL:COL
           StorageLive(_20);                // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
diff --git a/src/test/mir-opt/issue-73223/32bit/rustc.main.SimplifyArmIdentity.diff b/src/test/mir-opt/issue-73223/32bit/rustc.main.SimplifyArmIdentity.diff
index 3d9f9b096b6..91baac86112 100644
--- a/src/test/mir-opt/issue-73223/32bit/rustc.main.SimplifyArmIdentity.diff
+++ b/src/test/mir-opt/issue-73223/32bit/rustc.main.SimplifyArmIdentity.diff
@@ -153,10 +153,10 @@
           _51 = const main::promoted[1];   // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
                                            // ty::Const
                                            // + ty: &i32
-                                           // + val: Unevaluated(WithOptParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), param_did: None }, [], Some(promoted[1]))
+                                           // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), const_param_did: None }, [], Some(promoted[1]))
                                            // mir::Constant
                                            // + span: $SRC_DIR/libcore/macros/mod.rs:LL:COL
-                                           // + literal: Const { ty: &i32, val: Unevaluated(WithOptParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), param_did: None }, [], Some(promoted[1])) }
+                                           // + literal: Const { ty: &i32, val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), const_param_did: None }, [], Some(promoted[1])) }
           _11 = _51;                       // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
           (_9.0: &i32) = move _10;         // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
           (_9.1: &i32) = move _11;         // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
@@ -220,10 +220,10 @@
           _50 = const main::promoted[0];   // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
                                            // ty::Const
                                            // + ty: &[&str; 3]
-                                           // + val: Unevaluated(WithOptParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), param_did: None }, [], Some(promoted[0]))
+                                           // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), const_param_did: None }, [], Some(promoted[0]))
                                            // mir::Constant
                                            // + span: $SRC_DIR/libcore/macros/mod.rs:LL:COL
-                                           // + literal: Const { ty: &[&str; 3], val: Unevaluated(WithOptParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), param_did: None }, [], Some(promoted[0])) }
+                                           // + literal: Const { ty: &[&str; 3], val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) }
           _25 = _50;                       // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
           _24 = _25;                       // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
           _23 = move _24 as &[&str] (Pointer(Unsize)); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
diff --git a/src/test/mir-opt/issue-73223/64bit/rustc.main.PreCodegen.diff b/src/test/mir-opt/issue-73223/64bit/rustc.main.PreCodegen.diff
index ebbfd5eaedb..cf5d1f3f6c6 100644
--- a/src/test/mir-opt/issue-73223/64bit/rustc.main.PreCodegen.diff
+++ b/src/test/mir-opt/issue-73223/64bit/rustc.main.PreCodegen.diff
@@ -96,10 +96,10 @@
           (_5.1: &i32) = const main::promoted[1]; // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
                                            // ty::Const
                                            // + ty: &i32
-                                           // + val: Unevaluated(WithOptParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), param_did: None }, [], Some(promoted[1]))
+                                           // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), const_param_did: None }, [], Some(promoted[1]))
                                            // mir::Constant
                                            // + span: $SRC_DIR/libcore/macros/mod.rs:LL:COL
-                                           // + literal: Const { ty: &i32, val: Unevaluated(WithOptParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), param_did: None }, [], Some(promoted[1])) }
+                                           // + literal: Const { ty: &i32, val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), const_param_did: None }, [], Some(promoted[1])) }
           StorageDead(_6);                 // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
           StorageLive(_7);                 // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
           _7 = (_5.0: &i32);               // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
@@ -140,10 +140,10 @@
           _15 = const main::promoted[0] as &[&str] (Pointer(Unsize)); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
                                            // ty::Const
                                            // + ty: &[&str; 3]
-                                           // + val: Unevaluated(WithOptParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), param_did: None }, [], Some(promoted[0]))
+                                           // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), const_param_did: None }, [], Some(promoted[0]))
                                            // mir::Constant
                                            // + span: $SRC_DIR/libcore/macros/mod.rs:LL:COL
-                                           // + literal: Const { ty: &[&str; 3], val: Unevaluated(WithOptParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), param_did: None }, [], Some(promoted[0])) }
+                                           // + literal: Const { ty: &[&str; 3], val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) }
           StorageLive(_18);                // scope 4 at $SRC_DIR/libstd/macros.rs:LL:COL
           StorageLive(_19);                // scope 4 at $SRC_DIR/libstd/macros.rs:LL:COL
           StorageLive(_20);                // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
diff --git a/src/test/mir-opt/issue-73223/64bit/rustc.main.SimplifyArmIdentity.diff b/src/test/mir-opt/issue-73223/64bit/rustc.main.SimplifyArmIdentity.diff
index 2ebf849c9bf..0da748d79eb 100644
--- a/src/test/mir-opt/issue-73223/64bit/rustc.main.SimplifyArmIdentity.diff
+++ b/src/test/mir-opt/issue-73223/64bit/rustc.main.SimplifyArmIdentity.diff
@@ -153,10 +153,10 @@
           _51 = const main::promoted[1];   // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
                                            // ty::Const
                                            // + ty: &i32
-                                           // + val: Unevaluated(WithOptParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), param_did: None }, [], Some(promoted[1]))
+                                           // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), const_param_did: None }, [], Some(promoted[1]))
                                            // mir::Constant
                                            // + span: $SRC_DIR/libcore/macros/mod.rs:LL:COL
-                                           // + literal: Const { ty: &i32, val: Unevaluated(WithOptParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), param_did: None }, [], Some(promoted[1])) }
+                                           // + literal: Const { ty: &i32, val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), const_param_did: None }, [], Some(promoted[1])) }
           _11 = _51;                       // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
           (_9.0: &i32) = move _10;         // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
           (_9.1: &i32) = move _11;         // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
@@ -220,10 +220,10 @@
           _50 = const main::promoted[0];   // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
                                            // ty::Const
                                            // + ty: &[&str; 3]
-                                           // + val: Unevaluated(WithOptParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), param_did: None }, [], Some(promoted[0]))
+                                           // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), const_param_did: None }, [], Some(promoted[0]))
                                            // mir::Constant
                                            // + span: $SRC_DIR/libcore/macros/mod.rs:LL:COL
-                                           // + literal: Const { ty: &[&str; 3], val: Unevaluated(WithOptParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), param_did: None }, [], Some(promoted[0])) }
+                                           // + literal: Const { ty: &[&str; 3], val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) }
           _25 = _50;                       // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
           _24 = _25;                       // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
           _23 = move _24 as &[&str] (Pointer(Unsize)); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
diff --git a/src/test/mir-opt/match_false_edges/rustc.full_tested_match.PromoteTemps.after.mir b/src/test/mir-opt/match_false_edges/rustc.full_tested_match.PromoteTemps.after.mir
index f1f7cb58aad..c53c9cf1db7 100644
--- a/src/test/mir-opt/match_false_edges/rustc.full_tested_match.PromoteTemps.after.mir
+++ b/src/test/mir-opt/match_false_edges/rustc.full_tested_match.PromoteTemps.after.mir
@@ -76,10 +76,10 @@ fn full_tested_match() -> () {
         _11 = const full_tested_match::promoted[0]; // scope 0 at $DIR/match_false_edges.rs:16:14: 16:15
                                          // ty::Const
                                          // + ty: &std::option::Option<i32>
-                                         // + val: Unevaluated(WithOptParam { did: DefId(0:5 ~ match_false_edges[317d]::full_tested_match[0]), param_did: None }, [], Some(promoted[0]))
+                                         // + val: Unevaluated(WithOptConstParam { did: DefId(0:5 ~ match_false_edges[317d]::full_tested_match[0]), const_param_did: None }, [], Some(promoted[0]))
                                          // mir::Constant
                                          // + span: $DIR/match_false_edges.rs:16:14: 16:15
-                                         // + literal: Const { ty: &std::option::Option<i32>, val: Unevaluated(WithOptParam { did: DefId(0:5 ~ match_false_edges[317d]::full_tested_match[0]), param_did: None }, [], Some(promoted[0])) }
+                                         // + literal: Const { ty: &std::option::Option<i32>, val: Unevaluated(WithOptConstParam { did: DefId(0:5 ~ match_false_edges[317d]::full_tested_match[0]), const_param_did: None }, [], Some(promoted[0])) }
         _6 = &(((*_11) as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:16:14: 16:15
         _4 = &shallow _2;                // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27
         StorageLive(_7);                 // scope 0 at $DIR/match_false_edges.rs:16:20: 16:27
diff --git a/src/test/mir-opt/retag/rustc.main.SimplifyCfg-elaborate-drops.after.mir b/src/test/mir-opt/retag/rustc.main.SimplifyCfg-elaborate-drops.after.mir
index a03cabee632..b61d9368375 100644
--- a/src/test/mir-opt/retag/rustc.main.SimplifyCfg-elaborate-drops.after.mir
+++ b/src/test/mir-opt/retag/rustc.main.SimplifyCfg-elaborate-drops.after.mir
@@ -184,10 +184,10 @@ fn main() -> () {
         _27 = const main::promoted[0];   // scope 7 at $DIR/retag.rs:47:21: 47:23
                                          // ty::Const
                                          // + ty: &i32
-                                         // + val: Unevaluated(WithOptParam { did: DefId(0:13 ~ retag[317d]::main[0]), param_did: None }, [], Some(promoted[0]))
+                                         // + val: Unevaluated(WithOptConstParam { did: DefId(0:13 ~ retag[317d]::main[0]), const_param_did: None }, [], Some(promoted[0]))
                                          // mir::Constant
                                          // + span: $DIR/retag.rs:47:21: 47:23
-                                         // + literal: Const { ty: &i32, val: Unevaluated(WithOptParam { did: DefId(0:13 ~ retag[317d]::main[0]), param_did: None }, [], Some(promoted[0])) }
+                                         // + literal: Const { ty: &i32, val: Unevaluated(WithOptConstParam { did: DefId(0:13 ~ retag[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) }
         Retag(_27);                      // scope 7 at $DIR/retag.rs:47:21: 47:23
         _23 = &(*_27);                   // scope 7 at $DIR/retag.rs:47:21: 47:23
         Retag(_23);                      // scope 7 at $DIR/retag.rs:47:21: 47:23
diff --git a/src/tools/clippy/clippy_lints/src/consts.rs b/src/tools/clippy/clippy_lints/src/consts.rs
index 6ba4201b2c2..891cb69bb56 100644
--- a/src/tools/clippy/clippy_lints/src/consts.rs
+++ b/src/tools/clippy/clippy_lints/src/consts.rs
@@ -332,7 +332,7 @@ impl<'a, 'tcx> ConstEvalLateContext<'a, 'tcx> {
                 let result = self
                     .lcx
                     .tcx
-                    .const_eval_resolve(self.param_env, ty::WithOptParam::dummy(def_id), substs, None, None)
+                    .const_eval_resolve(self.param_env, ty::WithOptConstParam::dummy(def_id), substs, None, None)
                     .ok()
                     .map(|val| rustc_middle::ty::Const::from_value(self.lcx.tcx, val, ty))?;
                 let result = miri_to_const(&result);