rust/tests/ui/impl-trait/issues
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
..
infinite-impl-trait-issue-38064.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
infinite-impl-trait-issue-38064.stderr Bless tests. 2023-01-27 20:10:17 +00:00
issue-21659-show-relevant-trait-impls-3.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-21659-show-relevant-trait-impls-3.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-42479.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-49376.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-52128.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-53457.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-54600.rs Split note, fix const/static impl trait error 2024-01-07 18:00:03 +00:00
issue-54600.stderr Split note, fix const/static impl trait error 2024-01-07 18:00:03 +00:00
issue-54840.rs Split note, fix const/static impl trait error 2024-01-07 18:00:03 +00:00
issue-54840.stderr Split note, fix const/static impl trait error 2024-01-07 18:00:03 +00:00
issue-54895.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-54895.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-55608-captures-empty-region.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-57464-unexpected-regions.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-57979-deeply-nested-impl-trait-in-assoc-proj.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-57979-deeply-nested-impl-trait-in-assoc-proj.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-57979-impl-trait-in-path.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-57979-impl-trait-in-path.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-57979-nested-impl-trait-in-assoc-proj.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-57979-nested-impl-trait-in-assoc-proj.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-58504.rs Split note, fix const/static impl trait error 2024-01-07 18:00:03 +00:00
issue-58504.stderr Split note, fix const/static impl trait error 2024-01-07 18:00:03 +00:00
issue-58956.rs Split note, fix const/static impl trait error 2024-01-07 18:00:03 +00:00
issue-58956.stderr Split note, fix const/static impl trait error 2024-01-07 18:00:03 +00:00
issue-62742.rs overflow errors: change source to a concrete enum 2024-02-22 17:43:57 +01:00
issue-62742.stderr overflow errors: change source to a concrete enum 2024-02-22 17:43:57 +01:00
issue-65581.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-67830.rs Avoid silencing relevant follow-up errors 2024-01-09 21:08:16 +00:00
issue-67830.stderr Avoid silencing relevant follow-up errors 2024-01-09 21:08:16 +00:00
issue-70877.rs Require TAITs to be mentioned in the signatures of functions that register hidden types for them 2023-07-07 13:13:18 +00:00
issue-70877.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-70971.rs Split note, fix const/static impl trait error 2024-01-07 18:00:03 +00:00
issue-70971.stderr Split note, fix const/static impl trait error 2024-01-07 18:00:03 +00:00
issue-74282.rs Require TAITs to be mentioned in the signatures of functions that register hidden types for them 2023-07-07 13:13:18 +00:00
issue-74282.stderr adjust how closure/generator types and rvalues are printed 2023-09-21 22:20:58 +02:00
issue-77987.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-78722-2.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-78722-2.stderr Bless tests 2024-01-13 12:46:58 -05:00
issue-78722.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-78722.stderr Bless tests 2024-01-13 12:46:58 -05:00
issue-79099.rs Split note, fix const/static impl trait error 2024-01-07 18:00:03 +00:00
issue-79099.stderr Split note, fix const/static impl trait error 2024-01-07 18:00:03 +00:00
issue-82139.rs Split out a separate feature gate for impl trait in associated types 2023-04-12 16:17:31 +00:00
issue-82139.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-83919.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-83919.stderr Use root obligation on E0277 for some cases 2024-03-03 18:53:35 +00:00
issue-83929-impl-trait-in-generic-default.rs Split note, fix const/static impl trait error 2024-01-07 18:00:03 +00:00
issue-83929-impl-trait-in-generic-default.stderr Split note, fix const/static impl trait error 2024-01-07 18:00:03 +00:00
issue-84073.rs change error messages to be incorrect, but more helpful 2024-02-22 18:18:33 +01:00
issue-84073.stderr change error messages to be incorrect, but more helpful 2024-02-22 18:18:33 +01:00
issue-84919.rs Split note, fix const/static impl trait error 2024-01-07 18:00:03 +00:00
issue-84919.stderr Split note, fix const/static impl trait error 2024-01-07 18:00:03 +00:00
issue-86201.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-86642.rs Split note, fix const/static impl trait error 2024-01-07 18:00:03 +00:00
issue-86642.stderr Split note, fix const/static impl trait error 2024-01-07 18:00:03 +00:00
issue-86719.rs Split out a separate feature gate for impl trait in associated types 2023-04-12 16:17:31 +00:00
issue-86719.stderr Split out a separate feature gate for impl trait in associated types 2023-04-12 16:17:31 +00:00
issue-86800.rs when defining opaques, require the hidden type to be well-formed 2024-02-27 15:57:49 +01:00
issue-86800.stderr when defining opaques, require the hidden type to be well-formed 2024-02-27 15:57:49 +01:00
issue-87295.rs Split note, fix const/static impl trait error 2024-01-07 18:00:03 +00:00
issue-87295.stderr Split note, fix const/static impl trait error 2024-01-07 18:00:03 +00:00
issue-87340.rs Split out a separate feature gate for impl trait in associated types 2023-04-12 16:17:31 +00:00
issue-87340.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-88236-2.rs Avoid silencing relevant follow-up errors 2024-01-09 21:08:16 +00:00
issue-88236-2.stderr Avoid silencing relevant follow-up errors 2024-01-09 21:08:16 +00:00
issue-88236.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-88236.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-89312.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-92305.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-92305.stderr Keep error types around, even in obligations. 2024-01-11 09:52:25 +00:00
issue-93788.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-99348-impl-compatibility.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-99348-impl-compatibility.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-104815.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-105826.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00