Closed
Description
Guten Tag!
For my project i used the 0.8 version of rust.
After i started to work on a parser module for my project.
rustc crashed at compile time and i decided to go and use the git version now i get an error message.
task 'rustc' has overflowed its stack
[1] 2625 illegal hardware instruction (core dumped) rustc main.rs
My project compiles without
pub mod parser;
in my main.rs perfectly.
But i don't get an error message, what says what goes wrong.
So I think thats an issue so thats reason you read that.
Thanks for every help on the irc and for my problem!
Sebastian Pielawa
Activity
ben0x539 commentedon Nov 10, 2013
The problem appears to be the definition of
Node
inparser.rs
:That makes for an infinite size struct because every
Node
contains another twoNode
s inside theOption
enums there. The standard solution is to useOption<~Node>
or similar, so that the size of those fields is fixed by the pointer size rather than recursive. Of course, the issue here is that rustc doesn't catch that which frankly surprises me given that this is pretty much our go-to example for motivating~
boxes now. ;)(ps: sorry for the prematurely submitted comment, my fingers slipped)
aeqwa commentedon Nov 10, 2013
Thank you ben0x539 it works!
But i think the compiler should give the user in that case an error message.
pnkfelix commentedon Nov 10, 2013
@aeqwa Yes, it should be. But is not yet so.
closing as duplicate of #3779
Auto merge of rust-lang#10400 - calebcartwright:rustfmt-cleanup, r=Ja…