File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -1634,7 +1634,7 @@ impl WithOptConstParam<LocalDefId> {
16341634 /// In case `self` is unknown but `self.did` is a const argument, this returns
16351635 /// a `WithOptConstParam` with the correct `const_param_did`.
16361636 #[ inline( always) ]
1637- pub fn try_update ( self , tcx : TyCtxt < ' _ > ) -> Option < WithOptConstParam < LocalDefId > > {
1637+ pub fn try_upgrade ( self , tcx : TyCtxt < ' _ > ) -> Option < WithOptConstParam < LocalDefId > > {
16381638 if self . const_param_did . is_none ( ) {
16391639 if let const_param_did @ Some ( _) = tcx. opt_const_param_of ( self . did ) {
16401640 return Some ( WithOptConstParam { did : self . did , const_param_did } ) ;
Original file line number Diff line number Diff line change @@ -270,7 +270,7 @@ fn mir_const<'tcx>(
270270 tcx : TyCtxt < ' tcx > ,
271271 def : ty:: WithOptConstParam < LocalDefId > ,
272272) -> & ' tcx Steal < Body < ' tcx > > {
273- if let Some ( def) = ty :: WithOptConstParam :: try_update ( def, tcx) {
273+ if let Some ( def) = def. try_upgrade ( tcx) {
274274 return tcx. mir_const ( def) ;
275275 }
276276
@@ -314,7 +314,7 @@ fn mir_validated(
314314 tcx : TyCtxt < ' tcx > ,
315315 def : ty:: WithOptConstParam < LocalDefId > ,
316316) -> ( & ' tcx Steal < Body < ' tcx > > , & ' tcx Steal < IndexVec < Promoted , Body < ' tcx > > > ) {
317- if let Some ( def) = ty :: WithOptConstParam :: try_update ( def, tcx) {
317+ if let Some ( def) = def. try_upgrade ( tcx) {
318318 return tcx. mir_validated ( def) ;
319319 }
320320
@@ -357,7 +357,7 @@ fn mir_drops_elaborated_and_const_checked<'tcx>(
357357 tcx : TyCtxt < ' tcx > ,
358358 def : ty:: WithOptConstParam < LocalDefId > ,
359359) -> & ' tcx Steal < Body < ' tcx > > {
360- if let Some ( def) = ty :: WithOptConstParam :: try_update ( def, tcx) {
360+ if let Some ( def) = def. try_upgrade ( tcx) {
361361 return tcx. mir_drops_elaborated_and_const_checked ( def) ;
362362 }
363363
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ use rustc_target::spec::PanicStrategy;
2222use super :: lints;
2323
2424crate fn mir_built < ' tcx > ( tcx : TyCtxt < ' tcx > , def : ty:: WithOptConstParam < LocalDefId > ) -> & ' tcx ty:: steal:: Steal < Body < ' tcx > > {
25- if let Some ( def) = ty :: WithOptConstParam :: try_update ( def, tcx) {
25+ if let Some ( def) = def. try_upgrade ( tcx) {
2626 return tcx. mir_built ( def) ;
2727 }
2828
You can’t perform that action at this time.
0 commit comments