Skip to content

Commit

Permalink
Auto merge of #121679 - lcnr:opaque-wf-check-2, r=oli-obk
Browse files Browse the repository at this point in the history
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 rust-lang/rust#114728
Fixes rust-lang/rust#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`
  • Loading branch information
bors committed Mar 6, 2024
2 parents a63c350 + 9509357 commit adae314
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit adae314

Please sign in to comment.