diff --git a/tests/ui/use_self.fixed b/tests/ui/use_self.fixed index ebb3aa28daf3..38bc5e02cec6 100644 --- a/tests/ui/use_self.fixed +++ b/tests/ui/use_self.fixed @@ -176,11 +176,26 @@ mod issue3410 { struct B; trait Trait { - fn a(v: T); + fn a(v: T) -> Self; } impl Trait> for Vec { - fn a(_: Vec) {} + fn a(_: Vec) -> Self { + unimplemented!() + } + } + + // FIXME + impl Trait> for Vec + where + T: Trait, + { + fn a(v: Vec) -> Self { + >::a(v) + .into_iter() + .map(Trait::a) + .collect() + } } } diff --git a/tests/ui/use_self.rs b/tests/ui/use_self.rs index 8a182192ab34..74b633fcc8c9 100644 --- a/tests/ui/use_self.rs +++ b/tests/ui/use_self.rs @@ -176,11 +176,26 @@ mod issue3410 { struct B; trait Trait { - fn a(v: T); + fn a(v: T) -> Self; } impl Trait> for Vec { - fn a(_: Vec) {} + fn a(_: Vec) -> Self { + unimplemented!() + } + } + + // FIXME + impl Trait> for Vec + where + T: Trait, + { + fn a(v: Vec) -> Self { + >::a(v) + .into_iter() + .map(Trait::a) + .collect() + } } } diff --git a/tests/ui/use_self.stderr b/tests/ui/use_self.stderr index b33928597c14..89b5e8bf492d 100644 --- a/tests/ui/use_self.stderr +++ b/tests/ui/use_self.stderr @@ -113,52 +113,58 @@ LL | let _ = Enum::A; | ^^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> $DIR/use_self.rs:199:13 + --> $DIR/use_self.rs:194:14 + | +LL | >::a(v) + | ^^^ help: use the applicable keyword: `Self` + +error: unnecessary structure name repetition + --> $DIR/use_self.rs:214:13 | LL | nested::A::fun_1(); | ^^^^^^^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> $DIR/use_self.rs:200:13 + --> $DIR/use_self.rs:215:13 | LL | nested::A::A; | ^^^^^^^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> $DIR/use_self.rs:202:13 + --> $DIR/use_self.rs:217:13 | LL | nested::A {}; | ^^^^^^^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> $DIR/use_self.rs:221:13 + --> $DIR/use_self.rs:236:13 | LL | TestStruct::from_something() | ^^^^^^^^^^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> $DIR/use_self.rs:235:25 + --> $DIR/use_self.rs:250:25 | LL | async fn g() -> S { | ^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> $DIR/use_self.rs:236:13 + --> $DIR/use_self.rs:251:13 | LL | S {} | ^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> $DIR/use_self.rs:240:16 + --> $DIR/use_self.rs:255:16 | LL | &p[S::A..S::B] | ^ help: use the applicable keyword: `Self` error: unnecessary structure name repetition - --> $DIR/use_self.rs:240:22 + --> $DIR/use_self.rs:255:22 | LL | &p[S::A..S::B] | ^ help: use the applicable keyword: `Self` -error: aborting due to 25 previous errors +error: aborting due to 26 previous errors