-// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
use crate::utils::{get_parent_expr, in_macro, snippet, span_lint_and_then, span_note_and_lint};
use crate::utils::{SpanlessEq, SpanlessHash};
use rustc::hir::*;
fn get_lints(&self) -> LintArray {
lint_array![IFS_SAME_COND, IF_SAME_THEN_ELSE, MATCH_SAME_ARMS]
}
+
+ fn name(&self) -> &'static str {
+ "CopyAndPaste"
+ }
}
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for CopyAndPaste {
|db| {
db.span_note(i.body.span, "same as this");
- // Note: this does not use `span_suggestion_with_applicability` on purpose:
+ // Note: this does not use `span_suggestion` on purpose:
// there is no clean way
// to remove the other arm. Building a span and suggest to replace it to ""
// makes an even more confusing error message. Also in order not to make up a
bindings_impl(cx, pat, map);
}
},
- PatKind::Binding(_, _, ident, ref as_pat) => {
+ PatKind::Binding(.., ident, ref as_pat) => {
if let Entry::Vacant(v) = map.entry(ident.as_str()) {
v.insert(cx.tables.pat_ty(pat));
}