Function syntex::with_extra_stack [] [src]

pub fn with_extra_stack<F, T>(f: F) -> T where
    F: Send + 'static + FnOnce() -> T,
    T: Send + 'static, 

Runs a function in a thread with extra stack space (16 MB or $RUST_MIN_STACK if set).

The Rust parser uses a lot of stack space so codegen sometimes requires more than is available by default.

syntex::with_extra_stack(move || {
    let mut reg = syntex::Registry::new();
    reg.add_decorator(/* ... */);
    reg.expand("", src, dst)
})

This function runs with a 16 MB stack by default but a different value can be set by the RUST_MIN_STACK environment variable.