about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/librustc_middle/ty/mod.rs2
-rw-r--r--src/librustc_mir/borrow_check/mod.rs2
-rw-r--r--src/librustc_mir/transform/check_unsafety.rs2
-rw-r--r--src/librustc_mir/transform/mod.rs6
-rw-r--r--src/librustc_mir_build/build/mod.rs5
5 files changed, 10 insertions, 7 deletions
diff --git a/src/librustc_middle/ty/mod.rs b/src/librustc_middle/ty/mod.rs
index 947f7444753..5316649d0e2 100644
--- a/src/librustc_middle/ty/mod.rs
+++ b/src/librustc_middle/ty/mod.rs
@@ -1627,7 +1627,7 @@ impl WithOptConstParam<LocalDefId> {
     /// Returns `Some((did, param_did))` if `def_id` is a const argument,
     /// `None` otherwise.
     #[inline(always)]
-    pub fn try_fetch(did: LocalDefId, tcx: TyCtxt<'_>) -> Option<(LocalDefId, DefId)> {
+    pub fn try_lookup(did: LocalDefId, tcx: TyCtxt<'_>) -> Option<(LocalDefId, DefId)> {
         tcx.opt_const_param_of(did).map(|param_did| (did, param_did))
     }
 
diff --git a/src/librustc_mir/borrow_check/mod.rs b/src/librustc_mir/borrow_check/mod.rs
index 402dfc540c6..76cc03fa609 100644
--- a/src/librustc_mir/borrow_check/mod.rs
+++ b/src/librustc_mir/borrow_check/mod.rs
@@ -89,7 +89,7 @@ const DEREF_PROJECTION: &[PlaceElem<'_>; 1] = &[ProjectionElem::Deref];
 pub fn provide(providers: &mut Providers) {
     *providers = Providers {
         mir_borrowck: |tcx, did| {
-            if let Some(def) = ty::WithOptConstParam::try_fetch(did, tcx) {
+            if let Some(def) = ty::WithOptConstParam::try_lookup(did, tcx) {
                 tcx.mir_borrowck_const_arg(def)
             } else {
                 mir_borrowck(tcx, ty::WithOptConstParam::unknown(did))
diff --git a/src/librustc_mir/transform/check_unsafety.rs b/src/librustc_mir/transform/check_unsafety.rs
index ca113bfaa4f..9c06e173bcd 100644
--- a/src/librustc_mir/transform/check_unsafety.rs
+++ b/src/librustc_mir/transform/check_unsafety.rs
@@ -439,7 +439,7 @@ impl<'a, 'tcx> UnsafetyChecker<'a, 'tcx> {
 pub(crate) fn provide(providers: &mut Providers) {
     *providers = Providers {
         unsafety_check_result: |tcx, def_id| {
-            if let Some(def) = ty::WithOptConstParam::try_fetch(def_id, tcx) {
+            if let Some(def) = ty::WithOptConstParam::try_lookup(def_id, tcx) {
                 tcx.unsafety_check_result_for_const_arg(def)
             } else {
                 unsafety_check_result(tcx, ty::WithOptConstParam::unknown(def_id))
diff --git a/src/librustc_mir/transform/mod.rs b/src/librustc_mir/transform/mod.rs
index c79da239a40..283e4b289f2 100644
--- a/src/librustc_mir/transform/mod.rs
+++ b/src/librustc_mir/transform/mod.rs
@@ -50,7 +50,7 @@ pub(crate) fn provide(providers: &mut Providers) {
         mir_const,
         mir_const_qualif: |tcx, def_id| {
             let def_id = def_id.expect_local();
-            if let Some(def) = ty::WithOptConstParam::try_fetch(def_id, tcx) {
+            if let Some(def) = ty::WithOptConstParam::try_lookup(def_id, tcx) {
                 tcx.mir_const_qualif_const_arg(def)
             } else {
                 mir_const_qualif(tcx, ty::WithOptConstParam::unknown(def_id))
@@ -66,7 +66,7 @@ pub(crate) fn provide(providers: &mut Providers) {
         is_mir_available,
         promoted_mir: |tcx, def_id| {
             let def_id = def_id.expect_local();
-            if let Some(def) = ty::WithOptConstParam::try_fetch(def_id, tcx) {
+            if let Some(def) = ty::WithOptConstParam::try_lookup(def_id, tcx) {
                 tcx.promoted_mir_of_const_arg(def)
             } else {
                 promoted_mir(tcx, ty::WithOptConstParam::unknown(def_id))
@@ -485,7 +485,7 @@ fn run_optimization_passes<'tcx>(
 
 fn optimized_mir<'tcx>(tcx: TyCtxt<'tcx>, did: DefId) -> &'tcx Body<'tcx> {
     let did = did.expect_local();
-    if let Some(def) = ty::WithOptConstParam::try_fetch(did, tcx) {
+    if let Some(def) = ty::WithOptConstParam::try_lookup(did, tcx) {
         tcx.optimized_mir_of_const_arg(def)
     } else {
         tcx.arena.alloc(inner_optimized_mir(tcx, ty::WithOptConstParam::unknown(did)))
diff --git a/src/librustc_mir_build/build/mod.rs b/src/librustc_mir_build/build/mod.rs
index 120617160da..1e677f3d2ab 100644
--- a/src/librustc_mir_build/build/mod.rs
+++ b/src/librustc_mir_build/build/mod.rs
@@ -21,7 +21,10 @@ use rustc_target::spec::PanicStrategy;
 
 use super::lints;
 
-crate fn mir_built<'tcx>(tcx: TyCtxt<'tcx>, def: ty::WithOptConstParam<LocalDefId>) -> &'tcx ty::steal::Steal<Body<'tcx>> {
+crate fn mir_built<'tcx>(
+    tcx: TyCtxt<'tcx>,
+    def: ty::WithOptConstParam<LocalDefId>,
+) -> &'tcx ty::steal::Steal<Body<'tcx>> {
     if let Some(def) = def.try_upgrade(tcx) {
         return tcx.mir_built(def);
     }