当试图运行一个构建大clap::App
(find the source here)的程序时,我得到一个stackoverflow:thread '<main>' has overflowed its stack
.
到目前为止,我还不知道如何指示rustc
为蛮力解决方案增加堆栈大小.RUST_MIN_STACK
似乎只适用于运行时,即使在那里,它似乎也没有任何效果.
在生成代码时,我可能需要做的是将SubCommand
创建移动到运行时,这就是我接下来要try 的.
However, do you see a way to fix this differently ?
It seems quite important to figure this one out as the builder patterns appears to be prone to this issue, if the built structure is just large and nested enough.
How to reproduce
git clone -b clap https://github.com/Byron/google-apis-rs
cd google-apis-rs
git checkout 9a8ae4b
make dfareporting2d1-cli-cargo ARGS=run
请注意,您将需要我的fork of quasi,并在本地设置一个覆盖,以允许使用最新的编译器进行构建.
Meta
➜ google-apis-rs git:(clap) rustc --version
rustc 1.1.0-nightly (97d4e76c2 2015-04-27) (built 2015-04-28)