{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreidmryd2z3gfpdfcylhukohqqjoi2weknzxhqnqzqai3kvgikgjx2y",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mhbo4fcywyy2"
},
"path": "/t/private-lifetime-inference/24088#post_13",
"publishedAt": "2026-03-17T18:00:21.000Z",
"site": "https://internals.rust-lang.org",
"textContent": "TBH, getting lifetime bounds right is rarely the noisy part. I think it'd be entirely fine to solve that part like we solve `-> _`: with a structured suggestion inferred from the body.\n\nThen I agree with the mention of a `macro fn`: then it could potentially even just be\n\n\n macro fn find_best(primary, fallback) {\n if primary.is_valid() { &primary.summary } else { &fallback.summary }\n }\n\n\nwhere not only do I not need to put in the _lifetimes_ but I can even leave off the _types_ and have it just happen in the context of the caller instead.\n\nWhich would, among other things, be really really useful for math where writing out all the `num_traits` bounds is particularly annoying for a small helper.",
"title": "Private lifetime inference"
}