Replies: 1 comment
-
I don't doubt that it's a worthwhile extension, however there are two things to keep in mind:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Rust's
unconditional_recursion
lint only works when a function calls itself directly. Thus it misses many cases of infinite recursions, including simple ones that can easily happen by accident. For example:(playground)
There are more examples in the tracking issue at rust-lang/rust#57965. Ideally, this should be fixed in
rustc
itself of course, which was tried in rust-lang/rust#75067. Unfortunately, the PR was closed because of its performance regressions.Given that stack overflow errors are always fatal and can be hard to debug, I thought that such a lint might be a good candidate for clippy, where performance doesn't matter that much.
Beta Was this translation helpful? Give feedback.
All reactions