This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +4
-13
lines changed
compiler/rustc_middle/src Expand file tree Collapse file tree 2 files changed +4
-13
lines changed Original file line number Diff line number Diff line change @@ -438,18 +438,6 @@ impl<'tcx> TyCtxt<'tcx> {
438438 }
439439 }
440440
441- #[ inline]
442- pub fn optimized_mir_or_const_arg_mir (
443- self ,
444- def : ty:: WithOptConstParam < DefId > ,
445- ) -> & ' tcx Body < ' tcx > {
446- if let Some ( ( did, param_did) ) = def. as_const_arg ( ) {
447- self . mir_for_ctfe_of_const_arg ( ( did, param_did) )
448- } else {
449- self . optimized_mir ( def. did )
450- }
451- }
452-
453441 #[ inline]
454442 pub fn mir_for_ctfe_opt_const_arg ( self , def : ty:: WithOptConstParam < DefId > ) -> & ' tcx Body < ' tcx > {
455443 if let Some ( ( did, param_did) ) = def. as_const_arg ( ) {
Original file line number Diff line number Diff line change @@ -2963,7 +2963,10 @@ impl<'tcx> TyCtxt<'tcx> {
29632963 | DefKind :: AnonConst => self . mir_for_ctfe_opt_const_arg ( def) ,
29642964 // If the caller wants `mir_for_ctfe` of a function they should not be using
29652965 // `instance_mir`, so we'll assume const fn also wants the optimized version.
2966- _ => self . optimized_mir_or_const_arg_mir ( def) ,
2966+ _ => {
2967+ assert_eq ! ( def. const_param_did, None ) ;
2968+ self . optimized_mir ( def. did )
2969+ }
29672970 } ,
29682971 ty:: InstanceDef :: VtableShim ( ..)
29692972 | ty:: InstanceDef :: ReifyShim ( ..)
You can’t perform that action at this time.
0 commit comments