]> git.lizzy.rs Git - rust.git/commitdiff
Remove the UnusedCasts lint
authorNick Cameron <ncameron@mozilla.com>
Mon, 23 Mar 2015 02:50:32 +0000 (15:50 +1300)
committerNick Cameron <ncameron@mozilla.com>
Tue, 24 Mar 2015 21:06:13 +0000 (10:06 +1300)
src/librustc_lint/builtin.rs
src/librustc_lint/lib.rs

index ef82a465ef4bf9944093a8bab32f72e37b8c0551..395460aca9fe987401d7f1925ecdcc4e49229cf2 100644 (file)
@@ -84,30 +84,6 @@ fn check_expr(&mut self, cx: &Context, e: &ast::Expr) {
     }
 }
 
-declare_lint! {
-    UNUSED_TYPECASTS,
-    Allow,
-    "detects unnecessary type casts that can be removed"
-}
-
-#[derive(Copy)]
-pub struct UnusedCasts;
-
-impl LintPass for UnusedCasts {
-    fn get_lints(&self) -> LintArray {
-        lint_array!(UNUSED_TYPECASTS)
-    }
-
-    fn check_expr(&mut self, cx: &Context, e: &ast::Expr) {
-        if let ast::ExprCast(ref expr, ref ty) = e.node {
-            let t_t = ty::expr_ty(cx.tcx, e);
-            if ty::expr_ty(cx.tcx, &**expr) == t_t {
-                cx.span_lint(UNUSED_TYPECASTS, ty.span, "unnecessary type cast");
-            }
-        }
-    }
-}
-
 declare_lint! {
     UNSIGNED_NEGATION,
     Warn,
index f2d2db18da4b5e20496ea464bd0c714dce5fd186..e158541cd1cfffe8471fc3a9662070de078949c1 100644 (file)
@@ -89,7 +89,6 @@ macro_rules! add_lint_group {
     add_builtin!(sess,
                  HardwiredLints,
                  WhileTrue,
-                 UnusedCasts,
                  ImproperCTypes,
                  BoxPointers,
                  UnusedAttributes,