File tree Expand file tree Collapse file tree 3 files changed +45
-1
lines changed Expand file tree Collapse file tree 3 files changed +45
-1
lines changed Original file line number Diff line number Diff 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+ }
Original file line number Diff line number Diff 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+ }
Original file line number Diff line number Diff line change @@ -216,5 +216,11 @@ error: unnecessary structure name repetition
216216LL | 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
You can’t perform that action at this time.
0 commit comments