We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Currently rustc will allow you to silently ignore return values:
fn hi() -> int { 1 } fn main() { hi(); }
This has the potential to introduce subtle bugs to code. Perhaps it would be a good idea to have a warning like:
test.rs:4:9: 4:14 warning: unused variable: `x`, #[warn(ignored_return_values)] on by default. Use `let _ = hi();` to silence. test.rs:4 hi(); ^~~~~
This lint could be disabled using #[allow(ignored_return_values)].
#[allow(ignored_return_values)]
The text was updated successfully, but these errors were encountered:
Closing as a dupe of #2974, but certainly an interesting idea! Tricky to get right...
Sorry, something went wrong.
Woops, sorry about that!
No branches or pull requests
Currently rustc will allow you to silently ignore return values:
This has the potential to introduce subtle bugs to code. Perhaps it would be a good idea to have a warning like:
This lint could be disabled using
#[allow(ignored_return_values)]
.The text was updated successfully, but these errors were encountered: