about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBastian Kauschke <bastian_kauschke@hotmail.de>2020-07-17 19:12:30 +0200
committerBastian Kauschke <bastian_kauschke@hotmail.de>2020-07-21 23:06:00 +0200
commit38e9e62663de3ea931ed9d093e59182a31563c16 (patch)
tree8bc71522de7564e63e1dc0f2c851b436fd1ebd6f
parentebc0c15610e9956fadbda44c998414b0d7130a53 (diff)
downloadrust-38e9e62663de3ea931ed9d093e59182a31563c16.tar.gz
rust-38e9e62663de3ea931ed9d093e59182a31563c16.zip
`try_update` -> `try_upgrade`
-rw-r--r--src/librustc_middle/ty/mod.rs2
-rw-r--r--src/librustc_mir/transform/mod.rs6
-rw-r--r--src/librustc_mir_build/build/mod.rs2
3 files changed, 5 insertions, 5 deletions
diff --git a/src/librustc_middle/ty/mod.rs b/src/librustc_middle/ty/mod.rs
index 1f95c1b7ecf..947f7444753 100644
--- a/src/librustc_middle/ty/mod.rs
+++ b/src/librustc_middle/ty/mod.rs
@@ -1634,7 +1634,7 @@ impl WithOptConstParam<LocalDefId> {
     /// In case `self` is unknown but `self.did` is a const argument, this returns
     /// a `WithOptConstParam` with the correct `const_param_did`.
     #[inline(always)]
-    pub fn try_update(self, tcx: TyCtxt<'_>) -> Option<WithOptConstParam<LocalDefId>> {
+    pub fn try_upgrade(self, tcx: TyCtxt<'_>) -> Option<WithOptConstParam<LocalDefId>> {
         if self.const_param_did.is_none() {
             if let const_param_did @ Some(_) = tcx.opt_const_param_of(self.did) {
                 return Some(WithOptConstParam { did: self.did, const_param_did });
diff --git a/src/librustc_mir/transform/mod.rs b/src/librustc_mir/transform/mod.rs
index eb55e5e782c..c79da239a40 100644
--- a/src/librustc_mir/transform/mod.rs
+++ b/src/librustc_mir/transform/mod.rs
@@ -270,7 +270,7 @@ fn mir_const<'tcx>(
     tcx: TyCtxt<'tcx>,
     def: ty::WithOptConstParam<LocalDefId>,
 ) -> &'tcx Steal<Body<'tcx>> {
-    if let Some(def) = ty::WithOptConstParam::try_update(def, tcx) {
+    if let Some(def) = def.try_upgrade(tcx) {
         return tcx.mir_const(def);
     }
 
@@ -314,7 +314,7 @@ fn mir_validated(
     tcx: TyCtxt<'tcx>,
     def: ty::WithOptConstParam<LocalDefId>,
 ) -> (&'tcx Steal<Body<'tcx>>, &'tcx Steal<IndexVec<Promoted, Body<'tcx>>>) {
-    if let Some(def) = ty::WithOptConstParam::try_update(def, tcx) {
+    if let Some(def) = def.try_upgrade(tcx) {
         return tcx.mir_validated(def);
     }
 
@@ -357,7 +357,7 @@ fn mir_drops_elaborated_and_const_checked<'tcx>(
     tcx: TyCtxt<'tcx>,
     def: ty::WithOptConstParam<LocalDefId>,
 ) -> &'tcx Steal<Body<'tcx>> {
-    if let Some(def) = ty::WithOptConstParam::try_update(def, tcx) {
+    if let Some(def) = def.try_upgrade(tcx) {
         return tcx.mir_drops_elaborated_and_const_checked(def);
     }
 
diff --git a/src/librustc_mir_build/build/mod.rs b/src/librustc_mir_build/build/mod.rs
index ae188ec121f..120617160da 100644
--- a/src/librustc_mir_build/build/mod.rs
+++ b/src/librustc_mir_build/build/mod.rs
@@ -22,7 +22,7 @@ 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>> {
-    if let Some(def) = ty::WithOptConstParam::try_update(def, tcx) {
+    if let Some(def) = def.try_upgrade(tcx) {
         return tcx.mir_built(def);
     }