]> git.lizzy.rs Git - rust.git/commit - src/tools/rust-analyzer
Auto merge of #96883 - jackh726:early-binder-2, r=oli-obk
authorbors <bors@rust-lang.org>
Sat, 14 May 2022 23:53:11 +0000 (23:53 +0000)
committerbors <bors@rust-lang.org>
Sat, 14 May 2022 23:53:11 +0000 (23:53 +0000)
commit2a8a0fc4237da544aca0d6631ee467891caad9ad
tree9a554210e3423b8808e0d3297a35b43247e4ce48
parent70b3681bf621bc0de91ffab711b2350068b4c466
parent06a1e8854c95d5be5db0bebe4630c691b604e792
Auto merge of #96883 - jackh726:early-binder-2, r=oli-obk

Add EarlyBinder

Chalk has no concept of `Param` (https://github.com/rust-lang/chalk/blob/e0ade19d139bc784384acc6736cd960c91dd55a1/chalk-ir/src/lib.rs#L579) or `ReEarlyBound` (https://github.com/rust-lang/chalk/blob/e0ade19d139bc784384acc6736cd960c91dd55a1/chalk-ir/src/lib.rs#L1308). Everything  is just "bound" - the equivalent of rustc's late-bound. It's not completely clear yet whether to move everything to the same time of binder in rustc or add `Param` and `ReEarlyBound` in Chalk.

Either way, tracking when we have or haven't already substituted out these in rustc can be helpful.

As a first step, I'm just adding a `EarlyBinder` newtype that is required to call `subst`. I also add a couple "transparent" `bound_*` wrappers around a couple query that are often immediately substituted.

r? `@nikomatsakis`
13 files changed:
compiler/rustc_middle/src/mir/mod.rs
compiler/rustc_middle/src/ty/context.rs
compiler/rustc_middle/src/ty/instance.rs
compiler/rustc_middle/src/ty/mod.rs
compiler/rustc_middle/src/ty/util.rs
compiler/rustc_mir_build/src/build/mod.rs
compiler/rustc_mir_transform/src/const_prop.rs
compiler/rustc_mir_transform/src/const_prop_lint.rs
compiler/rustc_symbol_mangling/src/v0.rs
compiler/rustc_trait_selection/src/traits/select/mod.rs
compiler/rustc_typeck/src/check/check.rs
compiler/rustc_typeck/src/check/intrinsic.rs
src/tools/clippy/clippy_utils/src/ty.rs