-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Conversation
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.
040daa5
to
2cee682
Compare
This comment has been minimized.
This comment has been minimized.
2cee682
to
1593ac9
Compare
) -> Self { | ||
Self { mir_ty, variance, def_id, user_substs, projs } | ||
Self { mir_ty, def_id, user_substs } |
There was a problem hiding this comment.
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> { |
There was a problem hiding this comment.
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?
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...? |
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. |
@bors r+ |
📌 Commit 1593ac9 has been approved by |
@matthewjasper |
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.
|
@petrochenkov I'll add that test now. (Maybe I'll change it to a |
@bors r+ |
📌 Commit 620a03f has been approved by |
[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
☀️ Test successful - checks-travis, status-appveyor |
Unevaluated
constants with no annotations (figure out how to integrate constants and the MIR type checker #46702)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