summaryrefslogtreecommitdiffstats
path: root/tests/ui/associated-types
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/associated-types')
-rw-r--r--tests/ui/associated-types/associated-type-projection-from-supertrait.stderr12
-rw-r--r--tests/ui/associated-types/associated-types-eq-3.rs2
-rw-r--r--tests/ui/associated-types/associated-types-eq-3.stderr2
-rw-r--r--tests/ui/associated-types/associated-types-eq-hr.stderr12
-rw-r--r--tests/ui/associated-types/associated-types-outlives.stderr3
-rw-r--r--tests/ui/associated-types/defaults-in-other-trait-items.rs14
-rw-r--r--tests/ui/associated-types/defaults-in-other-trait-items.stderr17
-rw-r--r--tests/ui/associated-types/defaults-suitability.stderr6
-rw-r--r--tests/ui/associated-types/hr-associated-type-bound-1.stderr2
-rw-r--r--tests/ui/associated-types/hr-associated-type-bound-object.stderr2
-rw-r--r--tests/ui/associated-types/hr-associated-type-bound-param-1.stderr2
-rw-r--r--tests/ui/associated-types/hr-associated-type-bound-param-2.stderr6
-rw-r--r--tests/ui/associated-types/hr-associated-type-bound-param-3.stderr2
-rw-r--r--tests/ui/associated-types/hr-associated-type-bound-param-4.stderr2
-rw-r--r--tests/ui/associated-types/hr-associated-type-bound-param-5.stderr4
-rw-r--r--tests/ui/associated-types/hr-associated-type-projection-1.stderr6
-rw-r--r--tests/ui/associated-types/issue-26681.stderr4
-rw-r--r--tests/ui/associated-types/issue-38821.rs33
-rw-r--r--tests/ui/associated-types/issue-38821.stderr22
-rw-r--r--tests/ui/associated-types/issue-43924.stderr2
-rw-r--r--tests/ui/associated-types/issue-87261.rs6
-rw-r--r--tests/ui/associated-types/issue-87261.stderr6
-rw-r--r--tests/ui/associated-types/point-at-type-on-obligation-failure-2.stderr4
23 files changed, 129 insertions, 42 deletions
diff --git a/tests/ui/associated-types/associated-type-projection-from-supertrait.stderr b/tests/ui/associated-types/associated-type-projection-from-supertrait.stderr
index d6b18d4ed..3f3bf22b0 100644
--- a/tests/ui/associated-types/associated-type-projection-from-supertrait.stderr
+++ b/tests/ui/associated-types/associated-type-projection-from-supertrait.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/associated-type-projection-from-supertrait.rs:27:23
|
LL | fn b() { dent(ModelT, Blue); }
- | ---- ^^^^ expected struct `Black`, found struct `Blue`
+ | ---- ^^^^ expected `Black`, found `Blue`
| |
| arguments to this function are incorrect
|
@@ -16,7 +16,7 @@ error[E0308]: mismatched types
--> $DIR/associated-type-projection-from-supertrait.rs:28:23
|
LL | fn c() { dent(ModelU, Black); }
- | ---- ^^^^^ expected struct `Blue`, found struct `Black`
+ | ---- ^^^^^ expected `Blue`, found `Black`
| |
| arguments to this function are incorrect
|
@@ -30,11 +30,11 @@ error[E0308]: mismatched types
--> $DIR/associated-type-projection-from-supertrait.rs:32:28
|
LL | fn f() { ModelT.chip_paint(Blue); }
- | ---------- ^^^^ expected struct `Black`, found struct `Blue`
+ | ---------- ^^^^ expected `Black`, found `Blue`
| |
| arguments to this method are incorrect
|
-note: associated function defined here
+note: method defined here
--> $DIR/associated-type-projection-from-supertrait.rs:12:8
|
LL | fn chip_paint(&self, c: Self::Color) { }
@@ -44,11 +44,11 @@ error[E0308]: mismatched types
--> $DIR/associated-type-projection-from-supertrait.rs:33:28
|
LL | fn g() { ModelU.chip_paint(Black); }
- | ---------- ^^^^^ expected struct `Blue`, found struct `Black`
+ | ---------- ^^^^^ expected `Blue`, found `Black`
| |
| arguments to this method are incorrect
|
-note: associated function defined here
+note: method defined here
--> $DIR/associated-type-projection-from-supertrait.rs:12:8
|
LL | fn chip_paint(&self, c: Self::Color) { }
diff --git a/tests/ui/associated-types/associated-types-eq-3.rs b/tests/ui/associated-types/associated-types-eq-3.rs
index f6988dcf6..380d0e95c 100644
--- a/tests/ui/associated-types/associated-types-eq-3.rs
+++ b/tests/ui/associated-types/associated-types-eq-3.rs
@@ -23,7 +23,7 @@ fn foo2<I: Foo>(x: I) {
let _: Bar = x.boo();
//~^ ERROR mismatched types
//~| found associated type `<I as Foo>::A`
- //~| expected struct `Bar`, found associated type
+ //~| expected `Bar`, found
//~| expected struct `Bar`
}
diff --git a/tests/ui/associated-types/associated-types-eq-3.stderr b/tests/ui/associated-types/associated-types-eq-3.stderr
index fbe1a1ee8..15ce4fc91 100644
--- a/tests/ui/associated-types/associated-types-eq-3.stderr
+++ b/tests/ui/associated-types/associated-types-eq-3.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/associated-types-eq-3.rs:23:18
|
LL | let _: Bar = x.boo();
- | --- ^^^^^^^ expected struct `Bar`, found associated type
+ | --- ^^^^^^^ expected `Bar`, found associated type
| |
| expected due to this
|
diff --git a/tests/ui/associated-types/associated-types-eq-hr.stderr b/tests/ui/associated-types/associated-types-eq-hr.stderr
index 6cff403b3..3e1142d5d 100644
--- a/tests/ui/associated-types/associated-types-eq-hr.stderr
+++ b/tests/ui/associated-types/associated-types-eq-hr.stderr
@@ -1,8 +1,8 @@
-error[E0271]: type mismatch resolving `for<'x> <UintStruct as TheTrait<&'x isize>>::A == &'x isize`
+error[E0271]: type mismatch resolving `<UintStruct as TheTrait<&isize>>::A == &isize`
--> $DIR/associated-types-eq-hr.rs:87:11
|
LL | foo::<UintStruct>();
- | ^^^^^^^^^^ type mismatch resolving `for<'x> <UintStruct as TheTrait<&'x isize>>::A == &'x isize`
+ | ^^^^^^^^^^ type mismatch resolving `<UintStruct as TheTrait<&isize>>::A == &isize`
|
note: expected this to be `&isize`
--> $DIR/associated-types-eq-hr.rs:26:14
@@ -15,16 +15,16 @@ note: required by a bound in `foo`
--> $DIR/associated-types-eq-hr.rs:45:36
|
LL | fn foo<T>()
- | --- required by a bound in this
+ | --- required by a bound in this function
LL | where
LL | T: for<'x> TheTrait<&'x isize, A = &'x isize>,
| ^^^^^^^^^^^^^ required by this bound in `foo`
-error[E0271]: type mismatch resolving `for<'x> <IntStruct as TheTrait<&'x isize>>::A == &'x usize`
+error[E0271]: type mismatch resolving `<IntStruct as TheTrait<&isize>>::A == &usize`
--> $DIR/associated-types-eq-hr.rs:91:11
|
LL | bar::<IntStruct>();
- | ^^^^^^^^^ type mismatch resolving `for<'x> <IntStruct as TheTrait<&'x isize>>::A == &'x usize`
+ | ^^^^^^^^^ type mismatch resolving `<IntStruct as TheTrait<&isize>>::A == &usize`
|
note: expected this to be `&usize`
--> $DIR/associated-types-eq-hr.rs:14:14
@@ -37,7 +37,7 @@ note: required by a bound in `bar`
--> $DIR/associated-types-eq-hr.rs:52:36
|
LL | fn bar<T>()
- | --- required by a bound in this
+ | --- required by a bound in this function
LL | where
LL | T: for<'x> TheTrait<&'x isize, A = &'x usize>,
| ^^^^^^^^^^^^^ required by this bound in `bar`
diff --git a/tests/ui/associated-types/associated-types-outlives.stderr b/tests/ui/associated-types/associated-types-outlives.stderr
index 840e33b4b..2fe3f2d4a 100644
--- a/tests/ui/associated-types/associated-types-outlives.stderr
+++ b/tests/ui/associated-types/associated-types-outlives.stderr
@@ -1,6 +1,9 @@
error[E0505]: cannot move out of `x` because it is borrowed
--> $DIR/associated-types-outlives.rs:22:14
|
+LL | F: for<'a> FnOnce(<T as Foo<'a>>::Bar)>(x: T, f: F) {
+ | - binding `x` declared here
+...
LL | 's: loop { y = denormalise(&x); break }
| -- borrow of `x` occurs here
LL | drop(x);
diff --git a/tests/ui/associated-types/defaults-in-other-trait-items.rs b/tests/ui/associated-types/defaults-in-other-trait-items.rs
index 505751969..f26380955 100644
--- a/tests/ui/associated-types/defaults-in-other-trait-items.rs
+++ b/tests/ui/associated-types/defaults-in-other-trait-items.rs
@@ -44,4 +44,18 @@ impl AssocConst for () {
const C: Self::Ty = 0u8;
}
+pub trait Trait {
+ type Res = isize; //~ NOTE associated type defaults can't be assumed inside the trait defining them
+
+ fn infer_me_correctly() -> Self::Res {
+ //~^ NOTE expected `<Self as Trait>::Res` because of return type
+
+ // {integer} == isize
+ 2
+ //~^ ERROR mismatched types
+ //~| NOTE expected associated type, found integer
+ //~| NOTE expected associated type `<Self as Trait>::Res`
+ }
+}
+
fn main() {}
diff --git a/tests/ui/associated-types/defaults-in-other-trait-items.stderr b/tests/ui/associated-types/defaults-in-other-trait-items.stderr
index 71d421926..bdcfadd39 100644
--- a/tests/ui/associated-types/defaults-in-other-trait-items.stderr
+++ b/tests/ui/associated-types/defaults-in-other-trait-items.stderr
@@ -24,6 +24,21 @@ LL | const C: Self::Ty = 0u8;
= note: expected associated type `<Self as AssocConst>::Ty`
found type `u8`
-error: aborting due to 2 previous errors
+error[E0308]: mismatched types
+ --> $DIR/defaults-in-other-trait-items.rs:54:9
+ |
+LL | type Res = isize;
+ | ----------------- associated type defaults can't be assumed inside the trait defining them
+LL |
+LL | fn infer_me_correctly() -> Self::Res {
+ | --------- expected `<Self as Trait>::Res` because of return type
+...
+LL | 2
+ | ^ expected associated type, found integer
+ |
+ = note: expected associated type `<Self as Trait>::Res`
+ found type `{integer}`
+
+error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/associated-types/defaults-suitability.stderr b/tests/ui/associated-types/defaults-suitability.stderr
index eadad4cd5..248575875 100644
--- a/tests/ui/associated-types/defaults-suitability.stderr
+++ b/tests/ui/associated-types/defaults-suitability.stderr
@@ -27,7 +27,7 @@ LL | Self::Ty: Clone,
| ^^^^^ required by this bound in `Tr2::Ty`
LL | {
LL | type Ty = NotClone;
- | -- required by a bound in this
+ | -- required by a bound in this associated type
help: consider annotating `NotClone` with `#[derive(Clone)]`
|
LL | #[derive(Clone)]
@@ -75,7 +75,7 @@ LL | Self::Assoc: IsU8<Self::Assoc>,
| ^^^^^^^^^^^^^^^^^ required by this bound in `D::Assoc`
...
LL | type Assoc = NotClone;
- | ----- required by a bound in this
+ | ----- required by a bound in this associated type
error[E0277]: the trait bound `<Self as Foo2<T>>::Baz: Clone` is not satisfied
--> $DIR/defaults-suitability.rs:65:23
@@ -124,7 +124,7 @@ LL | Self::Baz: Clone,
| ^^^^^ required by this bound in `Foo3::Baz`
...
LL | type Baz = T;
- | --- required by a bound in this
+ | --- required by a bound in this associated type
help: consider further restricting type parameter `T`
|
LL | Self::Baz: Clone, T: std::clone::Clone
diff --git a/tests/ui/associated-types/hr-associated-type-bound-1.stderr b/tests/ui/associated-types/hr-associated-type-bound-1.stderr
index 73b5e1053..b380a1b6f 100644
--- a/tests/ui/associated-types/hr-associated-type-bound-1.stderr
+++ b/tests/ui/associated-types/hr-associated-type-bound-1.stderr
@@ -9,7 +9,7 @@ note: required by a bound in `X`
--> $DIR/hr-associated-type-bound-1.rs:3:33
|
LL | trait X<'a>
- | - required by a bound in this
+ | - required by a bound in this trait
LL | where
LL | for<'b> <Self as X<'b>>::U: Clone,
| ^^^^^ required by this bound in `X`
diff --git a/tests/ui/associated-types/hr-associated-type-bound-object.stderr b/tests/ui/associated-types/hr-associated-type-bound-object.stderr
index 6d19186bd..a0a6f76a5 100644
--- a/tests/ui/associated-types/hr-associated-type-bound-object.stderr
+++ b/tests/ui/associated-types/hr-associated-type-bound-object.stderr
@@ -8,7 +8,7 @@ note: required by a bound in `X`
--> $DIR/hr-associated-type-bound-object.rs:3:33
|
LL | trait X<'a>
- | - required by a bound in this
+ | - required by a bound in this trait
LL | where
LL | for<'b> <Self as X<'b>>::U: Clone,
| ^^^^^ required by this bound in `X`
diff --git a/tests/ui/associated-types/hr-associated-type-bound-param-1.stderr b/tests/ui/associated-types/hr-associated-type-bound-param-1.stderr
index af2e61689..e249f2e0c 100644
--- a/tests/ui/associated-types/hr-associated-type-bound-param-1.stderr
+++ b/tests/ui/associated-types/hr-associated-type-bound-param-1.stderr
@@ -9,7 +9,7 @@ note: required by a bound in `Y`
--> $DIR/hr-associated-type-bound-param-1.rs:4:36
|
LL | trait Y<'a, T: ?Sized>
- | - required by a bound in this
+ | - required by a bound in this trait
...
LL | for<'b> <Self as Y<'b, T>>::V: Clone,
| ^^^^^ required by this bound in `Y`
diff --git a/tests/ui/associated-types/hr-associated-type-bound-param-2.stderr b/tests/ui/associated-types/hr-associated-type-bound-param-2.stderr
index 52294f8c9..366670269 100644
--- a/tests/ui/associated-types/hr-associated-type-bound-param-2.stderr
+++ b/tests/ui/associated-types/hr-associated-type-bound-param-2.stderr
@@ -9,7 +9,7 @@ note: required by a bound in `Z`
--> $DIR/hr-associated-type-bound-param-2.rs:6:35
|
LL | trait Z<'a, T: ?Sized>
- | - required by a bound in this
+ | - required by a bound in this trait
...
LL | for<'b> <T as Z<'b, u16>>::W: Clone,
| ^^^^^ required by this bound in `Z`
@@ -25,7 +25,7 @@ note: required by a bound in `Z`
--> $DIR/hr-associated-type-bound-param-2.rs:6:35
|
LL | trait Z<'a, T: ?Sized>
- | - required by a bound in this
+ | - required by a bound in this trait
...
LL | for<'b> <T as Z<'b, u16>>::W: Clone,
| ^^^^^ required by this bound in `Z`
@@ -41,7 +41,7 @@ note: required by a bound in `Z`
--> $DIR/hr-associated-type-bound-param-2.rs:6:35
|
LL | trait Z<'a, T: ?Sized>
- | - required by a bound in this
+ | - required by a bound in this trait
...
LL | for<'b> <T as Z<'b, u16>>::W: Clone,
| ^^^^^ required by this bound in `Z`
diff --git a/tests/ui/associated-types/hr-associated-type-bound-param-3.stderr b/tests/ui/associated-types/hr-associated-type-bound-param-3.stderr
index 84d5e0494..f49439d35 100644
--- a/tests/ui/associated-types/hr-associated-type-bound-param-3.stderr
+++ b/tests/ui/associated-types/hr-associated-type-bound-param-3.stderr
@@ -9,7 +9,7 @@ note: required by a bound in `X`
--> $DIR/hr-associated-type-bound-param-3.rs:4:33
|
LL | trait X<'a, T>
- | - required by a bound in this
+ | - required by a bound in this trait
...
LL | for<'b> <T as X<'b, T>>::U: Clone,
| ^^^^^ required by this bound in `X`
diff --git a/tests/ui/associated-types/hr-associated-type-bound-param-4.stderr b/tests/ui/associated-types/hr-associated-type-bound-param-4.stderr
index ee1d5d324..f8733b423 100644
--- a/tests/ui/associated-types/hr-associated-type-bound-param-4.stderr
+++ b/tests/ui/associated-types/hr-associated-type-bound-param-4.stderr
@@ -9,7 +9,7 @@ note: required by a bound in `X`
--> $DIR/hr-associated-type-bound-param-4.rs:4:36
|
LL | trait X<'a, T>
- | - required by a bound in this
+ | - required by a bound in this trait
...
LL | for<'b> <(T,) as X<'b, T>>::U: Clone,
| ^^^^^ required by this bound in `X`
diff --git a/tests/ui/associated-types/hr-associated-type-bound-param-5.stderr b/tests/ui/associated-types/hr-associated-type-bound-param-5.stderr
index ece3151ba..aae80a9b2 100644
--- a/tests/ui/associated-types/hr-associated-type-bound-param-5.stderr
+++ b/tests/ui/associated-types/hr-associated-type-bound-param-5.stderr
@@ -9,7 +9,7 @@ note: required by a bound in `X`
--> $DIR/hr-associated-type-bound-param-5.rs:17:45
|
LL | trait X<'a, T: Cycle + for<'b> X<'b, T>>
- | - required by a bound in this
+ | - required by a bound in this trait
...
LL | for<'b> <T::Next as X<'b, T::Next>>::U: Clone,
| ^^^^^ required by this bound in `X`
@@ -25,7 +25,7 @@ note: required by a bound in `X`
--> $DIR/hr-associated-type-bound-param-5.rs:17:45
|
LL | trait X<'a, T: Cycle + for<'b> X<'b, T>>
- | - required by a bound in this
+ | - required by a bound in this trait
...
LL | for<'b> <T::Next as X<'b, T::Next>>::U: Clone,
| ^^^^^ required by this bound in `X`
diff --git a/tests/ui/associated-types/hr-associated-type-projection-1.stderr b/tests/ui/associated-types/hr-associated-type-projection-1.stderr
index a65f84ae5..dd0389c34 100644
--- a/tests/ui/associated-types/hr-associated-type-projection-1.stderr
+++ b/tests/ui/associated-types/hr-associated-type-projection-1.stderr
@@ -10,14 +10,14 @@ note: required by a bound in `UnsafeCopy`
--> $DIR/hr-associated-type-projection-1.rs:3:64
|
LL | trait UnsafeCopy<'a, T: Copy>
- | ---------- required by a bound in this
+ | ---------- required by a bound in this trait
LL | where
LL | for<'b> <Self as UnsafeCopy<'b, T>>::Item: std::ops::Deref<Target = T>,
| ^^^^^^^^^^ required by this bound in `UnsafeCopy`
help: consider further restricting this bound
|
-LL | impl<T: Copy + std::ops::Deref + Deref<Target = T>> UnsafeCopy<'_, T> for T {
- | +++++++++++++++++++
+LL | impl<T: Copy + std::ops::Deref<Target = T>> UnsafeCopy<'_, T> for T {
+ | ++++++++++++
error: aborting due to previous error
diff --git a/tests/ui/associated-types/issue-26681.stderr b/tests/ui/associated-types/issue-26681.stderr
index 74411008c..977620d90 100644
--- a/tests/ui/associated-types/issue-26681.stderr
+++ b/tests/ui/associated-types/issue-26681.stderr
@@ -1,13 +1,13 @@
error[E0308]: mismatched types
--> $DIR/issue-26681.rs:17:39
|
+LL | type Fv: Foo = u8;
+ | ------------------ associated type defaults can't be assumed inside the trait defining them
LL | const C: <Self::Fv as Foo>::Bar = 6665;
| ^^^^ expected associated type, found integer
|
= note: expected associated type `<<Self as Baz>::Fv as Foo>::Bar`
found type `{integer}`
- = help: consider constraining the associated type `<<Self as Baz>::Fv as Foo>::Bar` to `{integer}`
- = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
error: aborting due to previous error
diff --git a/tests/ui/associated-types/issue-38821.rs b/tests/ui/associated-types/issue-38821.rs
new file mode 100644
index 000000000..6753860e9
--- /dev/null
+++ b/tests/ui/associated-types/issue-38821.rs
@@ -0,0 +1,33 @@
+pub struct Nullable<T: NotNull>(T);
+
+pub trait NotNull {}
+
+pub trait IntoNullable {
+ type Nullable;
+}
+
+impl<T: NotNull> IntoNullable for T {
+ type Nullable = Nullable<T>;
+}
+
+impl<T: NotNull> IntoNullable for Nullable<T> {
+ type Nullable = Nullable<T>;
+}
+
+pub trait Expression {
+ type SqlType;
+}
+
+pub trait Column: Expression {}
+
+#[derive(Debug, Copy, Clone)]
+//~^ ERROR the trait bound `<Col as Expression>::SqlType: NotNull` is not satisfied
+pub enum ColumnInsertValue<Col, Expr> where
+ Col: Column,
+ Expr: Expression<SqlType=<Col::SqlType as IntoNullable>::Nullable>,
+{
+ Expression(Col, Expr),
+ Default(Col),
+}
+
+fn main() {}
diff --git a/tests/ui/associated-types/issue-38821.stderr b/tests/ui/associated-types/issue-38821.stderr
new file mode 100644
index 000000000..a52a9c138
--- /dev/null
+++ b/tests/ui/associated-types/issue-38821.stderr
@@ -0,0 +1,22 @@
+error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not satisfied
+ --> $DIR/issue-38821.rs:23:17
+ |
+LL | #[derive(Debug, Copy, Clone)]
+ | ^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`
+ |
+note: required for `<Col as Expression>::SqlType` to implement `IntoNullable`
+ --> $DIR/issue-38821.rs:9:18
+ |
+LL | impl<T: NotNull> IntoNullable for T {
+ | ------- ^^^^^^^^^^^^ ^
+ | |
+ | unsatisfied trait bound introduced here
+ = note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider further restricting the associated type
+ |
+LL | Expr: Expression<SqlType=<Col::SqlType as IntoNullable>::Nullable>, <Col as Expression>::SqlType: NotNull,
+ | +++++++++++++++++++++++++++++++++++++++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/associated-types/issue-43924.stderr b/tests/ui/associated-types/issue-43924.stderr
index 526f425b2..ab1a9511e 100644
--- a/tests/ui/associated-types/issue-43924.stderr
+++ b/tests/ui/associated-types/issue-43924.stderr
@@ -14,7 +14,7 @@ error[E0599]: no function or associated item named `default` found for trait obj
--> $DIR/issue-43924.rs:14:39
|
LL | assert_eq!(<() as Foo<u32>>::Out::default().to_string(), "false");
- | ^^^^^^^ function or associated item not found in `(dyn ToString + 'static)`
+ | ^^^^^^^ function or associated item not found in `dyn ToString`
error: aborting due to 2 previous errors
diff --git a/tests/ui/associated-types/issue-87261.rs b/tests/ui/associated-types/issue-87261.rs
index e8548d402..384561f8c 100644
--- a/tests/ui/associated-types/issue-87261.rs
+++ b/tests/ui/associated-types/issue-87261.rs
@@ -77,10 +77,10 @@ where
fn main() {
accepts_trait(returns_opaque());
- //~^ ERROR type mismatch resolving `<impl Trait + 'static as Trait>::Associated == ()`
+ //~^ ERROR type mismatch resolving `<impl Trait as Trait>::Associated == ()`
accepts_trait(returns_opaque_derived());
- //~^ ERROR type mismatch resolving `<impl DerivedTrait + 'static as Trait>::Associated == ()`
+ //~^ ERROR type mismatch resolving `<impl DerivedTrait as Trait>::Associated == ()`
accepts_trait(returns_opaque_foo());
//~^ ERROR type mismatch resolving `<impl Trait + Foo as Trait>::Associated == ()`
@@ -89,7 +89,7 @@ fn main() {
//~^ ERROR type mismatch resolving `<impl DerivedTrait + Foo as Trait>::Associated == ()`
accepts_generic_trait(returns_opaque_generic());
- //~^ ERROR type mismatch resolving `<impl GenericTrait<()> + 'static as GenericTrait<()>>::Associated == ()`
+ //~^ ERROR type mismatch resolving `<impl GenericTrait<()> as GenericTrait<()>>::Associated == ()`
accepts_generic_trait(returns_opaque_generic_foo());
//~^ ERROR type mismatch resolving `<impl GenericTrait<()> + Foo as GenericTrait<()>>::Associated == ()`
diff --git a/tests/ui/associated-types/issue-87261.stderr b/tests/ui/associated-types/issue-87261.stderr
index 2cce6b947..f5c6d8247 100644
--- a/tests/ui/associated-types/issue-87261.stderr
+++ b/tests/ui/associated-types/issue-87261.stderr
@@ -132,7 +132,7 @@ note: required by a bound in `accepts_generic_trait`
LL | fn accepts_generic_trait<T: GenericTrait<(), Associated = ()>>(_: T) {}
| ^^^^^^^^^^^^^^^ required by this bound in `accepts_generic_trait`
-error[E0271]: type mismatch resolving `<impl Trait + 'static as Trait>::Associated == ()`
+error[E0271]: type mismatch resolving `<impl Trait as Trait>::Associated == ()`
--> $DIR/issue-87261.rs:79:19
|
LL | fn returns_opaque() -> impl Trait + 'static {
@@ -155,7 +155,7 @@ help: consider constraining the associated type `<impl Trait + 'static as Trait>
LL | fn returns_opaque() -> impl Trait<Associated = ()> + 'static {
| +++++++++++++++++
-error[E0271]: type mismatch resolving `<impl DerivedTrait + 'static as Trait>::Associated == ()`
+error[E0271]: type mismatch resolving `<impl DerivedTrait as Trait>::Associated == ()`
--> $DIR/issue-87261.rs:82:19
|
LL | fn returns_opaque_derived() -> impl DerivedTrait + 'static {
@@ -222,7 +222,7 @@ note: required by a bound in `accepts_trait`
LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
| ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
-error[E0271]: type mismatch resolving `<impl GenericTrait<()> + 'static as GenericTrait<()>>::Associated == ()`
+error[E0271]: type mismatch resolving `<impl GenericTrait<()> as GenericTrait<()>>::Associated == ()`
--> $DIR/issue-87261.rs:91:27
|
LL | fn returns_opaque_generic() -> impl GenericTrait<()> + 'static {
diff --git a/tests/ui/associated-types/point-at-type-on-obligation-failure-2.stderr b/tests/ui/associated-types/point-at-type-on-obligation-failure-2.stderr
index 2e7a1dd2a..3b4689e08 100644
--- a/tests/ui/associated-types/point-at-type-on-obligation-failure-2.stderr
+++ b/tests/ui/associated-types/point-at-type-on-obligation-failure-2.stderr
@@ -23,7 +23,7 @@ LL | Self::Assoc: Bar,
| ^^^ required by this bound in `Baz::Assoc`
LL | {
LL | type Assoc;
- | ----- required by a bound in this
+ | ----- required by a bound in this associated type
error[E0277]: the trait bound `bool: Bar` is not satisfied
--> $DIR/point-at-type-on-obligation-failure-2.rs:30:18
@@ -38,7 +38,7 @@ LL | <Self as Bat>::Assoc: Bar,
| ^^^ required by this bound in `Bat::Assoc`
LL | {
LL | type Assoc;
- | ----- required by a bound in this
+ | ----- required by a bound in this associated type
error: aborting due to 3 previous errors