Skip to content

Commit

Permalink
Improve needless_borrowed_ref lint comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
CBenoit authored and oli-obk committed Aug 21, 2017
1 parent 0063309 commit 2460454
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clippy_lints/src/needless_borrowed_ref.rs
Expand Up @@ -48,11 +48,11 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NeedlessBorrowedRef {

if_let_chain! {[
// Pat is a pattern whose node
// is a binding which "involves" a immutable reference...
// is a binding which "involves" an immutable reference...
let PatKind::Binding(BindingAnnotation::Ref, ..) = pat.node,
// Pattern's type is a reference. Get the type and mutability of referenced value (tam: TypeAndMut).
let ty::TyRef(_, ref tam) = cx.tables.pat_ty(pat).sty,
// This is an immutable reference.
// Only lint immutable refs, because `&mut ref T` may be useful.
tam.mutbl == MutImmutable,
], {
span_lint(cx, NEEDLESS_BORROWED_REFERENCE, pat.span, "this pattern takes a reference on something that is being de-referenced")
Expand Down

0 comments on commit 2460454

Please sign in to comment.