File tree 3 files changed +45
-1
lines changed
3 files changed +45
-1
lines changed Original file line number Diff line number Diff line change @@ -313,3 +313,22 @@ mod rustfix {
313
313
}
314
314
}
315
315
}
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 {
313
313
}
314
314
}
315
315
}
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
216
216
LL | nested::A {};
217
217
| ^^^^^^^^^ help: use the applicable keyword: `Self`
218
218
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
220
226
You can’t perform that action at this time.
0 commit comments