Skip to main content


did you know there's no limit to how many if let statements you can have in #rust? you can just keep adding more. nobody can stop you
#Rust
in reply to Lynnesbian

is there actually no limit or is it stupidly high, like java and its limit of 255 parameters to a function call?
in reply to Lynnesbian

fine... Give me a minute while I blow the top of this stack.
in reply to Lynnesbian

well ... that's rather silly 😁

gist.github.com/emilyselwood/8…

in reply to Lynnesbian

it just works ... prints out the loop_count of optional values.

Used random number generation to make sure the compiler wasn't making it vanish in a puff of logic

Lynnesbian reshared this.

in reply to Lynnesbian

so it does crash rustc with a stack overflow if you set it to 65536 loops but that doesn't seem entirely unreasonable honestly.

Lynnesbian reshared this.

in reply to Lynnesbian

the source code for clippy lints looks very much like this btw

Lo, thar be cookies on this site to keep track of your login. By clicking 'okay', you are CONSENTING to this.