Skip to content
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

Don't show dead code warnings for functions local to dead code #11429

Closed
jorgeadriano opened this issue Jan 10, 2014 · 2 comments
Closed

Don't show dead code warnings for functions local to dead code #11429

jorgeadriano opened this issue Jan 10, 2014 · 2 comments

Comments

@jorgeadriano
Copy link

At the moment the following code triggers dead code warnings for both f and g. The latter is unnecessary.

fn f(){
   fn g(){};
   g();
}

rust version 0.9

@alexcrichton
Copy link
Member

Closing as a dupe of #11380, but thanks for the bug report!

The duplicate issue raises the same concerns of warning about dead code too much because you only care about the "roots" of the dead code.

@jorgeadriano
Copy link
Author

I did look at that one, but was not sure if it is the same issue.
Thanks for the quick reply.

flip1995 pushed a commit to flip1995/rust that referenced this issue Nov 2, 2023
suggest passing function instead of calling it in closure for [`option_if_let_else`]

fixes: rust-lang#11429

changelog: suggest passing function instead of calling it in closure for [`option_if_let_else`]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants