{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreieoqjms7vtmlzfgqgkti4slmnlsy23ps72fkhqnyfcdoclhkjylem",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mgumlwwirti2"
},
"path": "/t/introduce-a-way-to-construct-range-from-start-length/24073#post_4",
"publishedAt": "2026-03-12T08:37:29.000Z",
"site": "https://internals.rust-lang.org",
"textContent": "If there was `impl BitAnd<RangeTo> for RangeFrom` with `Output=Range` that returned the intersection (semantically very close to and logic) then you could do `from.. & ..to`\n\nExtended to the rest of the Range types, the intersection operator could be useful for treating Ranges as general interval types.\n\nThen the question is whether BitOr should be overloaded to mean union, but a union of 2 continuous intervals is not necessarily a continuous interval (representable by Range) so maybe not because it doesn't seem obvious what to return there.",
"title": "Introduce a way to construct Range from start + length"
}