The Rust Programming Language Forum
Enumerations: how are they stored and other questions
help
tczajka
July 13, 2025, 5:46pm
31
Ideally it should be -∞:
2
-∞
= 0, log 0 = -∞
size of
(u32, Never)
would be 4 + (-∞) = -∞
Unfortunately -∞ doesn't fit in
usize
.
4 Likes
TWiR quote of the week
show post in topic
Related topics
Topic
Replies
Views
Activity
Enum crimes - getting the discriminant
help
27
3647
April 24, 2023
Noob question again: enum and struct?
48
10614
June 17, 2024
Why doesn't the niche optimization work for this enum?
help
14
1368
May 17, 2021
Why is the discriminant of a `#[repr(u8)] enum` not `u8`?
help
17
7146
July 11, 2020
How are enum discriminants sized in rust?
help
4
153
June 19, 2025