Closed
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