Rollup merge of #119725 - compiler-errors:has_effect_param, r=fmease
Add helper for when we want to know if an item has a host param r? ````@fmease```` since you're a good reviewer and no good deed goes unpunished This helper will see far more usages as built-in traits get constified.
This commit is contained in:
commit
cd93114deb
4 changed files with 13 additions and 10 deletions
|
@ -157,9 +157,7 @@ impl Qualif for NeedsNonConstDrop {
|
|||
// FIXME(effects): If `destruct` is not a `const_trait`,
|
||||
// or effects are disabled in this crate, then give up.
|
||||
let destruct_def_id = cx.tcx.require_lang_item(LangItem::Destruct, Some(cx.body.span));
|
||||
if cx.tcx.generics_of(destruct_def_id).host_effect_index.is_none()
|
||||
|| !cx.tcx.features().effects
|
||||
{
|
||||
if !cx.tcx.has_host_param(destruct_def_id) || !cx.tcx.features().effects {
|
||||
return NeedsDrop::in_any_value_of_ty(cx, ty);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue