Recursion limit silently ignored if it overflows a usize
#67265
Labels
A-attributes
Area: Attributes (`#[…]`, `#![…]`)
C-bug
Category: This is a bug.
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
P-low
Low priority
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
The following code fails to compile since it exceeds the default recursion limit. Using
2056
as the recursion limit works as expected.This is because we don't check for integer overflow errors when parsing limits:
rust/src/librustc/middle/recursion_limit.rs
Lines 19 to 33 in e9469a6
There's a few options here. My preference would be to silently default to
usize::MAX
when overflow occurs.This issue has been assigned to @fisherdarling via this comment.
The text was updated successfully, but these errors were encountered: