-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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() { }
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.