rust/compiler/rustc_ty_utils/src
bors 09bc67b915 Auto merge of #121679 - lcnr:opaque-wf-check-2, r=oli-obk
stricter hidden type wf-check [based on #115008]

Original work by `@aliemjay` in #115008. A huge thanks to them for originally figuring out this approach ❤️

Fixes https://github.com/rust-lang/rust/issues/114728
Fixes https://github.com/rust-lang/rust/issues/114572

Instead of adding the `WellFormed` obligations when relating opaque types, we now always emit such an obligation when defining the hidden type.

This causes nested opaque types which aren't wf to error, see the comment below for the described impact. I believe this change to be desirable as it significantly reduces complexity by removing special-cases.

It also caused an issue with RPITIT: in defaulted trait methods, we add a `Projection(synthetic_assoc, rpit_of_trait_method)` clause to the `param_env`. This clause is not added to the `ParamEnv` of the nested coroutines. This caused a normalization failure in `fn check_coroutine_obligations` with the new solver. I fixed that by using the env of the typeck root instead.

r? `@oli-obk`
2024-03-06 10:04:26 +00:00
..
abi.rs only set noalias on Box with the global allocator 2024-03-05 15:03:33 +01:00
assoc.rs Move some methods from tcx.hir() to tcx 2023-12-12 06:40:29 -08:00
common_traits.rs Move expansion of query macros in rustc_middle to rustc_middle::query 2023-05-15 08:49:13 +02:00
consts.rs Rollup merge of #119307 - compiler-errors:pat-lifetimes, r=Nadrieril 2023-12-26 13:29:14 -05:00
errors.rs Stop using String for error codes. 2024-01-29 07:41:41 +11:00
implied_bounds.rs wf-check RPITs 2024-02-27 15:00:22 +01:00
instance.rs make intrinsic query legal for any DefId 2024-03-04 16:28:33 +00:00
layout.rs Add f16 and f128 to rustc_type_ir::FloatTy and rustc_abi::Primitive 2024-02-28 12:58:32 -05:00
layout_sanity_check.rs fix failure to detect a too-big-type after adding padding 2023-10-27 18:07:53 +02:00
lib.rs Rollup merge of #120693 - nnethercote:invert-diagnostic-lints, r=davidtwco 2024-02-09 14:41:50 +01:00
needs_drop.rs Dejargnonize subst 2024-02-12 15:46:35 +09:00
opaque_types.rs Auto merge of #122041 - matthiaskrgr:rollup-imsmdke, r=matthiaskrgr 2024-03-06 00:03:50 +00:00
representability.rs Rollup merge of #120958 - ShoyuVanilla:remove-subst, r=oli-obk 2024-02-12 23:18:54 +01:00
sig_types.rs Convert SpannedTypeVisitor to use VisitorResult 2024-03-05 13:30:46 -05:00
structural_match.rs remove StructuralEq trait 2024-01-24 07:56:23 +01:00
ty.rs Convert TypeVisitor and DefIdVisitor to use VisitorResult 2024-03-05 13:28:15 -05:00