Skip to content

Commit 30c75ed

Browse files
committed
Auto merge of #4538 - mikerite:fix-3567, r=flip1995
Verify that issue #3567 is resolved Closes #3567 changelog: none
2 parents 6ca5b20 + 67f1492 commit 30c75ed

File tree

3 files changed

+45
-1
lines changed

3 files changed

+45
-1
lines changed

tests/ui/use_self.fixed

+19
Original file line numberDiff line numberDiff line change
@@ -313,3 +313,22 @@ mod rustfix {
313313
}
314314
}
315315
}
316+
317+
mod issue3567 {
318+
struct TestStruct {}
319+
impl TestStruct {
320+
fn from_something() -> Self {
321+
Self {}
322+
}
323+
}
324+
325+
trait Test {
326+
fn test() -> TestStruct;
327+
}
328+
329+
impl Test for TestStruct {
330+
fn test() -> TestStruct {
331+
Self::from_something()
332+
}
333+
}
334+
}

tests/ui/use_self.rs

+19
Original file line numberDiff line numberDiff line change
@@ -313,3 +313,22 @@ mod rustfix {
313313
}
314314
}
315315
}
316+
317+
mod issue3567 {
318+
struct TestStruct {}
319+
impl TestStruct {
320+
fn from_something() -> Self {
321+
Self {}
322+
}
323+
}
324+
325+
trait Test {
326+
fn test() -> TestStruct;
327+
}
328+
329+
impl Test for TestStruct {
330+
fn test() -> TestStruct {
331+
TestStruct::from_something()
332+
}
333+
}
334+
}

tests/ui/use_self.stderr

+7-1
Original file line numberDiff line numberDiff line change
@@ -216,5 +216,11 @@ error: unnecessary structure name repetition
216216
LL | nested::A {};
217217
| ^^^^^^^^^ help: use the applicable keyword: `Self`
218218

219-
error: aborting due to 35 previous errors
219+
error: unnecessary structure name repetition
220+
--> $DIR/use_self.rs:331:13
221+
|
222+
LL | TestStruct::from_something()
223+
| ^^^^^^^^^^ help: use the applicable keyword: `Self`
224+
225+
error: aborting due to 36 previous errors
220226

0 commit comments

Comments
 (0)