{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreicp6a4cwlro3ocfdi7ymolyoej7ov4dhqseammgpfzuhsxbk52gla",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mgrb7r7b2f72"
},
"path": "/t/stop-including-string-content-in-index-panics/24067#post_4",
"publishedAt": "2026-03-10T17:56:46.000Z",
"site": "https://internals.rust-lang.org",
"tags": [
"right now",
"@scottmcm"
],
"textContent": "ConradIrwin:\n\n> currently we see: \"begin <= end (4 <= 3) when slicing `test`. I'd like this to become \"byte index range starts before end (4..3)\"\n\nHmm, this is particularly gratuitous right now:\n\n> byte index 1000 is out of bounds of `aseirughaoirughaoerghaoerghaorvlijesr;oibgfhs;eroignvs;eorigjhvas;loijhvsoeruifpsioreuyhfgvosliueryhvglaiueyrhvfgliuhrlukvzyhrvlkusrdyhvlkzuyrsvhlkuyhfgbrlixuyvlikzurhfclsvkurdygvhskrerghaierughaslierughaseirughaergiuhaeriuhager`\n\nEchoing the _whole_ string seems clearly wrong and unnecessary, so at least this one I think we should just do. Maybe make a PR for that part and we can nominate for libs/libs-api discussion? (Feel free to `r? @scottmcm`.)\n\nConradIrwin:\n\n> \"byte index 1 is not a char boundary; it is inside 'ã' (bytes 0..2) of `ãchoo`. I'd like this to become \"byte index 1 is not at a utf-8 character boundary; the character spans from indexes 0..2)\"\n\nThe _single USV_ , however, does seem particularly useful as friendliness to the developer, _especially_ the new developer not yet used to how rust does indexing, so I'd be more reticent to remove the \"inside 'ã'\" part. (Removing the \"of `ãchoo`\" part seems obvious, like the previous case.)\n\nHow much of a problem does the single USV cause? My instinct is that that wouldn't trigger the same GDPR-and-similar problems the full string could...",
"title": "Stop including string content in index panics?"
}