]> git.lizzy.rs Git - rust.git/commit
Auto merge of #55517 - nikomatsakis:universes, r=scalexm
authorbors <bors@rust-lang.org>
Thu, 3 Jan 2019 17:18:15 +0000 (17:18 +0000)
committerbors <bors@rust-lang.org>
Thu, 3 Jan 2019 17:18:15 +0000 (17:18 +0000)
commitc0bbc3927e28c22edefe6a1353b5ecc95ea9a104
tree2cc354e8390966e438b510b0ba376b7fa14927b5
parent2442823ef572a65092fbc46f6975633f983b50b6
parent8e89184a7beb03d58d3a3969dddc1d78964dec37
Auto merge of #55517 - nikomatsakis:universes, r=scalexm

Universes

This PR transitions the compiler to use **universes** instead of the **leak-check**. It is marked as [WIP] for a few reasons:

- The diagnostics at present are terrible =)
- This changes the behavior of coherence, regressing some things that used to compile

The goals of this PR at present are:

- To start getting some eyes on the code
- To do a crater run
- To see the full travis results (due to https://github.com/rust-lang/rust/issues/52452, I am not able to run the full test suite locally anymore at present)

The first few commits in the PR are changing how `evaluate` treats regions. We now track whether region comparisons occurred, reverting the "staticized" query approach that @arielb1 put in. The problem with "staticized" queries is that it relied on the leak-check to get higher-ranked things correct, and we are removing the leak-check in this PR series, so that caused problems.

You can see at the end a collection of test updates. Mostly we behave the same but with atrocious diagnostics, but there are a number of cases where we used to error and now no longer do, as well as single case where we used to **not** error but we now do (the coherence-subtyping change).

(Note: it would be possible to do a version of leak-check that propagates universe information and recover the old behavior. I am reluctant to do so because I'd like to leave us room to get more precise -- e.g., I want to eventually handle things like `exists<'a> { for<'b> { if ('a: 'b) { 'a: 'b } } }` which presently the leak-check cannot cope with etc. Also because it seems more consistent to me: most folks I've talked to expect the new behavior and are surprised to learn that binding sites were so significant before when it comes to coherence. One question is, though, to what extent are people relying on this in the wild?)
src/librustc_mir/borrow_check/nll/type_check/mod.rs