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

Hide unused variable diagnostic when `unimplemented` macro is used #57328

Closed
czipperz opened this issue Jan 4, 2019 · 4 comments
Closed

Hide unused variable diagnostic when `unimplemented` macro is used #57328

czipperz opened this issue Jan 4, 2019 · 4 comments
Labels

Comments

@czipperz
Copy link
Contributor

@czipperz czipperz commented Jan 4, 2019

It is obnoxious to be doing TDD and get unused variable warnings clogging up the output because I haven't yet implemented the function. Can we hide unused variable diagnostics if that variable's scope includes an unimplemented macro? This could be even hidden behind a flag if need be.

Example:

pub fn f(i: usize) {
    unimplemented!()
}

Generates:

warning: unused variable: `i`
 --> src/f.rs:1:10
  |
1 | pub fn f(i: usize) {
  |          ^ help: consider using `_i` instead
  |
  = note: #[warn(unused_variables)] on by default

I can just disable unused variables warnings, but I would like to keep them on generally.

@czipperz

This comment has been minimized.

Copy link
Contributor Author

@czipperz czipperz commented Jan 4, 2019

For a similar reason, hiding unused_mut warnings would also be nice if unimplemented is encountered.

@ylxdzsw

This comment has been minimized.

Copy link

@ylxdzsw ylxdzsw commented Jun 16, 2019

I think there is already an RFC for this.

@pickfire

This comment has been minimized.

Copy link
Contributor

@pickfire pickfire commented Apr 5, 2020

The RFC is closed, should this issue still be opened?

@czipperz

This comment has been minimized.

Copy link
Contributor Author

@czipperz czipperz commented Apr 6, 2020

Agreed, closed.

@czipperz czipperz closed this Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.