diff options
| author | Michael Goulet <michael@errs.io> | 2025-03-30 03:40:14 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2025-04-09 20:26:58 +0000 |
| commit | 830aeb610289924b5910f409f6751fcf4e497f1e (patch) | |
| tree | 6f159ee38305150b708ef9c7794aa2d08423d739 /compiler/rustc_trait_selection/src | |
| parent | ccdfd310be12f0c46be8b3266b3ff4e2ce5b3806 (diff) | |
| download | rust-830aeb610289924b5910f409f6751fcf4e497f1e.tar.gz rust-830aeb610289924b5910f409f6751fcf4e497f1e.zip | |
Use a query rather than recomputing the tail repeatedly
Diffstat (limited to 'compiler/rustc_trait_selection/src')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/project.rs | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/project.rs b/compiler/rustc_trait_selection/src/traits/project.rs index 8c5f1809a49..83591219b14 100644 --- a/compiler/rustc_trait_selection/src/traits/project.rs +++ b/compiler/rustc_trait_selection/src/traits/project.rs @@ -2007,21 +2007,7 @@ fn confirm_impl_candidate<'cx, 'tcx>( "confirm_impl_candidate: no associated type {:?} for {:?}", assoc_ty.item.name, obligation.predicate ); - let tail = selcx.tcx().struct_tail_raw( - tcx.type_of(impl_def_id).instantiate(tcx, args), - |ty| { - normalize_with_depth_to( - selcx, - obligation.param_env, - obligation.cause.clone(), - obligation.recursion_depth + 1, - ty, - &mut nested, - ) - }, - || {}, - ); - if tail.is_guaranteed_unsized_raw() { + if tcx.impl_self_is_guaranteed_unsized(impl_def_id) { // We treat this projection as rigid here, which is represented via // `Projected::NoProgress`. This will ensure that the projection is // checked for well-formedness, and it's either satisfied by a trivial |
