3 ms·
EDIT: Found it in the changelog. This feature was added in Rust 0.8 (2013-09-26) "Explicit enum discriminants may be given as uints as in enum E { V = 0u }" htt
by nicoburns 6y ago
EDIT: Found it in the changelog. This feature was added in Rust 0.8 (2013-09-26) "Explicit enum discriminants may be given as uints as in enum E { V = 0u }" https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-08-2013-09-26 https://github.com/rust-lang/rust/blob/master/RELEASES.md#ve...
They're referenced as a pre-existing feature in this Jan 2015 RFC [0], so they predate Rust 1.0. I don't know quite how old they are, but I suspect much older than that as this feature is necessary for interfacing with C which has been a high priority for Rust for a long time (particularly driven by the needs of the Servo project in the early years).
[0]: https://rust-lang.github.io/rfcs/0639-discriminant-intrinsic.html https://rust-lang.github.io/rfcs/0639-discriminant-intrinsic...