Emit errors or warning to user about recursion of display #125292
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-lint
Area: Lints (warnings about flaws in source code) such as unused_mut.
A-traits
Area: Trait system
L-unconditional_recursion
Lint: unconditional_recursion
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
code cause recursion stack overflow
Current output
Runtime error instead of compile time error at present
thread 'main' has overflowed its stack fatal runtime error: stack overflow
Desired output
In a large code base, such small mistake is hard to locate because it does not point out which recursion call cause stack overflow.
Rationale and extra context
:
as standalone formatter, and it is better the compiler to emit error to use:
as standalone formatter because it is likely user want to use:?
but drop?
by mistake,Other cases
No response
Rust Version
Anything else?
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=15e6928ea61ea7e8ac7072fa82875e97
The text was updated successfully, but these errors were encountered: