about summary refs log tree commit diff
path: root/src/test/rustdoc-js-std/multi-query.js
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-02-07 23:40:26 +0000
committerbors <bors@rust-lang.org>2022-02-07 23:40:26 +0000
commite7cc3bddbe0d0e374d05e7003e662bba1742dbae (patch)
treed16a23be9742a18b24810187154e6a9909ef9952 /src/test/rustdoc-js-std/multi-query.js
parent734368a200904ef9c21db86c595dc04263c87be0 (diff)
parent9822fff2ea892fed6da7d219c945c0b30de3c7a3 (diff)
downloadrust-e7cc3bddbe0d0e374d05e7003e662bba1742dbae.tar.gz
rust-e7cc3bddbe0d0e374d05e7003e662bba1742dbae.zip
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
Diffstat (limited to 'src/test/rustdoc-js-std/multi-query.js')
0 files changed, 0 insertions, 0 deletions