The ultimate safety
turalcar opened this issue · 6 comments
turalcar commented
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)
}
}
TruncatedDinoSour commented
impl 'fn static::<'abcdefghijklmnopqrstuvwxyz>{ {{}{ trait for &T!fn&' ( ), ->!'''static TP L{ s>!<p'Witness<for &aa'a'a'b'a'L>{
x
}
rust as its finest
TgZ39 commented
impl 'fn static::<'abcdefghijklmnopqrstuvwxyz>{ {{}{ trait for &T!fn&' ( ), ->!'''static TP L{ s>!<p'Witness<for &aa'a'a'b'a'L>{ x }rust as its finest
Is that valid syntax?
TgZ39 commented
🚀
TruncatedDinoSour commented
impl 'fn static::<'abcdefghijklmnopqrstuvwxyz>{ {{}{ trait for &T!fn&' ( ), ->!'''static TP L{ s>!<p'Witness<for &aa'a'a'b'a'L>{ x }rust as its finest
Is that valid syntax?
if ur srs : no, its satire, highlighting rusts truly 'beautiful' syntax
if not : yes ofc it is
theavgeekbee commented
ahh yes my favorite lifetime specifier: abcdefghijklmnopqrstuvwxyz
TruncatedDinoSour commented
ahh yes my favorite lifetime specifier: abcdefghijklmnopqrstuvwxyz
yeah it means 'until rust language is good, be alive' ( dead lifetime )