about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/transform
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-01-09 00:19:36 +0100
committerGitHub <noreply@github.com>2024-01-09 00:19:36 +0100
commitcd93114debd864b5100a71f3f67fa13e943c8d8e (patch)
tree46992067f7b02cf1885eef88cadbf2f6f927cc1b /compiler/rustc_const_eval/src/transform
parent5efa69d979445dd5c96adbb8981508afd3be2aa1 (diff)
parente651f6f029c138004583028df3961e1b24636a07 (diff)
downloadrust-cd93114debd864b5100a71f3f67fa13e943c8d8e.tar.gz
rust-cd93114debd864b5100a71f3f67fa13e943c8d8e.zip
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.
Diffstat (limited to 'compiler/rustc_const_eval/src/transform')
-rw-r--r--compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs b/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs
index 7e1cbfe6667..1efa52df581 100644
--- a/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs
+++ b/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs
@@ -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);
         }