From 71080cfb6b27c57c1f675763b18b5d759ab13d19 Mon Sep 17 00:00:00 2001 From: Shoyu Vanilla Date: Thu, 22 Aug 2024 00:32:44 +0900 Subject: [PATCH] fix: Wrong `Sized` predicate for `generic_predicates_for_param` --- crates/hir-ty/src/lower.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/hir-ty/src/lower.rs b/crates/hir-ty/src/lower.rs index 5824c59c5a..58c34cbd9e 100644 --- a/crates/hir-ty/src/lower.rs +++ b/crates/hir-ty/src/lower.rs @@ -1551,6 +1551,10 @@ pub(crate) fn generic_predicates_for_param_query( } }; if invalid_target { + // If this is filtered out without lowering, `?Sized` is not gathered into `ctx.unsized_types` + if let TypeBound::Path(_, TraitBoundModifier::Maybe) = &**bound { + ctx.lower_where_predicate(pred, &def, true).for_each(drop); + } return false; }