{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreibiiorhwc32ihdyl4ko3ivpf6lcujxhxqxd5hthexndwt5kfzm7xm",
    "uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mgrb7c6d3ij2"
  },
  "path": "/t/stop-including-string-content-in-index-panics/24067#post_6",
  "publishedAt": "2026-03-10T20:00:59.000Z",
  "site": "https://internals.rust-lang.org",
  "tags": [
    "relevant section of source code"
  ],
  "textContent": "ConradIrwin:\n\n> Add a flag to the standard library to suppress this.\n\nWhat kind of mechanism do you have in mind for having a “flag”?\n\nConradIrwin:\n\n> > I assume this is about not wanting to handle PI? Couldn't your crash reporter filter this out on the client side with a regex, at least as a stop-gap solution?\n>\n> We definitely can, but I'm a bit reluctant to as a permanent solution in case someone (like me) messes with the panic messages more.\n\nThat should be relatively easy to notice with an automated test though, shouldn’t it? Just run a test for a great variety of possible of out-of-bounds errors (including all existing flavors that are differentiated) in order to be able to be notified of any future changes in the panic message formatting, and have that test be executed whenever Zed upgrades to use a newer Rust toolchain.\n\n* * *\n\n_Edit:_ Or perhaps a test that looks at Rust’s source and creates a git blame or sth, of the relevant section of source code (`slice_error_fail` and its helper methods, or maybe only `slice_error_fail_rt`). Those aren’t exactly fast-changing, so it should be low effort to keep up. While the latest change was a month ago and changed the panic messages, before that the code remained unchanged for a long time. 2 changes about 4 years ago (adding `const` support, and a small refactor of char boundaries), another change about 7 years ago (running `rustfmt` over the standard library), which the actual panic message output logic having remained unchanged for about 10 years.",
  "title": "Stop including string content in index panics?"
}