#69036 papers over a problem in the use of MIR shim bodies, (i.e. applying Instance's substs), by preventing Instance::resolve from succeeding if any substitution could later occur.
A MIR shim's body already encapsulates the final types (i.e. monomorphic for codegen, modulo "polymorphization" work), so we shouldn't substitute it any further (in codegen, miri, or MIR inlining).
Once we address this, we could inline (or codegen, given "polymorphization") slightly polymorphic variants of these shims, but Instance::resolve would still need to enforce the minimum requirements for the shim MIR body being built in the first place, i.e.:
Instance::resolve(drop_in_place::<T>) should return None
Instance::resolve(drop_in_place::<Vec<T>>) could succeed
cc @nikomatsakis @davidtwco
#69036 papers over a problem in the use of MIR shim bodies, (i.e. applying
Instance'ssubsts), by preventingInstance::resolvefrom succeeding if any substitution could later occur.A MIR shim's body already encapsulates the final types (i.e. monomorphic for codegen, modulo "polymorphization" work), so we shouldn't substitute it any further (in codegen, miri, or MIR inlining).
Once we address this, we could inline (or codegen, given "polymorphization") slightly polymorphic variants of these shims, but
Instance::resolvewould still need to enforce the minimum requirements for the shim MIR body being built in the first place, i.e.:Instance::resolve(drop_in_place::<T>)should returnNoneInstance::resolve(drop_in_place::<Vec<T>>)could succeedcc @nikomatsakis @davidtwco