{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreid5wv6rsfbxqqvqqtck56fs5b5rkbiuwjwqiajwrupefgczvqadca",
    "uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mkq6lz3xe5m2"
  },
  "path": "/t/sized-or-sizeable-str-e-g-str-const-n-usize/24213#post_5",
  "publishedAt": "2026-04-30T17:27:21.000Z",
  "site": "https://internals.rust-lang.org",
  "textContent": "CAD97:\n\n> Note that your example _could be_ unsound in the future\n\nTechnically not _unsound_ because of the `assert!` in the constructor. But I take your point that relying on any behavior of `:literal` is sketchy. The minimal fix is\n\n\n    macro_rules! sizstr {\n        ($text:literal) => {\n            const {\n                const TEXT: &str = $text;\n                SizStr::<{ TEXT.len() }>::strict_from_ref(TEXT)\n            }\n        };\n    }\n",
  "title": "Sized (or Sizeable) str, e.g. str<const N: usize>"
}