Art’s Substack

Art’s Substack

Share this post

Art’s Substack
Art’s Substack
Rust: enum, boxed error and stack size mystery

Rust: enum, boxed error and stack size…

Art
May 15, 2024
1

Share this post

Art’s Substack
Art’s Substack
Rust: enum, boxed error and stack size mystery
2

Rust compiler version <= 1.74.0 reserves 4096 + 16 = 4112 bytes of stack (yes, with optimization level 3, opt-level=3), check this out https://godbolt.org/z/PsjETWceq. If I switch to Rust 1.75.0, it gets fixed, https://godbolt.org/z/63EE6j3h3, it reserves 32 bytes

Read →
2 Comments
User's avatar
John's avatar
John
Apr 22

https://internals.rust-lang.org/t/why-rust-compiler-1-77-0-to-1-85-0-reserves-2x-extra-stack-for-large-enum/22775/2

Expand full comment
Reply (1)
Share
Art's avatar
Art
Apr 24

Hi, John,

Here is the output https://internals.rust-lang.org/t/why-rust-compiler-1-77-0-to-1-85-0-reserves-2x-extra-stack-for-large-enum/22775/6

Expand full comment
Reply
Share
© 2025 Art
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share