rust/compiler
Michael Goulet 4ec548afbe
Rollup merge of #118161 - compiler-errors:coroutine-obligation-opaques, r=lcnr
Allow defining opaques in `check_coroutine_obligations`

In the new trait solver, when an obligation stalls on an unresolved coroutine witness, we will stash away the *root* obligation, even if the stalled obligation is only a distant descendent of the root obligation, since the new solver is purely recursive.

This means that we may need to reprocess alias-relate obligations (and others) which may define opaque types in the new solver. Currently, we use the coroutine's def id as the defining anchor in `check_coroutine_obligations`, which will allow defining no opaque types, resulting in errors like:

```
error[E0271]: type mismatch resolving `{coroutine@<source>:6:5: 6:17} <: impl Clone`
 --> <source>:6:5
  |
6 | /     move |_: ()| {
7 | |         let () = yield ();
8 | |     }
  | |_____^ types differ
```

So this PR fixes the defining anchor and does the same trick as `check_opaque_well_formed`, where we manually compare opaques that were defined against their hidden types to make sure they weren't defined differently when processing these stalled coroutine obligations.

r? `@lcnr` cc `@cjgillot`
2023-11-22 09:28:52 -08:00
..
rustc Clean up rustc_*/Cargo.toml. 2023-10-30 08:46:02 +11:00
rustc_abi Fix clippy::needless_borrow in the compiler 2023-11-21 20:13:40 +01:00
rustc_arena Bump cfg(bootstrap)s 2023-11-15 19:41:28 -05:00
rustc_ast Replace no_ord_impl with orderable. 2023-11-22 18:38:17 +11:00
rustc_ast_lowering Fix clippy::needless_borrow in the compiler 2023-11-21 20:13:40 +01:00
rustc_ast_passes Auto merge of #117928 - nnethercote:rustc_ast_pretty, r=fee1-dead 2023-11-22 05:09:33 +00:00
rustc_ast_pretty Auto merge of #117928 - nnethercote:rustc_ast_pretty, r=fee1-dead 2023-11-22 05:09:33 +00:00
rustc_attr Fix clippy::needless_borrow in the compiler 2023-11-21 20:13:40 +01:00
rustc_baked_icu_data Bump cfg(bootstrap)s 2023-11-15 19:41:28 -05:00
rustc_borrowck Replace no_ord_impl with orderable. 2023-11-22 18:38:17 +11:00
rustc_builtin_macros Fix clippy::needless_borrow in the compiler 2023-11-21 20:13:40 +01:00
rustc_codegen_cranelift Merge commit 'def04540a4e2541b995195c752c751295606a388' into sync_cg_clif-2023-11-16 2023-11-16 21:15:07 +00:00
rustc_codegen_gcc Pass TyCtxt by value 2023-11-19 14:04:40 -05:00
rustc_codegen_llvm Rollup merge of #118142 - saethlin:llvm-linkage, r=tmiasko 2023-11-22 09:28:51 -08:00
rustc_codegen_ssa Rollup merge of #118147 - Nilstrieb:no-redundant-casts, r=WaffleLapkin 2023-11-22 09:28:51 -08:00
rustc_const_eval Rollup merge of #118147 - Nilstrieb:no-redundant-casts, r=WaffleLapkin 2023-11-22 09:28:51 -08:00
rustc_data_structures Replace no_ord_impl with orderable. 2023-11-22 18:38:17 +11:00
rustc_driver Bump cfg(bootstrap)s 2023-11-15 19:41:28 -05:00
rustc_driver_impl Merge Queries::{ongoing_codegen,linker}. 2023-11-22 13:22:49 +11:00
rustc_error_codes Bump cfg(bootstrap)s 2023-11-15 19:41:28 -05:00
rustc_error_messages Bump cfg(bootstrap)s 2023-11-15 19:41:28 -05:00
rustc_errors Fix clippy::needless_borrow in the compiler 2023-11-21 20:13:40 +01:00
rustc_expand Fix clippy::needless_borrow in the compiler 2023-11-21 20:13:40 +01:00
rustc_feature Bump cfg(bootstrap)s 2023-11-15 19:41:28 -05:00
rustc_fluent_macro Bump cfg(bootstrap)s 2023-11-15 19:41:28 -05:00
rustc_fs_util Clean up rustc_*/Cargo.toml. 2023-10-30 08:46:02 +11:00
rustc_graphviz Bump cfg(bootstrap)s 2023-11-15 19:41:28 -05:00
rustc_hir Replace no_ord_impl with orderable. 2023-11-22 18:38:17 +11:00
rustc_hir_analysis Rollup merge of #118161 - compiler-errors:coroutine-obligation-opaques, r=lcnr 2023-11-22 09:28:52 -08:00
rustc_hir_pretty Auto merge of #117928 - nnethercote:rustc_ast_pretty, r=fee1-dead 2023-11-22 05:09:33 +00:00
rustc_hir_typeck Rollup merge of #118147 - Nilstrieb:no-redundant-casts, r=WaffleLapkin 2023-11-22 09:28:51 -08:00
rustc_incremental Fix clippy::needless_borrow in the compiler 2023-11-21 20:13:40 +01:00
rustc_index Replace no_ord_impl with orderable. 2023-11-22 18:38:17 +11:00
rustc_index_macros Document newtype_index attributes. 2023-11-22 18:38:20 +11:00
rustc_infer Rollup merge of #118147 - Nilstrieb:no-redundant-casts, r=WaffleLapkin 2023-11-22 09:28:51 -08:00
rustc_interface Auto merge of #118086 - nnethercote:queries-cleanups, r=bjorn3 2023-11-22 11:44:56 +00:00
rustc_lexer Clean up rustc_*/Cargo.toml. 2023-10-30 08:46:02 +11:00
rustc_lint Auto merge of #112380 - jieyouxu:useless-bindings-lint, r=WaffleLapkin 2023-11-22 14:03:16 +00:00
rustc_lint_defs Remove --check-cfg checking of --cfg args 2023-11-18 12:21:58 +01:00
rustc_llvm Tighten up linkage settings for LLVM bindings 2023-11-21 13:43:11 -05:00
rustc_log rustc_log: provide a way to init logging based on the values, not names, of the env vars 2023-11-11 15:24:33 +01:00
rustc_macros Unify HashStable implementations 2023-11-21 05:49:45 +00:00
rustc_metadata Rollup merge of #118147 - Nilstrieb:no-redundant-casts, r=WaffleLapkin 2023-11-22 09:28:51 -08:00
rustc_middle Rollup merge of #118161 - compiler-errors:coroutine-obligation-opaques, r=lcnr 2023-11-22 09:28:52 -08:00
rustc_mir_build Replace no_ord_impl with orderable. 2023-11-22 18:38:17 +11:00
rustc_mir_dataflow Replace no_ord_impl with orderable. 2023-11-22 18:38:17 +11:00
rustc_mir_transform Replace no_ord_impl with orderable. 2023-11-22 18:38:17 +11:00
rustc_monomorphize Fix clippy::needless_borrow in the compiler 2023-11-21 20:13:40 +01:00
rustc_parse Fix clippy::needless_borrow in the compiler 2023-11-21 20:13:40 +01:00
rustc_parse_format Auto merge of #117819 - fmease:rustc_parse_format-stable-rustc, r=Nilstrieb 2023-11-15 14:55:35 +00:00
rustc_passes Replace custom_encodable with encodable. 2023-11-22 18:37:14 +11:00
rustc_privacy Fix clippy::needless_borrow in the compiler 2023-11-21 20:13:40 +01:00
rustc_query_impl Fix clippy::needless_borrow in the compiler 2023-11-21 20:13:40 +01:00
rustc_query_system Replace custom_encodable with encodable. 2023-11-22 18:37:14 +11:00
rustc_resolve Fix clippy::needless_borrow in the compiler 2023-11-21 20:13:40 +01:00
rustc_serialize Bump cfg(bootstrap)s 2023-11-15 19:41:28 -05:00
rustc_session Rollup merge of #118013 - sivadeilra:user/ardavis/ehcont, r=wesleywiser 2023-11-22 09:28:50 -08:00
rustc_smir Add support to get virtual table allocation 2023-11-21 19:16:58 -08:00
rustc_span Replace no_ord_impl with orderable. 2023-11-22 18:38:17 +11:00
rustc_symbol_mangling Rollup merge of #118147 - Nilstrieb:no-redundant-casts, r=WaffleLapkin 2023-11-22 09:28:51 -08:00
rustc_target Replace no_ord_impl with orderable. 2023-11-22 18:38:17 +11:00
rustc_trait_selection Replace no_ord_impl with orderable. 2023-11-22 18:38:17 +11:00
rustc_traits Fix clippy::needless_borrow in the compiler 2023-11-21 20:13:40 +01:00
rustc_transmute Update itertools to 0.11. 2023-11-22 08:13:21 +11:00
rustc_ty_utils Auto merge of #117928 - nnethercote:rustc_ast_pretty, r=fee1-dead 2023-11-22 05:09:33 +00:00
rustc_type_ir Replace no_ord_impl with orderable. 2023-11-22 18:38:17 +11:00
stable_mir Add allocation test and a bit more documentation 2023-11-21 19:16:58 -08:00