• &'static T: Valid forever
  • T: static: No references

'static means, the data:

  • &'static T: Is valid for the entire program duration (like string literals in the binary)
  • T: static: Doesn’t contain any references with shorter lifetimes

A String or Vec<i32> is T: 'static (no borrowed data), but gets deallocated when dropped.

String literals are &'static T because the data is stored in .rodata segment of memory, not in the stack, thus is valid for the entire duration of the program.