rust/compiler
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
..
rustc
rustc_abi only set noalias on Box with the global allocator 2024-03-05 15:03:33 +01:00
rustc_arena rename ptr::invalid -> ptr::without_provenance 2024-02-21 20:15:52 +01:00
rustc_ast Auto merge of #122045 - matthiaskrgr:rollup-5l3vpn7, r=matthiaskrgr 2024-03-06 02:18:22 +00:00
rustc_ast_ir Move visitor utils to rustc_ast_ir 2024-03-05 12:38:03 -05:00
rustc_ast_lowering Rollup merge of #121664 - compiler-errors:adjust-error-yield-lowering, r=spastorino 2024-03-05 06:40:30 +01:00
rustc_ast_passes Move visitor utils to rustc_ast_ir 2024-03-05 12:38:03 -05:00
rustc_ast_pretty Rollup merge of #121815 - nnethercote:mv-gather_comments, r=est31 2024-03-02 10:09:36 +01:00
rustc_attr Rename BuiltinLintDiagnostics as BuiltinLintDiag. 2024-03-05 12:15:10 +11:00
rustc_baked_icu_data
rustc_borrowck Return a struct from query intrinsic to be able to add another field in the next commit 2024-03-04 16:13:50 +00:00
rustc_builtin_macros Move visitor utils to rustc_ast_ir 2024-03-05 12:38:03 -05:00
rustc_codegen_cranelift only set noalias on Box with the global allocator 2024-03-05 15:03:33 +01:00
rustc_codegen_gcc only set noalias on Box with the global allocator 2024-03-05 15:03:33 +01:00
rustc_codegen_llvm only set noalias on Box with the global allocator 2024-03-05 15:03:33 +01:00
rustc_codegen_ssa Rollup merge of #122028 - oli-obk:drop_in_place_leftovers, r=compiler-errors 2024-03-05 22:10:03 +01:00
rustc_const_eval Auto merge of #122045 - matthiaskrgr:rollup-5l3vpn7, r=matthiaskrgr 2024-03-06 02:18:22 +00:00
rustc_data_structures Rollup merge of #120976 - matthiaskrgr:constify_TL_statics, r=lcnr 2024-03-04 22:16:30 +01:00
rustc_driver
rustc_driver_impl Rollup merge of #121658 - jieyouxu:ice-outdated-nightly, r=oli-obk 2024-03-05 19:53:20 +01:00
rustc_error_codes Rollup merge of #120684 - carschandler:patch-1, r=nnethercote 2024-03-02 10:09:35 +01:00
rustc_error_messages Rename SubdiagnosticMessage as SubdiagMessage. 2024-03-05 12:14:49 +11:00
rustc_errors errors: share SilentEmitter between rustc and rustfmt 2024-03-05 10:14:36 +00:00
rustc_expand Auto merge of #122045 - matthiaskrgr:rollup-5l3vpn7, r=matthiaskrgr 2024-03-06 02:18:22 +00:00
rustc_feature Rollup merge of #122014 - surechen:change_attributes_to_local_20240304, r=lcnr 2024-03-05 22:10:01 +01:00
rustc_fluent_macro Rename SubdiagnosticMessage as SubdiagMessage. 2024-03-05 12:14:49 +11:00
rustc_fs_util Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
rustc_graphviz Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
rustc_hir Auto merge of #122045 - matthiaskrgr:rollup-5l3vpn7, r=matthiaskrgr 2024-03-06 02:18:22 +00:00
rustc_hir_analysis Auto merge of #121679 - lcnr:opaque-wf-check-2, r=oli-obk 2024-03-06 10:04:26 +00:00
rustc_hir_pretty Lower anonymous structs or unions to HIR 2024-02-12 12:47:23 +08:00
rustc_hir_typeck Auto merge of #122045 - matthiaskrgr:rollup-5l3vpn7, r=matthiaskrgr 2024-03-06 02:18:22 +00:00
rustc_incremental Rename all ParseSess variables/fields/lifetimes as psess. 2024-03-05 08:11:45 +11:00
rustc_index Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
rustc_index_macros Step all bootstrap cfgs forward 2024-02-08 07:44:34 -05:00
rustc_infer Auto merge of #121679 - lcnr:opaque-wf-check-2, r=oli-obk 2024-03-06 10:04:26 +00:00
rustc_interface errors: share SilentEmitter between rustc and rustfmt 2024-03-05 10:14:36 +00:00
rustc_lexer Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
rustc_lint Auto merge of #122041 - matthiaskrgr:rollup-imsmdke, r=matthiaskrgr 2024-03-06 00:03:50 +00:00
rustc_lint_defs Rename BuiltinLintDiagnostics as BuiltinLintDiag. 2024-03-05 12:15:10 +11:00
rustc_llvm Add initial support for DataFlowSanitizer 2024-03-01 18:50:40 -08:00
rustc_log rustc_log: expose tracing-tree "wraparound" in an env var 2024-03-03 12:33:26 +01:00
rustc_macros Convert TypeVisitor and DefIdVisitor to use VisitorResult 2024-03-05 13:28:15 -05:00
rustc_metadata Auto merge of #119455 - Mark-Simulacrum:relative-spans, r=cjgillot 2024-03-06 05:57:56 +00:00
rustc_middle Auto merge of #122045 - matthiaskrgr:rollup-5l3vpn7, r=matthiaskrgr 2024-03-06 02:18:22 +00:00
rustc_mir_build Rename SubdiagnosticMessageOp as SubdiagMessageOp. 2024-03-05 12:14:49 +11:00
rustc_mir_dataflow Return a struct from query intrinsic to be able to add another field in the next commit 2024-03-04 16:13:50 +00:00
rustc_mir_transform Auto merge of #121780 - nnethercote:diag-renaming2, r=davidtwco 2024-03-05 02:58:34 +00:00
rustc_monomorphize Convert TypeVisitor and DefIdVisitor to use VisitorResult 2024-03-05 13:28:15 -05:00
rustc_next_trait_solver Allow a way to add constructors for rustc_type_ir types 2024-03-04 15:39:59 +00:00
rustc_parse Rename BuiltinLintDiagnostics as BuiltinLintDiag. 2024-03-05 12:15:10 +11:00
rustc_parse_format remove a couple of redundant clones 2024-02-17 12:46:18 +01:00
rustc_passes Rename SubdiagnosticMessageOp as SubdiagMessageOp. 2024-03-05 12:14:49 +11:00
rustc_pattern_analysis Rollup merge of #121987 - Nadrieril:abort-on-arity-mismatch, r=compiler-errors 2024-03-05 06:40:33 +01:00
rustc_privacy Convert SpannedTypeVisitor to use VisitorResult 2024-03-05 13:30:46 -05:00
rustc_query_impl Avoid using unnecessary queries when printing the query stack in panics 2024-03-04 20:43:58 +01:00
rustc_query_system Don't panic when waiting on poisoned queries 2024-03-02 19:51:56 +01:00
rustc_resolve Auto merge of #122041 - matthiaskrgr:rollup-imsmdke, r=matthiaskrgr 2024-03-06 00:03:50 +00:00
rustc_serialize Replace NonZero::<_>::new with NonZero::new. 2024-02-15 08:09:42 +01:00
rustc_session Rollup merge of #121301 - davidtwco:rustfmt-silent-emitter, r=pnkfelix 2024-03-05 19:53:18 +01:00
rustc_smir Add support to new float types 2024-03-01 11:16:35 -08:00
rustc_span only set noalias on Box with the global allocator 2024-03-05 15:03:33 +01:00
rustc_symbol_mangling Rollup merge of #121841 - tgross35:f16-f128-step2-intrinsics, r=compiler-errors 2024-03-02 20:13:24 +01:00
rustc_target Add a description field to target definitions 2024-03-05 15:42:10 +00:00
rustc_trait_selection Auto merge of #122045 - matthiaskrgr:rollup-5l3vpn7, r=matthiaskrgr 2024-03-06 02:18:22 +00:00
rustc_traits Rename some normalization-related items 2024-02-20 17:30:49 +01:00
rustc_transmute Convert TypeVisitor and DefIdVisitor to use VisitorResult 2024-03-05 13:28:15 -05:00
rustc_ty_utils Auto merge of #121679 - lcnr:opaque-wf-check-2, r=oli-obk 2024-03-06 10:04:26 +00:00
rustc_type_ir Convert TypeVisitor and DefIdVisitor to use VisitorResult 2024-03-05 13:28:15 -05:00
stable_mir Add support to new float types 2024-03-01 11:16:35 -08:00