@@ -11,7 +11,7 @@ use rustc_middle::middle::codegen_fn_attrs::{CodegenFnAttrFlags, CodegenFnAttrs}
11
11
use rustc_middle:: mir:: visit:: * ;
12
12
use rustc_middle:: mir:: * ;
13
13
use rustc_middle:: ty:: TypeVisitableExt ;
14
- use rustc_middle:: ty:: { self , Instance , InstanceKind , ParamEnv , Ty , TyCtxt } ;
14
+ use rustc_middle:: ty:: { self , Instance , InstanceKind , ParamEnv , Ty , TyCtxt , TypeFlags } ;
15
15
use rustc_session:: config:: { DebugInfo , OptLevel } ;
16
16
use rustc_span:: source_map:: Spanned ;
17
17
use rustc_span:: sym;
@@ -306,6 +306,16 @@ impl<'tcx> Inliner<'tcx> {
306
306
InstanceKind :: Intrinsic ( _) | InstanceKind :: Virtual ( ..) => {
307
307
return Err ( "instance without MIR (intrinsic / virtual)" ) ;
308
308
}
309
+
310
+ // FIXME(#127030): `ConstParamHasTy` has bad interactions with
311
+ // the drop shim builder, which does not evaluate predicates in
312
+ // the correct param-env for types being dropped. Stall resolving
313
+ // the MIR for this instance until all of its const params are
314
+ // substituted.
315
+ InstanceKind :: DropGlue ( _, Some ( ty) ) if ty. has_type_flags ( TypeFlags :: HAS_CT_PARAM ) => {
316
+ return Err ( "still needs substitution" ) ;
317
+ }
318
+
309
319
// This cannot result in an immediate cycle since the callee MIR is a shim, which does
310
320
// not get any optimizations run on it. Any subsequent inlining may cause cycles, but we
311
321
// do not need to catch this here, we can wait until the inliner decides to continue
0 commit comments