Re:Rust Lifetimes
by Manishearth on Saturday October 31, 2015 @08:26PM
(#10484875)
Actually, I just looked into it, that's no longer possible. I was talking about contravariant lifetime positions, which happen with functions, but now it seems like function pointers are invariant in those positions, not contravariant.
The idea was to have something like
struct Foo<'a> {f: fn(&'a u8)}
should only be able to accept pointers that live shorter than the struct. But contravariance seems to have been removed.
The idea was to have something like
should only be able to accept pointers that live shorter than the struct. But contravariance seems to have been removed.