]> git.lizzy.rs Git - rust.git/commitdiff
`try_update` -> `try_upgrade`
authorBastian Kauschke <bastian_kauschke@hotmail.de>
Fri, 17 Jul 2020 17:12:30 +0000 (19:12 +0200)
committerBastian Kauschke <bastian_kauschke@hotmail.de>
Tue, 21 Jul 2020 21:06:00 +0000 (23:06 +0200)
src/librustc_middle/ty/mod.rs
src/librustc_mir/transform/mod.rs
src/librustc_mir_build/build/mod.rs

index 1f95c1b7ecf98ab35927c8ac6cf827c3d8b5563b..947f7444753cc2c58bcdea5b65309eb3bf800544 100644 (file)
@@ -1634,7 +1634,7 @@ pub fn try_fetch(did: LocalDefId, tcx: TyCtxt<'_>) -> Option<(LocalDefId, DefId)
     /// 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 });
index eb55e5e782c7567226b6ea6b6d8c3c2d473f0d36..c79da239a40ac3dc4a8a23209bde4cc8bcdc21fe 100644 (file)
@@ -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);
     }
 
index ae188ec121f2153a2203633ff2e03c73425ba8c5..120617160daf3183cf0465cedde441ada5601fcf 100644 (file)
@@ -22,7 +22,7 @@
 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);
     }