News for hackers. Stuff that matters.
Re:A half-hour to learn Rust by pornel on Saturday January 02, 2021 @07:24AM (#25612328)
The missing information here is that lifetimes don't apply at all to types that don't contain any borrowed references (such as `i32`, or self-contained `String`).

So `T: 'static` doesn't require types to live for the entire duration of the program. It requires borrows if there are any to be valid for that long. If there are no borrows involved, then 'static is ignored.

In practice `T: 'static` should be understood as "all temporary references are forbidden here".

There are no comments on this comment yet.