rust/compiler/rustc_middle/src
Matthias Krüger bace7f986c
Rollup merge of #141703 - compiler-errors:deref-place, r=lcnr
Structurally normalize types as needed in `projection_ty_core`

Introduce a `structurally_normalize` callback to `projection_ty_core`, and then use it before we match on the ty kind in `projection_ty_core`.

Previously we were only structurally normalizing the return type of the `handle_field` struct, but if we were to (e.g.) apply a deref projection to that type, then the resulting type is not guaranteed to be structurally normalized and any subsequent projections applied would ICE.

Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/221

I'll leave a few comments inline to explain the changes.

r? lcnr

---

Also fixes rust-lang/rust#141708
2025-05-30 13:39:52 +02:00
..
dep_graph Reformat parameters to macros used by with-all-queries 2025-04-29 20:48:51 +10:00
hir Rollup merge of #141551 - compiler-errors:hir-lints, r=BoxyUwU 2025-05-27 20:28:32 -04:00
hooks Pretty print pattern type values with transmute if they don't satisfy their pattern 2025-02-05 14:56:41 +00:00
infer yeet CanonicalVarInfo 2025-05-23 12:10:53 +00:00
middle Cleanup CodegenFnAttrFlags 2025-05-24 20:31:37 +02:00
mir Structurally normalize types as needed in projection_ty_core 2025-05-29 11:16:44 +00:00
query Refactor the two-phase check for impls and impl items 2025-05-27 22:03:21 +08:00
thir Add {ast,hir,thir}::PatKind::Missing variants. 2025-03-28 09:18:57 +11:00
traits Remove weak alias terminology 2025-04-24 11:59:20 +01:00
ty Rollup merge of #141507 - RalfJung:atomic-intrinsics, r=bjorn3 2025-05-30 07:01:30 +02:00
util Remove attribute #[rustc_error] 2025-03-30 01:32:21 +03:00
arena.rs Initial support for dynamically linked crates 2025-05-04 22:03:15 +03:00
error.rs Teach structured errors to display short Ty 2025-02-25 16:56:03 +00:00
lib.rs update cfg(bootstrap) 2025-05-12 15:33:37 +02:00
lint.rs Remove LintExpectationId from Level variants 2025-04-03 09:22:21 +00:00
macros.rs Fold visit into ty 2025-03-15 06:34:36 +00:00
metadata.rs Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
tests.rs Give an item related to issue 27438 a more meaningful name 2024-04-30 22:27:19 +02:00
thir.rs Add useful comments on ExprKind::If variants. 2025-05-02 15:53:39 +10:00
values.rs Use search_for_cycle_permutation to look for variances_of 2025-04-27 09:38:18 +02:00