rust/compiler/rustc_hir_analysis/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
..
astconv Rename StructuredDiagnostic as StructuredDiag. 2024-03-05 12:15:12 +11:00
check Auto merge of #121679 - lcnr:opaque-wf-check-2, r=oli-obk 2024-03-06 10:04:26 +00:00
coherence Auto merge of #120393 - Urgau:rfc3373-non-local-defs, r=WaffleLapkin 2024-02-25 19:11:06 +00:00
collect Auto merge of #122041 - matthiaskrgr:rollup-imsmdke, r=matthiaskrgr 2024-03-06 00:03:50 +00:00
impl_wf_check Use expand_weak_alias_tys when collecting constrained generics params in impls 2024-02-20 17:31:59 +01:00
outlives Auto merge of #120931 - chenyukang:yukang-cleanup-hashmap, r=michaelwoerister 2024-02-15 12:36:37 +00:00
structured_errors Rename StructuredDiagnostic as StructuredDiag. 2024-03-05 12:15:12 +11:00
variance Convert TypeVisitor and DefIdVisitor to use VisitorResult 2024-03-05 13:28:15 -05:00
autoderef.rs fix ICE for deref coercions with type errors 2024-02-12 14:37:35 +01:00
bounds.rs ~const trait or projection bounds do not imply non-const bounds 2024-01-08 15:01:14 +00:00
check_unused.rs Rename TyCtxt::struct_span_lint_hir as TyCtxt::node_span_lint. 2024-01-23 08:09:01 +11:00
collect.rs hir_analysis: enums return None in find_field 2024-03-04 11:38:16 +00:00
constrained_generic_params.rs Convert TypeVisitor and DefIdVisitor to use VisitorResult 2024-03-05 13:28:15 -05:00
errors.rs Remove unused diagnostic struct 2024-02-29 14:14:21 +08:00
hir_wf_check.rs Remove Session methods that duplicate DiagCtxt methods. 2023-12-24 08:05:28 +11:00
impl_wf_check.rs Use expand_weak_alias_tys when collecting constrained generics params in impls 2024-02-20 17:31:59 +01:00
lib.rs Always evaluate free constants and statics, even if previous errors occurred 2024-02-19 22:11:13 +00:00
structured_errors.rs Rename StructuredDiagnostic as StructuredDiag. 2024-03-05 12:15:12 +11:00