mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-28 03:07:24 +03:00
6f7fa03a06
Use Option's discriminant as its size hint I was looking at this in MIR after a question on discord, and noticed that it ends up with a switch in MIR (<https://rust.godbolt.org/z/3q4cYnnb3>), which it doesn't need because (as `Option::as_slice` uses) the discriminant is already the length.