~/talk

An Option? Have a slice!

Talkat Rustikon 2026 · 2026-03-19..03-20· [rust]
links:none on file
slides:none on file

Adds Option::as_slice and Option::as_mut_slice to libcore (stabilized in 1.75) by trying four implementations and finally landing a compiler intrinsic sim_option_payload_ptr that emits a MIR place projection to get the Some field. Resulting slice creation compiles to a no-op (or a single setE for niche-optimized types), avoids heap allocation and per-iteration branching, is const-evaluable, and spurred the offset_of macro to gain inner-variant support shortly afterward.

AI-written summary · about

  1. 0:00Option and Vec problem
  2. 3:36Slice method for Option needed
  3. 8:13Memory layout and niche optimization
  4. 13:12MaybeUninit layout challenges
  5. 15:23Compiler intrinsic design
  6. 20:36Rust implementation stabilized
  7. 22:46Option::as_slice impact
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.