Remove the UnusedCasts lint
This commit is contained in:
parent
9374c216f6
commit
088cd566ea
2 changed files with 0 additions and 25 deletions
|
@ -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,
|
||||
|
|
|
@ -89,7 +89,6 @@ pub fn register_builtins(store: &mut lint::LintStore, sess: Option<&Session>) {
|
|||
add_builtin!(sess,
|
||||
HardwiredLints,
|
||||
WhileTrue,
|
||||
UnusedCasts,
|
||||
ImproperCTypes,
|
||||
BoxPointers,
|
||||
UnusedAttributes,
|
||||
|
|
Loading…
Reference in a new issue