-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
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" goalT-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.
Milestone
Description
Spawned off from #47184. The following test case compiles, but it should not:
#![allow(warnings)]
#![feature(nll)]
fn main() {
let x = 22_u32;
let y: &u32 = (&x) as &'static u32;
}
The problem is that the "cast" expression is not preserving the full type that the user gave (&'static u32
).
This is very similar to #54331
Metadata
Metadata
Assignees
Labels
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" goalT-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.