diff options
| author | Nick Cameron <ncameron@mozilla.com> | 2015-03-23 15:50:32 +1300 |
|---|---|---|
| committer | Nick Cameron <ncameron@mozilla.com> | 2015-03-25 10:06:13 +1300 |
| commit | 088cd566ea87c90a9c765a113a2310d60849e7c1 (patch) | |
| tree | 7f8d654b2d6b8957a239ad0579851eb51ec27749 | |
| parent | 9374c216f6040189301aeb043d317c12ffb17a0b (diff) | |
| download | rust-088cd566ea87c90a9c765a113a2310d60849e7c1.tar.gz rust-088cd566ea87c90a9c765a113a2310d60849e7c1.zip | |
Remove the UnusedCasts lint
| -rw-r--r-- | src/librustc_lint/builtin.rs | 24 | ||||
| -rw-r--r-- | src/librustc_lint/lib.rs | 1 |
2 files changed, 0 insertions, 25 deletions
diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs index ef82a465ef4..395460aca9f 100644 --- a/src/librustc_lint/builtin.rs +++ b/src/librustc_lint/builtin.rs @@ -85,30 +85,6 @@ impl LintPass for WhileTrue { } 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, "using an unary minus operator on unsigned type" diff --git a/src/librustc_lint/lib.rs b/src/librustc_lint/lib.rs index f2d2db18da4..e158541cd1c 100644 --- a/src/librustc_lint/lib.rs +++ b/src/librustc_lint/lib.rs @@ -89,7 +89,6 @@ pub fn register_builtins(store: &mut lint::LintStore, sess: Option<&Session>) { add_builtin!(sess, HardwiredLints, WhileTrue, - UnusedCasts, ImproperCTypes, BoxPointers, UnusedAttributes, |
