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
This commit is contained in:
commit
e7cc3bddbe
359 changed files with 3311 additions and 2447 deletions
|
@ -186,7 +186,6 @@ impl<K: DepKind> EncoderState<K> {
|
|||
}
|
||||
}
|
||||
|
||||
#[instrument(level = "debug", skip(self, record_graph))]
|
||||
fn encode_node(
|
||||
&mut self,
|
||||
node: &NodeInfo<K>,
|
||||
|
@ -213,7 +212,6 @@ impl<K: DepKind> EncoderState<K> {
|
|||
stat.edge_counter += edge_count as u64;
|
||||
}
|
||||
|
||||
debug!(?index, ?node);
|
||||
let encoder = &mut self.encoder;
|
||||
if self.result.is_ok() {
|
||||
self.result = node.encode(encoder);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue