1
Fork 0

Auto merge of #118689 - compiler-errors:const-drop, r=fee1-dead

Fix const drop checking

Fixes confirmation of `~const Destruct` and const drops.

r? fee1-dead
This commit is contained in:
bors 2023-12-08 13:43:12 +00:00
commit ae612bedcb
10 changed files with 57 additions and 67 deletions

View file

@ -781,9 +781,9 @@ impl<'tcx> TyCtxt<'tcx> {
}
pub fn expected_const_effect_param_for_body(self, def_id: LocalDefId) -> ty::Const<'tcx> {
// if the callee does have the param, we need to equate the param to some const
// value no matter whether the effects feature is enabled in the local crate,
// because inference will fail if we don't.
// FIXME(effects): This is suspicious and should probably not be done,
// especially now that we enforce host effects and then properly handle
// effect vars during fallback.
let mut host_always_on =
!self.features().effects || self.sess.opts.unstable_opts.unleash_the_miri_inside_of_you;