From dc41dbaf8eec1ff144f45c8a3c65b7514aa70895 Mon Sep 17 00:00:00 2001 From: Will Crichton Date: Mon, 25 Apr 2022 19:14:09 -0700 Subject: Update unop path, fix tests --- .../generic-associated-types/missing-bounds.fixed | 46 ---------------------- .../ui/generic-associated-types/missing-bounds.rs | 2 - .../generic-associated-types/missing-bounds.stderr | 16 ++++---- .../ui/type/type-check/missing_trait_impl.stderr | 8 ++-- 4 files changed, 12 insertions(+), 60 deletions(-) delete mode 100644 src/test/ui/generic-associated-types/missing-bounds.fixed (limited to 'src/test/ui') diff --git a/src/test/ui/generic-associated-types/missing-bounds.fixed b/src/test/ui/generic-associated-types/missing-bounds.fixed deleted file mode 100644 index 8eddfe21e30..00000000000 --- a/src/test/ui/generic-associated-types/missing-bounds.fixed +++ /dev/null @@ -1,46 +0,0 @@ -// run-rustfix - -use std::ops::Add; - -struct A(B); - -impl Add for A where B: Add + Add { - type Output = Self; - - fn add(self, rhs: Self) -> Self { - A(self.0 + rhs.0) //~ ERROR mismatched types - } -} - -struct C(B); - -impl> Add for C { - type Output = Self; - - fn add(self, rhs: Self) -> Self { - Self(self.0 + rhs.0) //~ ERROR mismatched types - } -} - -struct D(B); - -impl Add for D { - type Output = Self; - - fn add(self, rhs: Self) -> Self { - Self(self.0 + rhs.0) //~ ERROR cannot add `B` to `B` - } -} - -struct E(B); - -impl Add for E where B: Add, B: Add { - //~^ ERROR equality constraints are not yet supported in `where` clauses - type Output = Self; - - fn add(self, rhs: Self) -> Self { - Self(self.0 + rhs.0) //~ ERROR mismatched types - } -} - -fn main() {} diff --git a/src/test/ui/generic-associated-types/missing-bounds.rs b/src/test/ui/generic-associated-types/missing-bounds.rs index ffafff5e9f5..b3661ba3744 100644 --- a/src/test/ui/generic-associated-types/missing-bounds.rs +++ b/src/test/ui/generic-associated-types/missing-bounds.rs @@ -1,5 +1,3 @@ -// run-rustfix - use std::ops::Add; struct A(B); diff --git a/src/test/ui/generic-associated-types/missing-bounds.stderr b/src/test/ui/generic-associated-types/missing-bounds.stderr index 25db8461098..aaeec920527 100644 --- a/src/test/ui/generic-associated-types/missing-bounds.stderr +++ b/src/test/ui/generic-associated-types/missing-bounds.stderr @@ -1,5 +1,5 @@ error: equality constraints are not yet supported in `where` clauses - --> $DIR/missing-bounds.rs:37:33 + --> $DIR/missing-bounds.rs:35:33 | LL | impl Add for E where ::Output = B { | ^^^^^^^^^^^^^^^^^^^^^^ not supported @@ -11,7 +11,7 @@ LL | impl Add for E where B: Add { | ~~~~~~~~~~~~~~~~~~ error[E0308]: mismatched types - --> $DIR/missing-bounds.rs:11:11 + --> $DIR/missing-bounds.rs:9:11 | LL | impl Add for A where B: Add { | - this type parameter @@ -24,7 +24,7 @@ LL | A(self.0 + rhs.0) = note: expected type parameter `B` found associated type `::Output` note: tuple struct defined here - --> $DIR/missing-bounds.rs:5:8 + --> $DIR/missing-bounds.rs:3:8 | LL | struct A(B); | ^ @@ -34,7 +34,7 @@ LL | impl Add for A where B: Add + Add { | +++++++++++++++++ error[E0308]: mismatched types - --> $DIR/missing-bounds.rs:21:14 + --> $DIR/missing-bounds.rs:19:14 | LL | impl Add for C { | - this type parameter @@ -47,7 +47,7 @@ LL | Self(self.0 + rhs.0) = note: expected type parameter `B` found associated type `::Output` note: tuple struct defined here - --> $DIR/missing-bounds.rs:15:8 + --> $DIR/missing-bounds.rs:13:8 | LL | struct C(B); | ^ @@ -57,7 +57,7 @@ LL | impl> Add for C { | +++++++++++++++++ error[E0369]: cannot add `B` to `B` - --> $DIR/missing-bounds.rs:31:21 + --> $DIR/missing-bounds.rs:29:21 | LL | Self(self.0 + rhs.0) | ------ ^ ----- B @@ -70,7 +70,7 @@ LL | impl Add for D { | +++++++++++++++ error[E0308]: mismatched types - --> $DIR/missing-bounds.rs:42:14 + --> $DIR/missing-bounds.rs:40:14 | LL | impl Add for E where ::Output = B { | - this type parameter @@ -83,7 +83,7 @@ LL | Self(self.0 + rhs.0) = note: expected type parameter `B` found associated type `::Output` note: tuple struct defined here - --> $DIR/missing-bounds.rs:35:8 + --> $DIR/missing-bounds.rs:33:8 | LL | struct E(B); | ^ diff --git a/src/test/ui/type/type-check/missing_trait_impl.stderr b/src/test/ui/type/type-check/missing_trait_impl.stderr index fe156a88453..2b58cd4180b 100644 --- a/src/test/ui/type/type-check/missing_trait_impl.stderr +++ b/src/test/ui/type/type-check/missing_trait_impl.stderr @@ -32,8 +32,8 @@ LL | let y = -x; | help: consider restricting type parameter `T` | -LL | fn baz>(x: T) { - | +++++++++++++++++++++++++++ +LL | fn baz(x: T) { + | +++++++++++++++ error[E0600]: cannot apply unary operator `!` to type `T` --> $DIR/missing_trait_impl.rs:14:13 @@ -43,8 +43,8 @@ LL | let y = !x; | help: consider restricting type parameter `T` | -LL | fn baz>(x: T) { - | +++++++++++++++++++++++++++ +LL | fn baz(x: T) { + | +++++++++++++++ error[E0614]: type `T` cannot be dereferenced --> $DIR/missing_trait_impl.rs:15:13 -- cgit 1.4.1-3-g733a5