diff options
| author | Dmitry Kadashev <dkadashev@gmail.com> | 2019-11-01 10:58:37 +0700 |
|---|---|---|
| committer | Dmitry Kadashev <dkadashev@gmail.com> | 2019-11-02 13:23:28 +0700 |
| commit | 4e10b75951e5ab7975952826a7591f8eca77e423 (patch) | |
| tree | 64813473dcf0034e7589824da02d8e384f747186 /src/test/ui/structs | |
| parent | 036f1828041c80842129b28695b60ba31a74403a (diff) | |
| download | rust-4e10b75951e5ab7975952826a7591f8eca77e423.tar.gz rust-4e10b75951e5ab7975952826a7591f8eca77e423.zip | |
Update tests
Update the tests to reflect changes to how type mismatch errors are reported (two previous commits).
Diffstat (limited to 'src/test/ui/structs')
| -rw-r--r-- | src/test/ui/structs/struct-path-self-type-mismatch.stderr | 15 | ||||
| -rw-r--r-- | src/test/ui/structs/struct-path-self.stderr | 6 |
2 files changed, 15 insertions, 6 deletions
diff --git a/src/test/ui/structs/struct-path-self-type-mismatch.stderr b/src/test/ui/structs/struct-path-self-type-mismatch.stderr index b905cd1a294..687d610baf8 100644 --- a/src/test/ui/structs/struct-path-self-type-mismatch.stderr +++ b/src/test/ui/structs/struct-path-self-type-mismatch.stderr @@ -7,8 +7,13 @@ LL | Self { inner: 1.5f32 }; error[E0308]: mismatched types --> $DIR/struct-path-self-type-mismatch.rs:15:20 | +LL | impl<T> Foo<T> { + | - expected type parameter +LL | fn new<U>(u: U) -> Foo<U> { + | - found type parameter +... LL | inner: u - | ^ expected type parameter, found a different type parameter + | ^ expected type parameter `T`, found type parameter `U` | = note: expected type `T` found type `U` @@ -18,14 +23,18 @@ LL | inner: u error[E0308]: mismatched types --> $DIR/struct-path-self-type-mismatch.rs:13:9 | +LL | impl<T> Foo<T> { + | - found type parameter LL | fn new<U>(u: U) -> Foo<U> { - | ------ expected `Foo<U>` because of return type + | - ------ expected `Foo<U>` because of return type + | | + | expected type parameter LL | / Self { LL | | LL | | inner: u LL | | LL | | } - | |_________^ expected type parameter, found a different type parameter + | |_________^ expected type parameter `U`, found type parameter `T` | = note: expected type `Foo<U>` found type `Foo<T>` diff --git a/src/test/ui/structs/struct-path-self.stderr b/src/test/ui/structs/struct-path-self.stderr index 8c88cacc69e..693ed35cbc9 100644 --- a/src/test/ui/structs/struct-path-self.stderr +++ b/src/test/ui/structs/struct-path-self.stderr @@ -1,4 +1,4 @@ -error[E0071]: expected struct, variant or union type, found type parameter +error[E0071]: expected struct, variant or union type, found type parameter `Self` --> $DIR/struct-path-self.rs:5:17 | LL | let s = Self {}; @@ -10,13 +10,13 @@ error[E0109]: type arguments are not allowed for this type LL | let z = Self::<u8> {}; | ^^ type argument not allowed -error[E0071]: expected struct, variant or union type, found type parameter +error[E0071]: expected struct, variant or union type, found type parameter `Self` --> $DIR/struct-path-self.rs:7:17 | LL | let z = Self::<u8> {}; | ^^^^^^^^^^ not a struct -error[E0071]: expected struct, variant or union type, found type parameter +error[E0071]: expected struct, variant or union type, found type parameter `Self` --> $DIR/struct-path-self.rs:11:13 | LL | Self { .. } => {} |
