Skip to content

Commit f3bb161

Browse files
flip1995Manishearth
authored andcommitted
Adapt codebase to the tool_lints
1 parent cfd4c53 commit f3bb161

25 files changed

+39
-38
lines changed

clippy_lints/src/assign_ops.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AssignOps {
108108
},
109109
hir::ExprKind::Assign(ref assignee, ref e) => {
110110
if let hir::ExprKind::Binary(op, ref l, ref r) = e.node {
111-
#[allow(cyclomatic_complexity)]
111+
#[allow(clippy::cyclomatic_complexity)]
112112
let lint = |assignee: &hir::Expr, rhs: &hir::Expr| {
113113
let ty = cx.tables.expr_ty(assignee);
114114
let rty = cx.tables.expr_ty(rhs);

clippy_lints/src/booleans.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ impl<'a, 'tcx, 'v> Hir2Qmm<'a, 'tcx, 'v> {
118118
}
119119
for (n, expr) in self.terminals.iter().enumerate() {
120120
if SpanlessEq::new(self.cx).ignore_fn().eq_expr(e, expr) {
121-
#[allow(cast_possible_truncation)]
121+
#[allow(clippy::cast_possible_truncation)]
122122
return Ok(Bool::Term(n as u8));
123123
}
124124
let negated = match e.node {
@@ -150,14 +150,14 @@ impl<'a, 'tcx, 'v> Hir2Qmm<'a, 'tcx, 'v> {
150150
_ => continue,
151151
};
152152
if SpanlessEq::new(self.cx).ignore_fn().eq_expr(&negated, expr) {
153-
#[allow(cast_possible_truncation)]
153+
#[allow(clippy::cast_possible_truncation)]
154154
return Ok(Bool::Not(Box::new(Bool::Term(n as u8))));
155155
}
156156
}
157157
let n = self.terminals.len();
158158
self.terminals.push(e);
159159
if n < 32 {
160-
#[allow(cast_possible_truncation)]
160+
#[allow(clippy::cast_possible_truncation)]
161161
Ok(Bool::Term(n as u8))
162162
} else {
163163
Err("too many literals".to_owned())

clippy_lints/src/consts.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#![allow(cast_possible_truncation)]
2-
#![allow(float_cmp)]
1+
#![allow(clippy::float_cmp)]
32

43
use rustc::lint::LateContext;
54
use rustc::{span_bug, bug};

clippy_lints/src/cyclomatic_complexity.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ impl<'a, 'tcx> Visitor<'tcx> for CCHelper<'a, 'tcx> {
186186
}
187187

188188
#[cfg(feature = "debugging")]
189-
#[allow(too_many_arguments)]
189+
#[allow(clippy::too_many_arguments)]
190190
fn report_cc_bug(_: &LateContext<'_, '_>, cc: u64, narms: u64, div: u64, shorts: u64, returns: u64, span: Span, _: NodeId) {
191191
span_bug!(
192192
span,
@@ -200,7 +200,7 @@ fn report_cc_bug(_: &LateContext<'_, '_>, cc: u64, narms: u64, div: u64, shorts:
200200
);
201201
}
202202
#[cfg(not(feature = "debugging"))]
203-
#[allow(too_many_arguments)]
203+
#[allow(clippy::too_many_arguments)]
204204
fn report_cc_bug(cx: &LateContext<'_, '_>, cc: u64, narms: u64, div: u64, shorts: u64, returns: u64, span: Span, id: NodeId) {
205205
if !is_allowed(cx, CYCLOMATIC_COMPLEXITY, id) {
206206
cx.sess().span_note_without_error(

clippy_lints/src/doc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ impl<'a> Iterator for Parser<'a> {
8686
/// `syntax::parse::lexer::comments::strip_doc_comment_decoration` because we
8787
/// need to keep track of
8888
/// the spans but this function is inspired from the later.
89-
#[allow(cast_possible_truncation)]
89+
#[allow(clippy::cast_possible_truncation)]
9090
pub fn strip_doc_comment_decoration(comment: &str, span: Span) -> (String, Vec<(usize, Span)>) {
9191
// one-line comments lose their prefix
9292
const ONELINERS: &[&str] = &["///!", "///", "//!", "//"];

clippy_lints/src/enum_clike.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ impl LintPass for UnportableVariant {
4343
}
4444

4545
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnportableVariant {
46-
#[allow(cast_possible_truncation, cast_sign_loss)]
46+
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
4747
fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
4848
if cx.tcx.data_layout.pointer_size.bits() != 64 {
4949
return;

clippy_lints/src/enum_variants.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ fn partial_rmatch(post: &str, name: &str) -> usize {
147147
}
148148

149149
// FIXME: #600
150-
#[allow(while_let_on_iterator)]
150+
#[allow(clippy::while_let_on_iterator)]
151151
fn check_variant(
152152
cx: &EarlyContext<'_>,
153153
threshold: u64,

clippy_lints/src/eq_op.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EqOp {
8383
BinOpKind::Lt | BinOpKind::Le | BinOpKind::Ge | BinOpKind::Gt => (cx.tcx.lang_items().ord_trait(), true),
8484
};
8585
if let Some(trait_id) = trait_id {
86-
#[allow(match_same_arms)]
86+
#[allow(clippy::match_same_arms)]
8787
match (&left.node, &right.node) {
8888
// do not suggest to dereference literals
8989
(&ExprKind::Lit(..), _) | (_, &ExprKind::Lit(..)) => {},

clippy_lints/src/identity_op.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for IdentityOp {
5959
}
6060
}
6161

62-
#[allow(cast_possible_wrap)]
62+
#[allow(clippy::cast_possible_wrap)]
6363
fn check(cx: &LateContext<'_, '_>, e: &Expr, m: i8, span: Span, arg: Span) {
6464
if let Some(Constant::Int(v)) = constant_simple(cx, cx.tables, e) {
6565
let check = match cx.tables.expr_ty(e).sty {

clippy_lints/src/int_plus_one.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ enum Side {
5353
}
5454

5555
impl IntPlusOne {
56-
#[allow(cast_sign_loss)]
56+
#[allow(clippy::cast_sign_loss)]
5757
fn check_lit(&self, lit: &Lit, target_value: i128) -> bool {
5858
if let LitKind::Int(value, ..) = lit.node {
5959
return value == (target_value as u128);

0 commit comments

Comments
 (0)