-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 doesn't check that user type annotations are well-formed in unreachable code #54943
Comments
Discussed at NLL weekly meeting. We need to decide whether this actually is something we're going to fix or not. Thus tagging as I-needs-decision. The test provided currently fails to compile under That gives us plenty of time to decide how we want to handle this in the long term. Nonetheless, putting on the Release milestone so that we do actually make the aforementioned decision about whether to fix this. |
I was thinking more about this. I think perhaps the way to fix this is as follows:
|
See also #55344 . |
triage: Either this is something that we're planning to implement and backport to the beta channel... or its something that is not that high priority. Given that this is an NLL-sound issue, I'm going to assume that it is indeed high priority and belongs on the Release milestone. Thus, tagging as P-high |
discussed at NLL meeting. @matthewjasper pointed out to me that this bug does not apply to migration mode, only to So, I am removing this from the Release milestone. |
Oh; looking over this now, I realize that the whole reason this was on the Release milestone was to resolve the I-needs-decision in a timely fashion. (And I was the one who even documented this, 21 days ago. 🤥 ) Putting back on the Release milestone. |
assigning to self for investigation of the issues that should drive the decision here (and perhaps the actual implementation). |
I'm going to remove this from the release milestone. The current behavior is not even necessarily a bug, and it's definitely obscure and not something I expect a lot of people to run into. Moreover, the changes to fix those look fairly invasive, and I'm not eager to backport them -- I could easily imagine surprise ICEs resulting from such changes. |
NLL: User type annotations refactor, associated constant patterns and ref bindings. Fixes #55511 and Fixes #55401. Contributes to #54943. This PR performs a large refactoring on user type annotations, checks user type annotations for associated constants in patterns and that user type annotations for `ref` bindings are respected. r? @nikomatsakis
[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
#54942 checks well-formedness in the general case, but unreachable code is deleted before NLL can check it.
For example, this test still compiles with NLL enabled.
The text was updated successfully, but these errors were encountered: