{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreihhsoyxs5bdxk6j6hhkkywjfmcgrar4fuwhlk7jskkzywqv5awuju",
    "uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3meeto7rxzkr2"
  },
  "path": "/t/what-s-where-size-kind-extra/23987#post_1",
  "publishedAt": "2026-02-08T20:38:48.000Z",
  "site": "https://internals.rust-lang.org",
  "tags": [
    "stringlet"
  ],
  "textContent": "I had removed most generic bounds on stringlet, as I found they infect every generic caller. But now the compiler is forcing me back to square one:\n\nI’m trying to clean up `VarStringlet`’s messy extra len-byte, by moving it into the byte array. Having stumbled over how `fixedstr::strN` takes away one from the requested size, I want an additional byte, to avoid such surprises.\n\nI understand const generic operations and picking up an associated const from a generic type require nightly and `#![feature(generic_const_exprs)]`. But then I get this, not only on the type itself, but also on every user:\n\n\n    error: unconstrained generic constant\n       --> /home/pfeiffer/dp/Rust/stringlet/src/lib.rs:178:21\n        |\n    178 |     pub(crate) str: [u8; SIZE + Kind::EXTRA],\n        |                     ^^^^^^^^^^^^^^^^^^^^^^^^\n        |\n    help: try adding a `where` bound\n        |\n    176 | > where [(); SIZE + Kind::EXTRA]: {\n        |   +++++++++++++++++++++++++++++++\n\n    error: unconstrained generic constant\n      --> /home/pfeiffer/dp/Rust/stringlet/src/cmp.rs:21:49\n       |\n    21 |             (true, ..) => SIZE == 0 || self.str == other.str[..],\n       |                                                 ^^\n       |\n    help: try adding a `where` bound\n       |\n    14 |     fn eq(&self, other: &self2!()) -> bool where [(); SIZE + Kind::EXTRA]: {\n       |                                            +++++++++++++++++++++++++++++++\n\n\nBesides suggesting the wrong inner type `()` vs. `u8`, that burden makes this feature unergonomic. So I wonder and hope: is this temporary, until some prerequisite gets implemented?",
  "title": "What’s where [(); SIZE + Kind::EXTRA]:?"
}