-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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" goal
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() {}
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" goal