rust/compiler/rustc_middle/src
bors e7cc3bddbe Auto merge of #92007 - oli-obk:lazy_tait2, r=nikomatsakis
Lazy type-alias-impl-trait

Previously opaque types were processed by

1. replacing all mentions of them with inference variables
2. memorizing these inference variables in a side-table
3. at the end of typeck, resolve the inference variables in the side table and use the resolved type as the hidden type of the opaque type

This worked okayish for `impl Trait` in return position, but required lots of roundabout type inference hacks and processing.

This PR instead stops this process of replacing opaque types with inference variables, and just keeps the opaque types around.
Whenever an opaque type `O` is compared with another type `T`, we make the comparison succeed and record `T` as the hidden type. If `O` is compared to `U` while there is a recorded hidden type for it, we grab the recorded type (`T`) and compare that against `U`. This makes implementing

* https://github.com/rust-lang/rfcs/pull/2515

much simpler (previous attempts on the inference based scheme were very prone to ICEs and general misbehaviour that was not explainable except by random implementation defined oddities).

r? `@nikomatsakis`

fixes #93411
fixes #88236
2022-02-07 23:40:26 +00:00
..
dep_graph Show a more informative panic message when DefPathHash does not exist 2022-01-19 17:36:44 -05:00
hir Make local_def_id_to_hir_id query directly returh HirId 2022-01-29 08:40:23 -03:00
infer Clean up opaque type obligations in query results 2022-02-03 13:44:29 +00:00
middle Track drops across multiple yields 2022-01-18 14:25:24 -08:00
mir Rollup merge of #90132 - joshtriplett:stabilize-instrument-coverage, r=wesleywiser 2022-02-04 18:42:13 +01:00
query Rollup merge of #90132 - joshtriplett:stabilize-instrument-coverage, r=wesleywiser 2022-02-04 18:42:13 +01:00
thir Remove deprecated LLVM-style inline assembly 2022-01-12 18:51:31 +01:00
traits Do not store overlap_mode, just pass it down on insert 2022-01-31 11:51:34 -03:00
ty Auto merge of #92007 - oli-obk:lazy_tait2, r=nikomatsakis 2022-02-07 23:40:26 +00:00
util Use AddAssign impl 2021-11-09 23:47:36 +01:00
arena.rs Fully serialize AdtDef 2021-12-15 16:32:16 -05:00
lib.rs add a rustc::query_stability lint 2022-02-01 10:15:59 +01:00
lint.rs update FutureIncompatibilityReason 2022-02-01 09:55:19 +01:00
macros.rs Rename TypeFolderFallible to FallibleTypeFolder 2021-12-02 16:14:18 +00:00
metadata.rs rustc_middle: Rename Export to ModChild and add some comments 2022-01-09 09:22:07 +08:00
tests.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
thir.rs Formally implement let chains 2022-01-18 19:38:17 -03:00