rust/compiler
Dylan DPC e63424db19
Rollup merge of #100092 - compiler-errors:issue-100075, r=oli-obk
Fall back when relating two opaques by substs in MIR typeck

This is certainly _one_ way to fix #100075. Not really confident it's the _best_ way to do it, though.

The root cause of this issue is that during MIR type-check, we end up trying to equate an opaque against the same opaque def-id but with different substs. Because of the way that we replace RPITs during (HIR) typeck with an inference variable, we don't end up emitting a type-checking error, so the delayed MIR bug causes an ICE.

See the `src/test/ui/impl-trait/issue-100075-2.rs` test below to make that clear -- in that example, we try to equate `{impl Sized} substs=[T]` and `{impl Sized} substs=[Option<T>]`, which causes an ICE. This new logic will instead cause us to infer `{impl Sized} substs=[Option<T>]` as the hidden type for `{impl Sized} substs=[T]`, which causes a proper error to be emitted later on when we check that an opaque isn't recursive.

I'm open to closing this in favor of something else. Ideally we'd fix this in typeck, but the thing we do to ensure backwards compatibility with weird RPIT cases makes that difficult. Also open to discussing this further.
2022-08-30 11:26:48 +05:30
..
rustc
rustc_apfloat
rustc_arena Make use of [wrapping_]byte_{add,sub} 2022-08-23 19:32:37 +04:00
rustc_ast Rollup merge of #100978 - nnethercote:fix-100948, r=petrochenkov 2022-08-26 09:51:46 +09:00
rustc_ast_lowering Rollup merge of #100724 - JeanCASPAR:migrate-ast_lowering-to-session-diagnostic, r=davidtwco 2022-08-26 15:56:21 -07:00
rustc_ast_passes Rollup merge of #99332 - jyn514:stabilize-label-break-value, r=petrochenkov 2022-08-25 08:50:54 +09:00
rustc_ast_pretty
rustc_attr use smaller span for suggestions 2022-08-27 15:22:08 +09:00
rustc_borrowck Rollup merge of #101146 - jackh726:borrowck-logging, r=compiler-errors 2022-08-29 21:12:59 +02:00
rustc_builtin_macros Rollup merge of #101000 - m-ou-se:count-is-star, r=nagisa 2022-08-29 16:49:45 +05:30
rustc_codegen_cranelift Rollup merge of #99027 - tmiasko:basic-blocks, r=oli-obk 2022-08-29 06:34:43 +02:00
rustc_codegen_gcc Auto merge of #96946 - WaffleLapkin:ptr_mask, r=scottmcm 2022-08-28 01:34:47 +00:00
rustc_codegen_llvm Rollup merge of #101098 - petrochenkov:noinvis, r=TaKO8Ki 2022-08-28 09:35:22 +02:00
rustc_codegen_ssa Rollup merge of #101141 - compiler-errors:get-trait-ref-is-a-misleading-name, r=oli-obk 2022-08-29 21:12:58 +02:00
rustc_const_eval Auto merge of #101167 - matthiaskrgr:rollup-yt3jdmp, r=matthiaskrgr 2022-08-29 22:49:04 +00:00
rustc_data_structures
rustc_driver Code cleaning 2022-08-25 19:04:00 +02:00
rustc_error_codes Stabilize #![feature(label_break_value)] 2022-08-23 21:14:12 -05:00
rustc_error_messages Rollup merge of #100843 - IntQuant:issue-100717-infer, r=compiler-errors 2022-08-29 06:34:45 +02:00
rustc_errors errors: IntoDiagnosticArg for io::Error/paths 2022-08-24 06:50:44 +09:00
rustc_expand Remove the symbol from ast::LitKind::Err. 2022-08-23 16:56:24 +10:00
rustc_feature Adjust label break value stabilization version to CURRENT_RUSTC_VERSION 2022-08-27 17:36:13 +02:00
rustc_fs_util
rustc_graphviz
rustc_hir Merge implementations of HIR fn_decl and fn_sig. 2022-08-26 21:38:20 +02:00
rustc_hir_pretty
rustc_incremental
rustc_index
rustc_infer Rollup merge of #100092 - compiler-errors:issue-100075, r=oli-obk 2022-08-30 11:26:48 +05:30
rustc_interface Rollup merge of #100808 - SkiFire13:migrate_diagnostics_rustc_interface, r=davidtwco 2022-08-25 08:50:58 +09:00
rustc_lexer
rustc_lint Auto merge of #101167 - matthiaskrgr:rollup-yt3jdmp, r=matthiaskrgr 2022-08-29 22:49:04 +00:00
rustc_lint_defs Rollup merge of #99784 - est31:deny_cfg_attr_crate_type_name, r=Mark-Simulacrum 2022-08-27 13:14:16 +09:00
rustc_llvm
rustc_log
rustc_macros Rollup merge of #100959 - LuisCardosoOliveira:translation-rename-attr-warning, r=davidtwco 2022-08-29 06:34:47 +02:00
rustc_metadata Rollup merge of #99821 - cjgillot:ast-lifetimes-2, r=compiler-errors 2022-08-29 16:49:39 +05:30
rustc_middle Rollup merge of #99821 - cjgillot:ast-lifetimes-2, r=compiler-errors 2022-08-29 16:49:39 +05:30
rustc_mir_build Rollup merge of #99027 - tmiasko:basic-blocks, r=oli-obk 2022-08-29 06:34:43 +02:00
rustc_mir_dataflow Rollup merge of #99027 - tmiasko:basic-blocks, r=oli-obk 2022-08-29 06:34:43 +02:00
rustc_mir_transform Rollup merge of #100239 - RalfJung:const-prop-uninit, r=oli-obk 2022-08-29 16:49:40 +05:30
rustc_monomorphize Replace Body::basic_blocks() with field access 2022-08-26 14:27:08 +02:00
rustc_parse Auto merge of #100497 - kadiwa4:remove_clone_into_iter, r=cjgillot 2022-08-28 18:31:08 +00:00
rustc_parse_format Separate CountIsStar from CountIsParam in rustc_parse_format. 2022-08-25 14:49:09 +02:00
rustc_passes Rollup merge of #99821 - cjgillot:ast-lifetimes-2, r=compiler-errors 2022-08-29 16:49:39 +05:30
rustc_plugin_impl
rustc_privacy rustc_middle: Remove Visibility::Invisible 2022-08-27 22:34:18 +03:00
rustc_query_impl Auto merge of #100946 - jyn514:query-system-3, r=cjgillot 2022-08-27 08:53:24 +00:00
rustc_query_system add depth_limit in QueryVTable 2022-08-24 09:42:12 +08:00
rustc_resolve Rollup merge of #99821 - cjgillot:ast-lifetimes-2, r=compiler-errors 2022-08-29 16:49:39 +05:30
rustc_save_analysis save_analysis: Migrate diagnostics 2022-08-24 06:50:16 +09:00
rustc_serialize Adding support for rustc_serialize encode and decode for Box and Vec that use a custom allocator 2022-08-25 20:19:49 +00:00
rustc_session Auto merge of #100732 - dpaoliello:import_name_type, r=wesleywiser 2022-08-27 03:19:12 +00:00
rustc_smir
rustc_span Rollup merge of #100898 - compiler-errors:too-many-expr-fields, r=spastorino 2022-08-29 21:12:54 +02:00
rustc_symbol_mangling Change FnAbi::fixed_count to a u32. 2022-08-26 10:29:40 +10:00
rustc_target Auto merge of #100999 - nnethercote:shrink-FnAbi, r=bjorn3 2022-08-27 14:00:53 +00:00
rustc_trait_selection Auto merge of #98626 - oli-obk:tracing, r=lcnr 2022-08-29 11:13:42 +00:00
rustc_traits Various changes to logging of borrowck-related code 2022-08-29 10:59:21 -04:00
rustc_transmute Rollup merge of #100604 - dtolnay:okorerr, r=m-ou-se 2022-08-26 09:51:44 +09:00
rustc_ty_utils Rollup merge of #99027 - tmiasko:basic-blocks, r=oli-obk 2022-08-29 06:34:43 +02:00
rustc_type_ir
rustc_typeck Auto merge of #101167 - matthiaskrgr:rollup-yt3jdmp, r=matthiaskrgr 2022-08-29 22:49:04 +00:00