From d96f9d47ac35b637906edb1d5d112549164e096c Mon Sep 17 00:00:00 2001 From: Esteban Küber Date: Tue, 25 Jul 2017 22:01:31 -0700 Subject: Point at return type always when type mismatch against it Before this, the diagnostic errors would only point at the return type when changing it would be a possible solution to a type error. Add a label to the return type without a suggestion to change in order to make the source of the expected type obvious. Follow up to #42850, fixes #25133, fixes #41897. --- src/test/compile-fail/struct-path-self-type-mismatch.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/test/compile-fail') diff --git a/src/test/compile-fail/struct-path-self-type-mismatch.rs b/src/test/compile-fail/struct-path-self-type-mismatch.rs index f694e7d277c..ad568b41fcb 100644 --- a/src/test/compile-fail/struct-path-self-type-mismatch.rs +++ b/src/test/compile-fail/struct-path-self-type-mismatch.rs @@ -20,17 +20,15 @@ impl Bar for Foo { } impl Foo { - fn new(u: U) -> Foo { + fn new(u: U) -> Foo { //~ NOTE expected `Foo` because of return type Self { //~^ ERROR mismatched types - //~| expected type parameter, found a different type parameter - //~| expected type `Foo` - //~| found type `Foo` + //~| NOTE expected type parameter, found a different type parameter + //~| NOTE expected type `Foo` inner: u //~^ ERROR mismatched types - //~| expected type parameter, found a different type parameter - //~| expected type `T` - //~| found type `U` + //~| NOTE expected type parameter, found a different type parameter + //~| NOTE expected type `T` } } } -- cgit 1.4.1-3-g733a5