{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreicxenve25o5mddmn4y6cbh2jx7n3iar27sqjc5drbyesnwxopdag4",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3miproagfc2k2"
},
"path": "/t/add-new-reserved-lifetime-owned/24129#post_6",
"publishedAt": "2026-04-04T12:53:31.000Z",
"site": "https://internals.rust-lang.org",
"tags": [
"play.rust-lang.org",
"Rust Playground"
],
"textContent": "I'm not sure why you're trying to write this contrived example, but you can fix it again by:\n\n * not having `clone_with_string_type` take a `&'s1 Check<'s1, S>`; there is no need to link the lifetime of the self reference to the lifetime that can be used to create an instance of `S`, simply because you are not creating a new instance of `S`. Use a separate lifetime untied to `'s1` instead.\n * removing the `'s` lifetime parameter from `Check`: its usage along with the `PhantomData` signals to the borrow checker that `Check` holds some unknown reference with lifetime `'s` possibly unrelated to `S`, and this prevents any way to extend such lifetime when you know that `S: AsStr<'longer_lifetime>`.\n\nplay.rust-lang.org\n\n### Rust Playground\n\nA browser interface to the Rust compiler to experiment with the language\n\n> therefore any reference outlives 'owned\n\nThis doesn't make sense to me. Something that is owned can live forever, and if any reference can outlive it then you get that any reference can live forever, which is obviously false.\n\nIt would allow \"fixing\" your code above only because it would make the type system unsound. I don't see how any sound implementation of this `'owned` lifetime concept would fix your code.",
"title": "Add new reserved lifetime: 'owned"
}