From 24e14dd8b40a2434fc2343342c30d8d5748d1c5a Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Sun, 5 Nov 2023 13:36:00 +0000 Subject: Only check predicates for late-bound non-lifetime vars in object candidate assembly --- .../rustc_trait_selection/src/traits/select/candidate_assembly.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'compiler/rustc_trait_selection/src') diff --git a/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs b/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs index 5c67188dd24..ba551127ce1 100644 --- a/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs +++ b/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs @@ -628,7 +628,10 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { } self.infcx.probe(|_snapshot| { - if obligation.has_non_region_late_bound() { + // FIXME(non_lifetime_binders): Really, we care only to check that we don't + // have any non-region *escaping* bound vars, but that's hard to check and + // we shouldn't really ever encounter those anyways. + if obligation.self_ty().has_non_region_late_bound() { return; } -- cgit 1.4.1-3-g733a5