Skip to content

Lint for unused borrows as part of UNUSED_MUST_USE #76894

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
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Lint for unused borrows as part of unused_must_use
  • Loading branch information
ecstatic-morse committed Sep 21, 2020
commit 222fb63113a7593b6db12ee9d14684159f669636
3 changes: 3 additions & 0 deletions compiler/rustc_lint/src/unused.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ impl<'tcx> LateLintPass<'tcx> for UnusedResults {
| hir::BinOpKind::Shl
| hir::BinOpKind::Shr => Some("bitwise operation"),
},

hir::ExprKind::AddrOf(..) => Some("borrow"),

hir::ExprKind::Unary(..) => Some("unary operation"),
_ => None,
};
Expand Down