Skip to content

New Lint: parameter of function only used in recursive call #2624

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

Closed
flip1995 opened this issue Apr 3, 2018 · 2 comments
Closed

New Lint: parameter of function only used in recursive call #2624

flip1995 opened this issue Apr 3, 2018 · 2 comments
Labels
A-lint Area: New lints L-unnecessary Lint: Warn about unnecessary code

Comments

@flip1995
Copy link
Member

flip1995 commented Apr 3, 2018

If a parameter of a function is only used in a recursive call of this functions body, it is probably unintended and useless:

fn rec_fn(a: i32) {
    //some conditions, no a... 
    rec_fn(a) 
} 

See also #2622 (comment)

@phansch phansch added A-lint Area: New lints L-unnecessary Lint: Warn about unnecessary code labels Apr 10, 2018
@jamesmcm
Copy link
Contributor

This should be addressed by #8422

@xFrednet
Copy link
Member

Thank you for pointing that out @jamesmcm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: New lints L-unnecessary Lint: Warn about unnecessary code
Projects
None yet
Development

No branches or pull requests

4 participants