3 ms·
You seem to misunderstand what type : lifetime means. > 'static in this context would mean that all members of T must be 'static, which means that all instance
by GolDDranks 6y ago
You seem to misunderstand what type : lifetime means.
> 'static in this context would mean that all members of T must be 'static, which means that all instances of T must be 'static.
Your "which means that" isn't true. It doesn't mean that. The syntax type : lifetime indicates that the values of the type MUST BE ABLE to outlive the lifetime. It doesn't mean that they NEED to outlive the lifetime.
This means, for example, i32 : 'static even in the case doesn't live the whole 'static lifetime. It COULD live, though, if the author of the code allocated it statically.