diff --git a/clippy_lints/src/types.rs b/clippy_lints/src/types.rs index 33dea622b358..95609d3f3029 100644 --- a/clippy_lints/src/types.rs +++ b/clippy_lints/src/types.rs @@ -1533,7 +1533,7 @@ impl LintPass for CharLitAsU8 { impl<'a, 'tcx> LateLintPass<'a, 'tcx> for CharLitAsU8 { fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) { - use syntax::ast::{LitKind, UintTy}; + use syntax::ast::LitKind; if let ExprKind::Cast(ref e, _) = expr.node { if let ExprKind::Lit(ref l) = e.node { @@ -1818,7 +1818,6 @@ impl Ord for FullInt { fn numeric_cast_precast_bounds<'a>(cx: &LateContext<'_, '_>, expr: &'a Expr) -> Option<(FullInt, FullInt)> { use std::*; - use syntax::ast::{IntTy, UintTy}; if let ExprKind::Cast(ref cast_exp, _) = expr.node { let pre_cast_ty = cx.tables.expr_ty(cast_exp); diff --git a/tests/ui/use_self.fixed b/tests/ui/use_self.fixed index 730d391848ec..68af85030ab2 100644 --- a/tests/ui/use_self.fixed +++ b/tests/ui/use_self.fixed @@ -239,6 +239,7 @@ mod nesting { struct Foo {} impl Foo { fn foo() { + #[allow(unused_imports)] use self::Foo; // Can't use Self here struct Bar { foo: Foo, // Foo != Self diff --git a/tests/ui/use_self.rs b/tests/ui/use_self.rs index 008247315121..7a6d415528ad 100644 --- a/tests/ui/use_self.rs +++ b/tests/ui/use_self.rs @@ -239,6 +239,7 @@ mod nesting { struct Foo {} impl Foo { fn foo() { + #[allow(unused_imports)] use self::Foo; // Can't use Self here struct Bar { foo: Foo, // Foo != Self diff --git a/tests/ui/use_self.stderr b/tests/ui/use_self.stderr index 6e39a28012a8..bf1f41fd64ed 100644 --- a/tests/ui/use_self.stderr +++ b/tests/ui/use_self.stderr @@ -151,43 +151,43 @@ LL | use_self_expand!(); // Should lint in local macros | ------------------- in this macro invocation error: unnecessary structure name repetition - --> $DIR/use_self.rs:260:21 + --> $DIR/use_self.rs:261:21 | LL | fn baz() -> Foo { | ^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> $DIR/use_self.rs:261:13 + --> $DIR/use_self.rs:262:13 | LL | Foo {} | ^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> $DIR/use_self.rs:248:29 + --> $DIR/use_self.rs:249:29 | LL | fn bar() -> Bar { | ^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> $DIR/use_self.rs:249:21 + --> $DIR/use_self.rs:250:21 | LL | Bar { foo: Foo {} } | ^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> $DIR/use_self.rs:303:13 + --> $DIR/use_self.rs:304:13 | LL | nested::A::fun_1(); | ^^^^^^^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> $DIR/use_self.rs:304:13 + --> $DIR/use_self.rs:305:13 | LL | nested::A::A; | ^^^^^^^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> $DIR/use_self.rs:306:13 + --> $DIR/use_self.rs:307:13 | LL | nested::A {}; | ^^^^^^^^^ help: use the applicable keyword: `Self`