External Publication
Visit Post

Sized (or Sizeable) str, e.g. str<const N: usize>

Rust Internals [Unofficial] April 30, 2026
Source

CAD97:

This method is fully const as of Rust 1.88 (for <[_]>::as_chunks). …

Note that the Option::unwrap occurs atconst time due to the const block, so there is guaranteed no runtime overhead.

This is fascinating! Like the last time you helped me (which inspired my new StringletBase layout and workaround module) I’ll let this settle and see where I can take it. Thank you!

Same thing though about macros as I replied to kpreid. And it would need two variants as the const {} one can’t handle dynamic data. I guess there must be reasons why const fns are not simply always called at compile time. But it just seems so annoying – and counter-intuitive that the same keyword means different things.

Discussion in the ATmosphere

Loading comments...