rust/compiler/rustc_data_structures/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
..
base_n mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
binary_search_util Stop enabling in_band_lifetimes in rustc_data_structures 2021-12-05 20:17:35 -08:00
fingerprint Make Fingerprint::combine_commutative associative 2022-01-03 19:07:29 +01:00
graph rustc VecGraph: require the index type to implement Ord 2021-12-22 10:50:57 -06:00
obligation_forest Remove for loop range 2021-10-10 16:32:16 +02:00
owning_ref Also fix “a OwningRef 2021-08-24 02:28:38 +02:00
sip128 SipHasher128: improve constant names and add more comments 2020-10-11 23:48:35 -07:00
small_c_str mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
snapshot_map mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
sorted_map Stop enabling in_band_lifetimes in rustc_data_structures 2021-12-05 20:17:35 -08:00
sso Stop enabling in_band_lifetimes in rustc_data_structures 2021-12-05 20:17:35 -08:00
stable_hasher Fix isize optimization in StableHasher for big-endian architectures 2022-02-03 11:47:41 +01:00
tagged_ptr Small performance tweaks 2021-12-12 12:35:01 +08:00
thin_vec eplace usages of vec![].into_iter with [].into_iter 2022-01-09 14:09:25 +11:00
tiny_list Move some test-only code to test files 2021-03-17 10:31:30 -04:00
transitive_relation Move some test-only code to test files 2021-03-17 10:31:30 -04:00
vec_map eplace usages of vec![].into_iter with [].into_iter 2022-01-09 14:09:25 +11:00
atomic_ref.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
base_n.rs Apply clippy suggestions 2021-10-10 15:38:19 +02:00
captures.rs Remove #[allow(unused_lifetimes)] which is now unnecessary 2021-06-17 08:56:54 +09:00
fingerprint.rs Rollup merge of #92528 - tmiasko:combine-commutative, r=michaelwoerister 2022-02-02 19:34:01 +01:00
flock.rs Fix the flock fallback implementation 2021-08-15 18:44:06 +02:00
frozen.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
functor.rs Make IdFunctor::try_map_id panic-safe 2021-12-07 11:11:23 +00:00
fx.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
jobserver.rs datastructures: replace lazy_static by SyncLazy from std 2020-09-01 22:06:47 +01:00
lib.rs add a rustc::query_stability lint 2022-02-01 10:15:59 +01:00
macros.rs Allow variant attributes in enum_from_u32! 2021-02-28 11:53:55 -08:00
map_in_place.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
memmap.rs Add safety comment to StableAddress impl for Mmap 2021-04-03 14:51:05 +02:00
profiling.rs Remove redundant [..]s 2021-12-09 00:01:29 +01:00
ptr_key.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
sharded.rs Use <[T; N]>::map in Sharded instead of SmallVec and unsafe code 2021-09-18 15:07:24 +02:00
sip128.rs Revert "Do not hash leading zero bytes of i64 numbers in Sip128 hasher" 2022-01-24 09:07:47 +01:00
small_c_str.rs Remove redundant [..]s 2021-12-09 00:01:29 +01:00
sorted_map.rs Use SortedMap in HIR. 2021-10-21 23:08:57 +02:00
stable_hasher.rs Fix isize optimization in StableHasher for big-endian architectures 2022-02-03 11:47:41 +01:00
stable_map.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
stable_set.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
stack.rs Apply clippy suggestions 2021-10-10 15:38:19 +02:00
steal.rs more clippy fixes 2021-11-07 16:59:05 +01:00
svh.rs Make Decodable and Decoder infallible. 2022-01-22 10:38:31 +11:00
sync.rs Fix typos “a”→“an” 2021-08-22 15:35:11 +02:00
tagged_ptr.rs Miscellaneous inlining improvements 2021-06-02 08:49:58 +02:00
temp_dir.rs Capitalize safety comments 2020-09-08 22:37:18 -04:00
thin_vec.rs Rustdoc: use ThinVec for GenericArgs bindings 2022-01-01 11:29:14 +01:00
tiny_list.rs Apply clippy suggestions 2021-10-10 15:38:19 +02:00
transitive_relation.rs Move some test-only code to test files 2021-03-17 10:31:30 -04:00
unhash.rs Avoid rehashing Fingerprint as a map key 2020-09-01 18:27:02 -07:00
vec_linked_list.rs Stop enabling in_band_lifetimes in rustc_data_structures 2021-12-05 20:17:35 -08:00
vec_map.rs Lazily resolve type-alias-impl-trait defining uses 2022-02-02 15:40:11 +00:00
work_queue.rs Remove (lots of) dead code 2021-03-27 22:16:33 -04:00