-
Notifications
You must be signed in to change notification settings - Fork 112
Open
Description
There is a way to make this truly safe (I won't spoil this for you)
fn translate<'a, T>(_: &'static &'a (), x: &'a T) -> &'static T {
x
}
trait Witness<'a> {
fn extend<T>(self, x: &'a T) -> &'static T;
}
impl<'a> Witness<'a> for &'static () {
fn extend<T>(self, x: &'a T) -> &'static T {
translate(&self, x)
}
}
Metadata
Metadata
Assignees
Labels
No labels