Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 5 pull requests #71717

Merged
merged 14 commits into from
Apr 30, 2020
Merged

Rollup of 5 pull requests #71717

merged 14 commits into from
Apr 30, 2020

Conversation

Dylan-DPC-zz
Copy link

Successful merges:

Failed merges:

r? @ghost

nikomatsakis and others added 14 commits April 16, 2020 11:03
We don't need the `scc_dependency_order` vector, `all_sccs` is already
in dependency order.
Otherwise each update is run twice and errors are printed
rename-unique: Change calls and doc in raw_vec.rs

rename-unique: Change empty() -> dangling() in const-ptr-unique-rpass.rs
…tthewjasper

extend NLL checker to understand `'empty` combined with universes

This PR extends the NLL region checker to understand `'empty` combined with universes. In particular, it means that the NLL region checker no longer considers `exists<R2> { forall<R1> { R1: R2 } }` to be provable. This is work towards rust-lang#59490, but we're not all the way there. One thing in particular it does not address is error messages.

The modifications to the NLL region inference code turned out to be simpler than expected. The main change is to require that if `R1: R2` then `universe(R1) <= universe(R2)`.

This constraint follows from the region lattice (shown below), because we assume then that `R2` is "at least" `empty(Universe(R2))`, and hence if `R1: R2` (i.e., `R1 >= R2` on the lattice) then `R1` must be in some universe that can name `'empty(Universe(R2))`, which requires that `Universe(R1) <= Universe(R2)`.

```
static ----------+-----...------+       (greatest)
|                |              |
early-bound and  |              |
free regions     |              |
|                |              |
scope regions    |              |
|                |              |
empty(root)   placeholder(U1)   |
|            /                  |
|           /         placeholder(Un)
empty(U1) --         /
|                   /
...                /
|                 /
empty(Un) --------                      (smallest)
```

I also made what turned out to be a somewhat unrelated change to add a special region to represent `'empty(U0)`, which we use (somewhat hackily) to indicate well-formedness checks in some parts of the compiler. This fixes rust-lang#68550.

I did some investigation into fixing the error message situation. That's a bit trickier: the existing "nice region error" code around placeholders relies on having better error tracing than NLL currently provides, so that it knows (e.g.) that the constraint arose from applying a trait impl and things like that. I feel like I was hoping *not* to do such fine-grained tracing in NLL, and it seems like we...largely...got away with that. I'm not sure yet if we'll have to add more tracing information or if there is some sort of alternative.

It's worth pointing out though that I've not kind of shifted my opinion on whose job it should be to enforce lifetimes: I tend to think we ought to be moving back towards *something like* the leak-check (just not the one we *had*). If we took that approach, it would actually resolve this aspect of the error message problem, because we would be resolving 'higher-ranked errors' in the trait solver itself, and hence we wouldn't have to thread as much causal information back to the region checker. I think it would also help us with removing the leak check while not breaking some of the existing crates out there.

Regardless, I think it's worth landing this change, because it was relatively simple and it aligns the set of programs that NLL accepts with those that are accepted by the main region checker, and hence should at least *help* us in migration (though I guess we still also have to resolve the existing crates that rely on leak check for coherence).

r? @matthewjasper
… r=Dylan-DPC

Add help message for missing right operand in condition

closes rust-lang#30035
… r=Mark-Simulacrum

Move `{Free,}RegionRelations` and `FreeRegionMap` to `rustc_infer`

...and out of `rustc_middle`. This is to further rust-lang#65031, albeit in a very minor way

r? @Mark-Simulacrum
…, r=Mark-Simulacrum

Detect git version before attempting to use --progress

Otherwise each update is run twice and errors are printed

I've tested this with:
git version 2.8.2.windows.1 (Windows)
git version 2.26.2.266.ge870325ee8 (Linux built from source)
git version 2.17.1 (Linux)
git version 2.21.1 (Apple Git-122.3) (MacOS)

I've tested with Python 2.7 (Windows, Linux, MacOS), 3.6 (Linux), and 3.7 (MacOS)
…r=shepmaster

Rename Unique::empty() -> Unique::dangling()

A `FIXME` comment in `src/libcore/ptr/unique.rs` suggested refactoring `Unique::empty()` to `Unique::dangling()` which this PR does.
@Dylan-DPC-zz
Copy link
Author

@bors r+ p=5 rollup=never

@bors
Copy link
Contributor

bors commented Apr 30, 2020

📌 Commit 97a8870 has been approved by Dylan-DPC

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Apr 30, 2020
@bors
Copy link
Contributor

bors commented Apr 30, 2020

⌛ Testing commit 97a8870 with merge 7ced01a...

@bors
Copy link
Contributor

bors commented Apr 30, 2020

☀️ Test successful - checks-azure
Approved by: Dylan-DPC
Pushing 7ced01a to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 30, 2020
@bors bors merged commit 7ced01a into rust-lang:master Apr 30, 2020
@rust-highfive
Copy link
Collaborator

📣 Toolstate changed by #71717!

Tested on commit 7ced01a.
Direct link to PR: #71717

💔 nomicon on windows: test-pass → test-fail (cc @Gankra @frewsxcv).
💔 nomicon on linux: test-pass → test-fail (cc @Gankra @frewsxcv).

rust-highfive added a commit to rust-lang-nursery/rust-toolstate that referenced this pull request Apr 30, 2020
Tested on commit rust-lang/rust@7ced01a.
Direct link to PR: <rust-lang/rust#71717>

💔 nomicon on windows: test-pass → test-fail (cc @Gankra @frewsxcv).
💔 nomicon on linux: test-pass → test-fail (cc @Gankra @frewsxcv).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants