Source: rust-recursive Section: rust Build-Depends: debhelper-compat (= 13), dh-sequence-cargo Build-Depends-Arch: cargo:native , rustc:native , libstd-rust-dev , librust-recursive-proc-macro-impl-0.1+default-dev (<< 0.1.2) , librust-recursive-proc-macro-impl-0.1+default-dev (>= 0.1.1) , librust-stacker-0.1+default-dev Maintainer: Debian Rust Maintainers Uploaders: Steffen Moeller Standards-Version: 4.7.4 Vcs-Git: https://salsa.debian.org/rust-team/debcargo-conf.git [src/recursive] Vcs-Browser: https://salsa.debian.org/rust-team/debcargo-conf/tree/master/src/recursive Homepage: https://github.com/orlp/recursive X-Cargo-Crate: recursive X-Cargo-Crate-Version: 0.1.1 Package: librust-recursive-dev Architecture: any Multi-Arch: same Depends: ${misc:Depends}, librust-recursive-proc-macro-impl-0.1+default-dev (<< 0.1.2), librust-recursive-proc-macro-impl-0.1+default-dev (>= 0.1.1), librust-stacker-0.1+default-dev Provides: librust-recursive+default-dev (= ${binary:Version}), librust-recursive-0-dev (= ${binary:Version}), librust-recursive-0+default-dev (= ${binary:Version}), librust-recursive-0.1-dev (= ${binary:Version}), librust-recursive-0.1+default-dev (= ${binary:Version}), librust-recursive-0.1.1-dev (= ${binary:Version}), librust-recursive-0.1.1+default-dev (= ${binary:Version}) Description: recursions in Rust secured from stack overflows - Rust source code Rust has a problematic relationship with recursive functions, because functions that recurse deeply can overflow the stack, crashing your program. This crate makes it easy to remedy this problem by marking (indirectly) recursive functions as such: . use recursive::recursive; . #[recursive] fn sum(nums: &[u64]) -> u64 { if let Some((head, tail)) = nums.split_first() { head + sum(tail) } else { 0 } } . The way this prevents stack overflows is by checking the size of the remaining stack at the start of each call to your function. If this size is under a boundary set by set_minimum_stack_size (by default 128 KiB), a new stack is allocated and execution continues on that stack. This new stack’s size is set using set_stack_allocation_size, which is 2 MiB by default. . This crate works by wrapping your function body in a call to stacker::maybe_grow. If this crate is not flexible enough for your needs consider using stacker directly yourself. Source code for Debianized Rust crate "recursive"