Closed
Description
This code incorrectly(?) compiles with NLL. Alternatively we could say that Sized bounds are assumed to be lifetime-independent.
#![feature(nll)]
#![allow(unused)]
trait A {
type X: ?Sized;
}
fn foo<'a, T: 'static>(s: Box<<&'a T as A>::X>)
where
for<'b> &'b T: A,
<&'static T as A>::X: Sized
{
let x = *s; // requires 'a: 'static
}
fn main() {}