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

[NLL] Clean up handling of type annotations #57714

Merged
merged 7 commits into from
Jan 25, 2019

Conversation

matthewjasper
Copy link
Contributor

@matthewjasper matthewjasper commented Jan 17, 2019

Closes #46702
Closes #54943
Closes #57531
Closes #57731
cc #56993 leaving this open to track the underlying issue: we are not running tests with full NLL enabled on CI at the moment

r? @nikomatsakis

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 17, 2019
We want the name `CanonicalUserTypeAnnotation` for our own use.
We  equate the type in the annotation with the inferred type first so
that we have a fully inferred type to perform the well-formedness check
on.
@rust-highfive

This comment has been minimized.

) -> Self {
Self { mir_ty, variance, def_id, user_substs, projs }
Self { mir_ty, def_id, user_substs }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm interesting that you have found a way to get rid of carrying the projections around as part of the AscribeUserType.

@@ -60,26 +60,29 @@ pub struct Pattern<'tcx> {

#[derive(Clone, Debug)]
pub struct PatternTypeProjection<'tcx> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be similarly renamed to just PatternType now that you've removed the projections?

@pnkfelix
Copy link
Member

This looks really good to me. I'm sort of flabbergasted that I spent all that time figuring out how to factor out the projections and apply them later on in the compiler's control flow ... when I guess I should have been trying to make a change more like this...?

@pnkfelix
Copy link
Member

we are not running tests with full NLL enabled on CI at the moment

I had forgotten about this detail.

If nothing else, that should be an argument for us to prioritize turning on NLL for all editions. Because right now we are leaving open a pretty big gap in our CI's testing.

@pnkfelix
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Jan 25, 2019

📌 Commit 1593ac9 has been approved by pnkfelix

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 25, 2019
@petrochenkov
Copy link
Contributor

@matthewjasper
Could you add a test for #57866 (from #57887)?

@pnkfelix
Copy link
Member

we are not running tests with full NLL enabled on CI at the moment

I had forgotten about this detail.

If nothing else, that should be an argument for us to prioritize turning on NLL for all editions. Because right now we are leaving open a pretty big gap in our CI's testing.

Oh wait, I think I misunderstood this.

I thought that this was referring to the change to turn off compiletest's compare-mode by default (see #56391); but that didn't turn off NLL testing completely; it just restricted it to one builder.

After re-reading the comment, I think that it is in fact referring to the change introduced by PR #55134.

@pnkfelix
Copy link
Member

@petrochenkov I'll add that test now. (Maybe I'll change it to a // compile-pass test in drive by.)

@pnkfelix
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Jan 25, 2019

📌 Commit 620a03f has been approved by pnkfelix

@bors
Copy link
Contributor

bors commented Jan 25, 2019

⌛ Testing commit 620a03f with merge 0b1669d...

bors added a commit that referenced this pull request Jan 25, 2019
[NLL] Clean up handling of type annotations

* Renames (Canonical)?UserTypeAnnotation -> (Canonical)?UserType so that the name CanonicalUserTypeAnnotation is free.
* Keep the inferred type associated to user type annotations in the MIR, so that it can be compared against the annotated type, even when the annotated expression gets removed from the MIR. (#54943)
* Use the inferred type to allow infallible handling of user type projections (#57531)
* Uses revisions for the tests in #56993
* Check the types of `Unevaluated` constants with no annotations (#46702)
* Some drive-by cleanup

Closes #46702
Closes #54943
Closes #57531
Closes #57731
cc #56993 leaving this open to track the underlying issue: we are not running tests with full NLL enabled on CI at the moment

r? @nikomatsakis
@bors
Copy link
Contributor

bors commented Jan 25, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: pnkfelix
Pushing 0b1669d to master...

@bors bors merged commit 620a03f into rust-lang:master Jan 25, 2019
@matthewjasper matthewjasper deleted the wellformed-unreachable branch February 3, 2019 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

None yet

6 participants