diff options
| author | bors <bors@rust-lang.org> | 2024-02-18 03:58:56 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-02-18 03:58:56 +0000 |
| commit | d3df8ff85121146f2ac5e863e0c9eaba4bf35d32 (patch) | |
| tree | 1093deb2936e81e75ec907c00b8021463cb4286f /compiler/rustc_hir_analysis/src/collect | |
| parent | 1f8e824f111c972c9df8dbb378d87c33f67bbad4 (diff) | |
| parent | fde4556785ac5e07302a48fcea7ead71e711d5f4 (diff) | |
| download | rust-d3df8ff85121146f2ac5e863e0c9eaba4bf35d32.tar.gz rust-d3df8ff85121146f2ac5e863e0c9eaba4bf35d32.zip | |
Auto merge of #120780 - fmease:lta-in-impls, r=oli-obk
Properly deal with weak alias types as self types of impls Fixes #114216. Fixes #116100. Not super happy about the two ad hoc “normalization” implementations for weak alias types: 1. In `inherent_impls`: The “peeling”, normalization to [“WHNF”][whnf]: Semantically that's exactly what we want (neither proper normalization nor shallow normalization would be correct here). Basically a weak alias type is “nominal” (well...^^) if the WHNF is nominal. [#97974](https://github.com/rust-lang/rust/pull/97974) followed the same approach. 2. In `constrained_generic_params`: Generic parameters are constrained by a weak alias type if the corresp. “normalized” type constrains them (where we only normalize *weak* alias types not arbitrary ones). Weak alias types are injective if the corresp. “normalized” type is injective. Both have ad hoc overflow detection mechanisms. **Coherence** is handled in #117164. r? `@oli-obk` or types [whnf]: https://en.wikipedia.org/wiki/Lambda_calculus_definition#Weak_head_normal_form
Diffstat (limited to 'compiler/rustc_hir_analysis/src/collect')
| -rw-r--r-- | compiler/rustc_hir_analysis/src/collect/predicates_of.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_hir_analysis/src/collect/predicates_of.rs b/compiler/rustc_hir_analysis/src/collect/predicates_of.rs index 05755f98f20..351ac2eb770 100644 --- a/compiler/rustc_hir_analysis/src/collect/predicates_of.rs +++ b/compiler/rustc_hir_analysis/src/collect/predicates_of.rs @@ -307,7 +307,7 @@ fn gather_explicit_predicates_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::Gen tcx, &mut predicates, trait_ref, - &mut cgp::parameters_for_impl(self_ty, trait_ref), + &mut cgp::parameters_for_impl(tcx, self_ty, trait_ref), ); } |
