{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreifrbufhrhskl23h23eqj35axbm2f6tlt4ctf7lr5it4muwtriuvra",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mo4yiwypsfs2"
},
"path": "/t/add-new-reserved-lifetime-owned/24129#post_11",
"publishedAt": "2026-06-12T21:49:44.000Z",
"site": "https://internals.rust-lang.org",
"textContent": "&'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.",
"title": "Add new reserved lifetime: 'owned"
}