Repository navigation
user type annotations are captured post normalization #54940
Description
Activity
- addedT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.A-NLLArea: Non-lexical lifetimes (NLL)Area: Non-lexical lifetimes (NLL)NLL-soundWorking towards the "invalid code does not compile" goalWorking towards the "invalid code does not compile" goal
on Oct 9, 2018 I think in general we probably need to rework a bit how the NLL checker is handling user-given type annotations to cover normalizations. My expectation is that we should move over to the strategy of instantiating the user-types with fresh type variables so that we can run the
normalizeroutine on them, and then adapt therelate_tyscode to handle unbound type variables. We've done most of the legwork here already so that should be too hard to do.- changed the title
[-]nll type anntation not preserved for non-normalized projections[/-][+]nll type annotation not preserved for non-normalized projections[/+]on Oct 16, 2018 Discussed at NLL weekly meeting. Assigning to @nikomatsakis as primary person to resolve this. Assigning to self as a kind of backup plan since I know that @nikomatsakis has some conflicts this week that will impede their ability to actually hack on this problem in the short term.
The problem is that we are capturing these types after they've been normalized. I think the best fix would be to capture the types before they've been normalized, and then have the NLL checker do the normalization. I'm not 100% sure how much of a pain this is going to be though; it might be a bit of a pain in some cases.
It also would require #55093 to land first.
OK, digging a bit deeper. This is going to be an awful pain to fix =)
- changed the title
[-]nll type annotation not preserved for non-normalized projections[/-][+]user type annotations are captured post normalization[/+]on Oct 16, 2018 14 remaining items
- addedP-mediumMedium priorityMedium priorityand removedP-highHigh priorityHigh priority
on May 2, 2019 This compiles without
#![feature(nll)], but it doesn't seem possible to exploit this. Actually trying to usexas&'static i32causes a compilation error.I intend to look into this in the somewhat near future
@rustbot claim
- addedT-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.S-types-trackedStatus: Being actively tracked by the types teamStatus: Being actively tracked by the types teamand removed
on Jun 24, 2022 - added a commit that references this issue
on Jan 9, 2023
This example compiles but should not. Haven't investigated deeply.
cc #47184