about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-06-02 19:23:14 +0000
committerbors <bors@rust-lang.org>2017-06-02 19:23:14 +0000
commit107bd67ef7fb3e8027d7234d687cdd27c3efaa0d (patch)
treeb0ed47b3c7df37b85c7a74fb2b320bcfea4de972 /src/rustllvm/RustWrapper.cpp
parentd7798c3d179c7c18736fc0465e7ba6618c575a34 (diff)
parent84047db2ade806b802f36d522ea82bd5d3cbb242 (diff)
downloadrust-107bd67ef7fb3e8027d7234d687cdd27c3efaa0d.tar.gz
rust-107bd67ef7fb3e8027d7234d687cdd27c3efaa0d.zip
Auto merge of #42189 - nikomatsakis:chalk-trait-env-param-env, r=eddyb
querify layout and move param env out of the infcx

The main goal of this PR is to move the parameter environment *out* of the inference context. This is because the inference environment will soon be changing over the course of inference --- for example, when we enter into a `for<'a> fn(...)` type, we will push a new environment with an increasing universe index, rather than skolemizing the `'a` references. Similarly, each obligation will soon be able to have a distinct parameter environment, and therefore the `Obligation` struct is extended to carry a `ParamEnv<'tcx>`. (I debated about putting it into the cause; seems plausible, but also weird.)

Along the way, I also reworked how layout works, moving the layout cache into a proper query along the lines of needs-drop and friends.

Finally, tweaks the inference context API. It seemed to be accumulating parameters at an alarming rate. The main way to e.g. make a subtype or equality relationship is to do the following:

    infcx.at(cause, param_env).sub(a, b)
    infcx.at(cause, param_env).eq(a, b)

In both cases, `a` is considered the "expected" type (this used to be specified by a boolean). I tried hard to preserve the existing notion of what was "expected", although in some cases I'm not convinced it was being set on purpose one way or the other. This is why in some cases you will see me do `sup(b, a)`, which is otherwise equivalent to `sub(a, b)`, but sets the "expected type" differently.

r? @eddyb
cc @arielb1
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions