-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Emit errors or warning to user about recursion of display #125292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Macros, like the one you call there, are pretty good at obscuring these impl details, but yeah we should probably warn. |
I could have sworn there was a similar report about using @workingjubilee in the wild I've seen that simple cases where the chain repeats after just one or two jumps represent the bulk of them, so beyond the obfuscation issues, I'm convincing myself that a very limited call-graph analysis to look for unconditional recursivity is warranted. It's funny that it's always involving Edit: found it #45838 |
And regarding the 2nd suggestion, what is your view
|
Unlikely to work, there's probably a crate out there that uses it, so it can't be removed due to backward compatibility guarantees. |
can be a warnings? |
Yes, we can lint on that. In fact we already lint on a few bad |
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: