]> git.lizzy.rs Git - rust.git/commitdiff
rustup 2015-09-24
authorManish Goregaokar <manishsmail@gmail.com>
Fri, 25 Sep 2015 13:22:36 +0000 (18:52 +0530)
committerManish Goregaokar <manishsmail@gmail.com>
Fri, 25 Sep 2015 13:22:36 +0000 (18:52 +0530)
Cargo.toml
src/consts.rs
src/shadow.rs

index 8a905ffac4233f3b1234ff1f809d3a66d04003bb..5ff911c8ced655140905f01ff4115f32f2569041 100644 (file)
@@ -1,6 +1,6 @@
 [package]
 name = "clippy"
-version = "0.0.16"
+version = "0.0.17"
 authors = [
        "Manish Goregaokar <manishsmail@gmail.com>",
        "Andre Bogus <bogusandre@gmail.com>",
index d66bfb5b4fc8ddbde448626721024025a0541e09..be681efb257f22db146f69b19eb5f04fd2bdca66 100644 (file)
@@ -321,7 +321,7 @@ fn expr(&mut self, e: &Expr) -> Option<Constant> {
                 |o| match op {
                     UnNot => constant_not(o),
                     UnNeg => constant_negate(o),
-                    UnUniq | UnDeref => Some(o),
+                    UnDeref => Some(o),
                 }),
             ExprBinary(op, ref left, ref right) =>
                 self.binop(op, left, right),
index 25970df399db90859d9f3acc08a5922e7425aa08..8fd8d0d15ac253172511b123de9386de8adf7fb1 100644 (file)
@@ -140,7 +140,7 @@ fn check_pat(cx: &LateContext, pat: &Pat, init: &Option<&Expr>, span: Span,
             },
         PatBox(ref inner) => {
             if let Some(ref initp) = *init {
-                if let ExprBox(_, ref inner_init) = initp.node {
+                if let ExprBox(ref inner_init) = initp.node {
                     check_pat(cx, inner, &Some(&**inner_init), span, bindings);
                 } else {
                     check_pat(cx, inner, init, span, bindings);
@@ -198,10 +198,8 @@ fn check_expr(cx: &LateContext, expr: &Expr, bindings: &mut Vec<(Name, Span)>) {
     if in_external_macro(cx, expr.span) { return; }
     match expr.node {
         ExprUnary(_, ref e) | ExprField(ref e, _) |
-        ExprTupField(ref e, _) | ExprAddrOf(_, ref e) | ExprBox(None, ref e)
+        ExprTupField(ref e, _) | ExprAddrOf(_, ref e) | ExprBox(ref e)
             => { check_expr(cx, e, bindings) },
-        ExprBox(Some(ref place), ref e) => {
-            check_expr(cx, place, bindings); check_expr(cx, e, bindings) }
         ExprBlock(ref block) | ExprLoop(ref block, _) =>
             { check_block(cx, block, bindings) },
         //ExprCall
@@ -254,11 +252,11 @@ fn check_ty(cx: &LateContext, ty: &Ty, bindings: &mut Vec<(Name, Span)>) {
 
 fn is_self_shadow(name: Name, expr: &Expr) -> bool {
     match expr.node {
-        ExprBox(_, ref inner) |
+        ExprBox(ref inner) |
         ExprAddrOf(_, ref inner) => is_self_shadow(name, inner),
         ExprBlock(ref block) => block.stmts.is_empty() && block.expr.as_ref().
             map_or(false, |ref e| is_self_shadow(name, e)),
-        ExprUnary(op, ref inner) => (UnUniq == op || UnDeref == op) &&
+        ExprUnary(op, ref inner) => (UnDeref == op) &&
             is_self_shadow(name, inner),
         ExprPath(_, ref path) => path_eq_name(name, path),
         _ => false,
@@ -278,7 +276,7 @@ fn contains_self(name: Name, expr: &Expr) -> bool {
         ExprLit(_) => false,
         // one subexpr
         ExprUnary(_, ref e) | ExprField(ref e, _) |
-        ExprTupField(ref e, _) | ExprAddrOf(_, ref e) | ExprBox(_, ref e) |
+        ExprTupField(ref e, _) | ExprAddrOf(_, ref e) | ExprBox(ref e) |
         ExprCast(ref e, _) =>
             contains_self(name, e),
         // two subexprs