Skip to content

Commit 70c0f90

Browse files
committed
Auto merge of #6718 - flip1995:rustup, r=flip1995
Rustup r? `@ghost` changelog: none
2 parents 8dbcffe + 4efc454 commit 70c0f90

39 files changed

+84
-95
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "clippy"
3-
version = "0.1.51"
3+
version = "0.1.52"
44
authors = [
55
"Manish Goregaokar <manishsmail@gmail.com>",
66
"Andre Bogus <bogusandre@gmail.com>",

clippy_lints/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "clippy_lints"
33
# begin automatic update
4-
version = "0.1.51"
4+
version = "0.1.52"
55
# end automatic update
66
authors = [
77
"Manish Goregaokar <manishsmail@gmail.com>",

clippy_lints/src/arithmetic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ impl<'tcx> LateLintPass<'tcx> for Arithmetic {
9191
match op.node {
9292
hir::BinOpKind::Div | hir::BinOpKind::Rem => match &r.kind {
9393
hir::ExprKind::Lit(_lit) => (),
94-
hir::ExprKind::Unary(hir::UnOp::UnNeg, expr) => {
94+
hir::ExprKind::Unary(hir::UnOp::Neg, expr) => {
9595
if let hir::ExprKind::Lit(lit) = &expr.kind {
9696
if let rustc_ast::ast::LitKind::Int(1, _) = lit.node {
9797
span_lint(cx, INTEGER_ARITHMETIC, expr.span, "integer arithmetic detected");
@@ -114,7 +114,7 @@ impl<'tcx> LateLintPass<'tcx> for Arithmetic {
114114
self.expr_span = Some(expr.span);
115115
}
116116
},
117-
hir::ExprKind::Unary(hir::UnOp::UnNeg, arg) => {
117+
hir::ExprKind::Unary(hir::UnOp::Neg, arg) => {
118118
let ty = cx.typeck_results().expr_ty(arg);
119119
if constant_simple(cx, cx.typeck_results(), expr).is_none() {
120120
if ty.is_integral() {

clippy_lints/src/assertions_on_constants.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ enum AssertKind {
112112
fn match_assert_with_message<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) -> Option<AssertKind> {
113113
if_chain! {
114114
if let ExprKind::If(ref cond, ref then, _) = expr.kind;
115-
if let ExprKind::Unary(UnOp::UnNot, ref expr) = cond.kind;
115+
if let ExprKind::Unary(UnOp::Not, ref expr) = cond.kind;
116116
// bind the first argument of the `assert!` macro
117117
if let Some((Constant::Bool(is_true), _)) = constant(cx, cx.typeck_results(), expr);
118118
// block

clippy_lints/src/booleans.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ impl<'a, 'tcx, 'v> Hir2Qmm<'a, 'tcx, 'v> {
110110
// prevent folding of `cfg!` macros and the like
111111
if !e.span.from_expansion() {
112112
match &e.kind {
113-
ExprKind::Unary(UnOp::UnNot, inner) => return Ok(Bool::Not(box self.run(inner)?)),
113+
ExprKind::Unary(UnOp::Not, inner) => return Ok(Bool::Not(box self.run(inner)?)),
114114
ExprKind::Binary(binop, lhs, rhs) => match &binop.node {
115115
BinOpKind::Or => {
116116
return Ok(Bool::Or(self.extract(BinOpKind::Or, &[lhs, rhs], Vec::new())?));
@@ -454,7 +454,7 @@ impl<'a, 'tcx> Visitor<'tcx> for NonminimalBoolVisitor<'a, 'tcx> {
454454
ExprKind::Binary(binop, _, _) if binop.node == BinOpKind::Or || binop.node == BinOpKind::And => {
455455
self.bool_expr(e)
456456
},
457-
ExprKind::Unary(UnOp::UnNot, inner) => {
457+
ExprKind::Unary(UnOp::Not, inner) => {
458458
if self.cx.typeck_results().node_types()[inner.hir_id].is_bool() {
459459
self.bool_expr(e);
460460
} else {
@@ -482,7 +482,7 @@ impl<'a, 'tcx> Visitor<'tcx> for NotSimplificationVisitor<'a, 'tcx> {
482482
type Map = Map<'tcx>;
483483

484484
fn visit_expr(&mut self, expr: &'tcx Expr<'_>) {
485-
if let ExprKind::Unary(UnOp::UnNot, inner) = &expr.kind {
485+
if let ExprKind::Unary(UnOp::Not, inner) = &expr.kind {
486486
if let Some(suggestion) = simplify_not(self.cx, inner) {
487487
span_lint_and_sugg(
488488
self.cx,

clippy_lints/src/bytecount.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ fn check_arg(name: Symbol, arg: Symbol, needle: &Expr<'_>) -> bool {
101101

102102
fn get_path_name(expr: &Expr<'_>) -> Option<Symbol> {
103103
match expr.kind {
104-
ExprKind::Box(ref e) | ExprKind::AddrOf(BorrowKind::Ref, _, ref e) | ExprKind::Unary(UnOp::UnDeref, ref e) => {
104+
ExprKind::Box(ref e) | ExprKind::AddrOf(BorrowKind::Ref, _, ref e) | ExprKind::Unary(UnOp::Deref, ref e) => {
105105
get_path_name(e)
106106
},
107107
ExprKind::Block(ref b, _) => {

clippy_lints/src/collapsible_match.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ fn strip_ref_operators<'hir>(mut expr: &'hir Expr<'hir>, typeck_results: &Typeck
180180
loop {
181181
match expr.kind {
182182
ExprKind::AddrOf(_, _, e) => expr = e,
183-
ExprKind::Unary(UnOp::UnDeref, e) if typeck_results.expr_ty(e).is_ref() => expr = e,
183+
ExprKind::Unary(UnOp::Deref, e) if typeck_results.expr_ty(e).is_ref() => expr = e,
184184
_ => break,
185185
}
186186
}

clippy_lints/src/consts.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,9 @@ impl<'a, 'tcx> ConstEvalLateContext<'a, 'tcx> {
242242
self.expr(value).map(|v| Constant::Repeat(Box::new(v), n))
243243
},
244244
ExprKind::Unary(op, ref operand) => self.expr(operand).and_then(|o| match op {
245-
UnOp::UnNot => self.constant_not(&o, self.typeck_results.expr_ty(e)),
246-
UnOp::UnNeg => self.constant_negate(&o, self.typeck_results.expr_ty(e)),
247-
UnOp::UnDeref => Some(if let Constant::Ref(r) = o { *r } else { o }),
245+
UnOp::Not => self.constant_not(&o, self.typeck_results.expr_ty(e)),
246+
UnOp::Neg => self.constant_negate(&o, self.typeck_results.expr_ty(e)),
247+
UnOp::Deref => Some(if let Constant::Ref(r) = o { *r } else { o }),
248248
}),
249249
ExprKind::If(ref cond, ref then, ref otherwise) => self.ifthenelse(cond, then, *otherwise),
250250
ExprKind::Binary(op, ref left, ref right) => self.binop(op, left, right),

clippy_lints/src/entry.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ declare_lint_pass!(HashMapPass => [MAP_ENTRY]);
5555
impl<'tcx> LateLintPass<'tcx> for HashMapPass {
5656
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
5757
if let ExprKind::If(ref check, ref then_block, ref else_block) = expr.kind {
58-
if let ExprKind::Unary(UnOp::UnNot, ref check) = check.kind {
58+
if let ExprKind::Unary(UnOp::Not, ref check) = check.kind {
5959
if let Some((ty, map, key)) = check_cond(cx, check) {
6060
// in case of `if !m.contains_key(&k) { m.insert(k, v); }`
6161
// we can give a better error message

clippy_lints/src/floating_point_arithmetic.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ fn get_specialized_log_method(cx: &LateContext<'_>, base: &Expr<'_>) -> Option<&
129129
fn prepare_receiver_sugg<'a>(cx: &LateContext<'_>, mut expr: &'a Expr<'a>) -> Sugg<'a> {
130130
let mut suggestion = Sugg::hir(cx, expr, "..");
131131

132-
if let ExprKind::Unary(UnOp::UnNeg, inner_expr) = &expr.kind {
132+
if let ExprKind::Unary(UnOp::Neg, inner_expr) = &expr.kind {
133133
expr = &inner_expr;
134134
}
135135

@@ -541,12 +541,12 @@ fn is_zero(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {
541541
/// If the two expressions are not negations of each other, then it
542542
/// returns None.
543543
fn are_negated<'a>(cx: &LateContext<'_>, expr1: &'a Expr<'a>, expr2: &'a Expr<'a>) -> Option<(bool, &'a Expr<'a>)> {
544-
if let ExprKind::Unary(UnOp::UnNeg, expr1_negated) = &expr1.kind {
544+
if let ExprKind::Unary(UnOp::Neg, expr1_negated) = &expr1.kind {
545545
if eq_expr_value(cx, expr1_negated, expr2) {
546546
return Some((false, expr2));
547547
}
548548
}
549-
if let ExprKind::Unary(UnOp::UnNeg, expr2_negated) = &expr2.kind {
549+
if let ExprKind::Unary(UnOp::Neg, expr2_negated) = &expr2.kind {
550550
if eq_expr_value(cx, expr1, expr2_negated) {
551551
return Some((true, expr1));
552552
}

0 commit comments

Comments
 (0)