Open
Description
I was playing around with recursion_limit
, and I realized that recursion_limit
doesn't check for bad values. #![recursion_limit = "malformed"] fn main() {}
, for example, compiles without error. Moreover, when set to 1
, the Rust compiler raises a weird error:
error[E0275]: overflow evaluating the requirement `&Self: std::ops::DispatchFromDyn<&RustaceansAreAwesome>`
|
= help: consider adding a `#![recursion_limit="2"]` attribute to your crate
error: aborting due to previous error
For more information about this error, try `rustc --explain E0275`.
What is RustaceansAreAwesome
? This code doesn't make any macro calls, yet somehow exceeds the recursion limit.
Version
rustc --version --verbose
:
rustc 1.41.0
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-unknown-linux-gnu
release: 1.41.0
LLVM version: 9.0
Code
#![recursion_limit = "1"]
fn main() { }