Add new reserved lifetime: 'owned
Rust Internals [Unofficial]
June 12, 2026
&'buffer str -> &'static str was just an example of incorrect semantics if we assume no copy, just coercion or some sort of reference. In general case we would have &'buffer str -> &'buffer2 str where 'buffer2 outlives 'buffer. If I have generic function over some String type that implements AsStr(see code snippet above), then I forced to add bounds 'buffer2: 'buffer, because potentialy output type could be a reference and in first case that I specified it makes sense. However there if I try to pass <'static, String> parameters to such function I will get borrow checker error, because again borrow checker cannot distinguish between &'static str and owned String type. 'buffer value could go out of scope immediately after a function is invoked and everything will be fine because String copied the data, it does not hold any references. The reason I have to explicitly specify lifetime is because I have generic Sequence and Dictionary traits that expect them to specify the lifetime of elements in them.
Discussion in the ATmosphere