Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rustup to https://github.com/rust-lang/rust/pull/58805 #3911

Merged
merged 1 commit into from
Apr 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions clippy_lints/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions tests/ui/use_self.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/ui/use_self.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions tests/ui/use_self.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down