]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_middle/ty/instance.rs
improve naming
[rust.git] / src / librustc_middle / ty / instance.rs
index a00afab95997a8bf827922737cf34936ba6f075f..114ce491f2780546ccb8778f6bf648a64ed26748 100644 (file)
@@ -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 @@ pub fn def_id(self) -> DefId {
     }
 
     #[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 @@ pub fn with_opt_param(self) -> ty::WithOptParam<DefId> {
             | 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 @@ pub fn new(def_id: DefId, substs: SubstsRef<'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 @@ pub fn resolve(
     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);