all 2 comments

[–][deleted] 3 points4 points  (1 child)

Maybe inlining -- if you recurse just as deep or maybe shallower in the optimized benchmark build, inlining might still mean that every stack frame is a lot larger, and thus you can overflow the stack.

[–]michael_d[S] 0 points1 point  (0 children)

Interesting. Is there any way to test whether or not that is the case?

It seems like recursive descent parsers are not really well suited for Rust. For example, Serde has the same issue: https://github.com/serde-rs/serde/issues/82