File tree 3 files changed +5
-5
lines changed
3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -1634,7 +1634,7 @@ impl WithOptConstParam<LocalDefId> {
1634
1634
/// In case `self` is unknown but `self.did` is a const argument, this returns
1635
1635
/// a `WithOptConstParam` with the correct `const_param_did`.
1636
1636
#[ inline( always) ]
1637
- pub fn try_update ( self , tcx : TyCtxt < ' _ > ) -> Option < WithOptConstParam < LocalDefId > > {
1637
+ pub fn try_upgrade ( self , tcx : TyCtxt < ' _ > ) -> Option < WithOptConstParam < LocalDefId > > {
1638
1638
if self . const_param_did . is_none ( ) {
1639
1639
if let const_param_did @ Some ( _) = tcx. opt_const_param_of ( self . did ) {
1640
1640
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>(
270
270
tcx : TyCtxt < ' tcx > ,
271
271
def : ty:: WithOptConstParam < LocalDefId > ,
272
272
) -> & ' tcx Steal < Body < ' tcx > > {
273
- if let Some ( def) = ty :: WithOptConstParam :: try_update ( def, tcx) {
273
+ if let Some ( def) = def. try_upgrade ( tcx) {
274
274
return tcx. mir_const ( def) ;
275
275
}
276
276
@@ -314,7 +314,7 @@ fn mir_validated(
314
314
tcx : TyCtxt < ' tcx > ,
315
315
def : ty:: WithOptConstParam < LocalDefId > ,
316
316
) -> ( & ' 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) {
318
318
return tcx. mir_validated ( def) ;
319
319
}
320
320
@@ -357,7 +357,7 @@ fn mir_drops_elaborated_and_const_checked<'tcx>(
357
357
tcx : TyCtxt < ' tcx > ,
358
358
def : ty:: WithOptConstParam < LocalDefId > ,
359
359
) -> & ' tcx Steal < Body < ' tcx > > {
360
- if let Some ( def) = ty :: WithOptConstParam :: try_update ( def, tcx) {
360
+ if let Some ( def) = def. try_upgrade ( tcx) {
361
361
return tcx. mir_drops_elaborated_and_const_checked ( def) ;
362
362
}
363
363
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ use rustc_target::spec::PanicStrategy;
22
22
use super :: lints;
23
23
24
24
crate 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) {
26
26
return tcx. mir_built ( def) ;
27
27
}
28
28
You can’t perform that action at this time.
0 commit comments