Using TypeId as key in BTreeMap, lifetime question for TypeId::of::<T>

'static as a bound has a subtle meaning. It's a lifetime that cannot be satisfied by temporary references, so it's an indirect way of forbidding temporary references. For types that don't contain references it doesn't do anything.

2 Likes