-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
unconditional_recursion
lint doesn't work with struct update syntax
#78474
Comments
I think this was caused by #70822, but it looks like expected behavior: If |
Though maybe the lint should assume that functions returning an inhabited type won't diverge (since otherwise they should be marked |
I personally feel that we should lint for functions if they don't return an uninhabited type. |
Thanks for the quick response. Yeah, it'd be natural to expect a function whose return type is not Probably, we might want to have the following rules?:
1 would help my case and 2 would help the case of #54444. (2 is not necessary, though.) |
Assigning |
Code
I tried this code which causes a stack overflow due to a recursive call of
Default::default()
I mistakenly added.I expected to see the
unconditional_recursion
warning. However, the compiler didn't complain it.Version it worked on
It most recently worked on: 1.43.0 showed the warning. (ref. the compiler explorer)
Version with regression
The warning isn't shown on 1.44.0 or later, including the current stable 1.47.0.
The text was updated successfully, but these errors were encountered: