Skip to content

Commit

Permalink
Auto merge of #4538 - mikerite:fix-3567, r=flip1995
Browse files Browse the repository at this point in the history
Verify that issue #3567 is resolved

Closes #3567

changelog: none
  • Loading branch information
bors committed Sep 12, 2019
2 parents 6ca5b20 + 67f1492 commit 30c75ed
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
19 changes: 19 additions & 0 deletions tests/ui/use_self.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
}
19 changes: 19 additions & 0 deletions tests/ui/use_self.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
}
8 changes: 7 additions & 1 deletion tests/ui/use_self.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 30c75ed

Please sign in to comment.