I think that's a very rust thing.
When I used to write more haskell, it was way more natural to use recursion or recursion-like things.
It always reminds me of interior vs. exterior iterators. Exterior ones are more natural in rust. You don't have e.g. Monads to use for the function you pass in.
I have found I am currently incapable of writing programs in functional programming languages. My first thought is always "how is this represented in memory" 😅
Hah, I felt so stupid the other way around when I started writing rust :D I was constantly battling the borrow checker, not understanding that it told me it can't figure out when to drop sth/prevented me from use-after-free.
To cover it fully you'd need to analyze the entire call graph of a function which seems quite expensive for a lint. But yes some tooling to find all recursion points in a program sounds nice to have
Comments
When I used to write more haskell, it was way more natural to use recursion or recursion-like things.
It always reminds me of interior vs. exterior iterators. Exterior ones are more natural in rust. You don't have e.g. Monads to use for the function you pass in.
I guess it's already there in some form for async functions. Would be cool to expose as a pedantic clippy lint `clippy::recursion`