This commit is contained in:
Philipp Hansch 2019-04-01 07:19:05 +02:00 committed by flip1995
parent 414c34c300
commit b253c564d5
No known key found for this signature in database
GPG Key ID: 693086869D506637
4 changed files with 10 additions and 9 deletions

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -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`