Skip to content

Commit

Permalink
Remove the UnusedCasts lint
Browse files Browse the repository at this point in the history
  • Loading branch information
nrc committed Mar 24, 2015
1 parent 9374c21 commit 088cd56
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
24 changes: 0 additions & 24 deletions src/librustc_lint/builtin.rs
Expand Up @@ -84,30 +84,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,
Expand Down
1 change: 0 additions & 1 deletion src/librustc_lint/lib.rs
Expand Up @@ -89,7 +89,6 @@ pub fn register_builtins(store: &mut lint::LintStore, sess: Option<&Session>) {
add_builtin!(sess,
HardwiredLints,
WhileTrue,
UnusedCasts,
ImproperCTypes,
BoxPointers,
UnusedAttributes,
Expand Down

0 comments on commit 088cd56

Please sign in to comment.