mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 21:23:56 +00:00
Auto merge of #4538 - mikerite:fix-3567, r=flip1995
Verify that issue #3567 is resolved Closes #3567 changelog: none
This commit is contained in:
commit
30c75ed5b3
3 changed files with 45 additions and 1 deletions
|
@ -313,3 +313,22 @@ mod rustfix {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
mod issue3567 {
|
||||
struct TestStruct {}
|
||||
impl TestStruct {
|
||||
fn from_something() -> Self {
|
||||
Self {}
|
||||
}
|
||||
}
|
||||
|
||||
trait Test {
|
||||
fn test() -> TestStruct;
|
||||
}
|
||||
|
||||
impl Test for TestStruct {
|
||||
fn test() -> TestStruct {
|
||||
Self::from_something()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -313,3 +313,22 @@ mod rustfix {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
mod issue3567 {
|
||||
struct TestStruct {}
|
||||
impl TestStruct {
|
||||
fn from_something() -> Self {
|
||||
Self {}
|
||||
}
|
||||
}
|
||||
|
||||
trait Test {
|
||||
fn test() -> TestStruct;
|
||||
}
|
||||
|
||||
impl Test for TestStruct {
|
||||
fn test() -> TestStruct {
|
||||
TestStruct::from_something()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -216,5 +216,11 @@ error: unnecessary structure name repetition
|
|||
LL | nested::A {};
|
||||
| ^^^^^^^^^ help: use the applicable keyword: `Self`
|
||||
|
||||
error: aborting due to 35 previous errors
|
||||
error: unnecessary structure name repetition
|
||||
--> $DIR/use_self.rs:331:13
|
||||
|
|
||||
LL | TestStruct::from_something()
|
||||
| ^^^^^^^^^^ help: use the applicable keyword: `Self`
|
||||
|
||||
error: aborting due to 36 previous errors
|
||||
|
||||
|
|
Loading…
Reference in a new issue