Skip to content

Commit b8c75e5

Browse files
committed
Remove the UnusedCasts lint
1 parent a41d32f commit b8c75e5

File tree

2 files changed

+0
-25
lines changed

2 files changed

+0
-25
lines changed

src/librustc_lint/builtin.rs

-24
Original file line numberDiff line numberDiff line change
@@ -84,30 +84,6 @@ impl LintPass for WhileTrue {
8484
}
8585
}
8686

87-
declare_lint! {
88-
UNUSED_TYPECASTS,
89-
Allow,
90-
"detects unnecessary type casts that can be removed"
91-
}
92-
93-
#[derive(Copy)]
94-
pub struct UnusedCasts;
95-
96-
impl LintPass for UnusedCasts {
97-
fn get_lints(&self) -> LintArray {
98-
lint_array!(UNUSED_TYPECASTS)
99-
}
100-
101-
fn check_expr(&mut self, cx: &Context, e: &ast::Expr) {
102-
if let ast::ExprCast(ref expr, ref ty) = e.node {
103-
let t_t = ty::expr_ty(cx.tcx, e);
104-
if ty::expr_ty(cx.tcx, &**expr) == t_t {
105-
cx.span_lint(UNUSED_TYPECASTS, ty.span, "unnecessary type cast");
106-
}
107-
}
108-
}
109-
}
110-
11187
declare_lint! {
11288
UNSIGNED_NEGATION,
11389
Warn,

src/librustc_lint/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ pub fn register_builtins(store: &mut lint::LintStore, sess: Option<&Session>) {
9090
add_builtin!(sess,
9191
HardwiredLints,
9292
WhileTrue,
93-
UnusedCasts,
9493
ImproperCTypes,
9594
BoxPointers,
9695
UnusedAttributes,

0 commit comments

Comments
 (0)