summaryrefslogtreecommitdiffstats
path: root/src/test/ui/associated-types
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/associated-types')
-rw-r--r--src/test/ui/associated-types/associated-type-projection-from-supertrait.stderr8
-rw-r--r--src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.stderr12
-rw-r--r--src/test/ui/associated-types/associated-types-eq-3.stderr6
-rw-r--r--src/test/ui/associated-types/associated-types-eq-hr.stderr8
-rw-r--r--src/test/ui/associated-types/associated-types-for-unimpl-trait.stderr4
-rw-r--r--src/test/ui/associated-types/associated-types-issue-20346.stderr6
-rw-r--r--src/test/ui/associated-types/associated-types-multiple-types-one-trait.stderr12
-rw-r--r--src/test/ui/associated-types/associated-types-no-suitable-bound.stderr4
-rw-r--r--src/test/ui/associated-types/associated-types-no-suitable-supertrait-2.stderr4
-rw-r--r--src/test/ui/associated-types/associated-types-no-suitable-supertrait.stderr8
-rw-r--r--src/test/ui/associated-types/associated-types-overridden-binding-2.rs2
-rw-r--r--src/test/ui/associated-types/associated-types-overridden-binding-2.stderr2
-rw-r--r--src/test/ui/associated-types/associated-types-path-2.rs2
-rw-r--r--src/test/ui/associated-types/associated-types-path-2.stderr32
-rw-r--r--src/test/ui/associated-types/associated-types-projection-to-unrelated-trait-in-method-without-default.stderr4
-rw-r--r--src/test/ui/associated-types/defaults-suitability.stderr6
-rw-r--r--src/test/ui/associated-types/higher-ranked-projection.badbase.stderr17
-rw-r--r--src/test/ui/associated-types/higher-ranked-projection.badnll.stderr2
-rw-r--r--src/test/ui/associated-types/hr-associated-type-bound-2.stderr4
-rw-r--r--src/test/ui/associated-types/impl-wf-cycle-1.stderr4
-rw-r--r--src/test/ui/associated-types/impl-wf-cycle-2.stderr2
-rw-r--r--src/test/ui/associated-types/issue-22560.stderr46
-rw-r--r--src/test/ui/associated-types/issue-27675-unchecked-bounds.stderr6
-rw-r--r--src/test/ui/associated-types/issue-44153.stderr2
-rw-r--r--src/test/ui/associated-types/issue-59324.rs2
-rw-r--r--src/test/ui/associated-types/issue-59324.stderr17
-rw-r--r--src/test/ui/associated-types/issue-62200.rs3
-rw-r--r--src/test/ui/associated-types/issue-62200.stderr3
-rw-r--r--src/test/ui/associated-types/issue-65774-1.stderr2
-rw-r--r--src/test/ui/associated-types/issue-87261.stderr84
-rw-r--r--src/test/ui/associated-types/substs-ppaux.normal.stderr8
-rw-r--r--src/test/ui/associated-types/substs-ppaux.verbose.stderr8
32 files changed, 188 insertions, 142 deletions
diff --git a/src/test/ui/associated-types/associated-type-projection-from-supertrait.stderr b/src/test/ui/associated-types/associated-type-projection-from-supertrait.stderr
index b904ad102..e761c6c62 100644
--- a/src/test/ui/associated-types/associated-type-projection-from-supertrait.stderr
+++ b/src/test/ui/associated-types/associated-type-projection-from-supertrait.stderr
@@ -10,7 +10,7 @@ note: function defined here
--> $DIR/associated-type-projection-from-supertrait.rs:25:4
|
LL | fn dent<C:Car>(c: C, color: C::Color) { c.chip_paint(color) }
- | ^^^^ ---- ---------------
+ | ^^^^ ---------------
error[E0308]: mismatched types
--> $DIR/associated-type-projection-from-supertrait.rs:28:23
@@ -24,7 +24,7 @@ note: function defined here
--> $DIR/associated-type-projection-from-supertrait.rs:25:4
|
LL | fn dent<C:Car>(c: C, color: C::Color) { c.chip_paint(color) }
- | ^^^^ ---- ---------------
+ | ^^^^ ---------------
error[E0308]: mismatched types
--> $DIR/associated-type-projection-from-supertrait.rs:32:28
@@ -38,7 +38,7 @@ note: associated function defined here
--> $DIR/associated-type-projection-from-supertrait.rs:12:8
|
LL | fn chip_paint(&self, c: Self::Color) { }
- | ^^^^^^^^^^ ----- --------------
+ | ^^^^^^^^^^ --------------
error[E0308]: mismatched types
--> $DIR/associated-type-projection-from-supertrait.rs:33:28
@@ -52,7 +52,7 @@ note: associated function defined here
--> $DIR/associated-type-projection-from-supertrait.rs:12:8
|
LL | fn chip_paint(&self, c: Self::Color) { }
- | ^^^^^^^^^^ ----- --------------
+ | ^^^^^^^^^^ --------------
error: aborting due to 4 previous errors
diff --git a/src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.stderr b/src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.stderr
index 0cccc6b38..a777e064f 100644
--- a/src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.stderr
+++ b/src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.stderr
@@ -1,8 +1,10 @@
error[E0271]: type mismatch resolving `<ModelT as Vehicle>::Color == Blue`
- --> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:31:10
+ --> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:31:19
|
LL | fn b() { blue_car(ModelT); }
- | ^^^^^^^^ type mismatch resolving `<ModelT as Vehicle>::Color == Blue`
+ | -------- ^^^^^^ type mismatch resolving `<ModelT as Vehicle>::Color == Blue`
+ | |
+ | required by a bound introduced by this call
|
note: expected this to be `Blue`
--> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:16:40
@@ -16,10 +18,12 @@ LL | fn blue_car<C:Car<Color=Blue>>(c: C) {
| ^^^^^^^^^^ required by this bound in `blue_car`
error[E0271]: type mismatch resolving `<ModelU as Vehicle>::Color == Black`
- --> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:32:10
+ --> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:32:20
|
LL | fn c() { black_car(ModelU); }
- | ^^^^^^^^^ type mismatch resolving `<ModelU as Vehicle>::Color == Black`
+ | --------- ^^^^^^ type mismatch resolving `<ModelU as Vehicle>::Color == Black`
+ | |
+ | required by a bound introduced by this call
|
note: expected this to be `Black`
--> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:21:40
diff --git a/src/test/ui/associated-types/associated-types-eq-3.stderr b/src/test/ui/associated-types/associated-types-eq-3.stderr
index bed63a5e6..fbe1a1ee8 100644
--- a/src/test/ui/associated-types/associated-types-eq-3.stderr
+++ b/src/test/ui/associated-types/associated-types-eq-3.stderr
@@ -14,10 +14,12 @@ LL | fn foo2<I: Foo<A = Bar>>(x: I) {
| +++++++++
error[E0271]: type mismatch resolving `<isize as Foo>::A == Bar`
- --> $DIR/associated-types-eq-3.rs:38:5
+ --> $DIR/associated-types-eq-3.rs:38:10
|
LL | foo1(a);
- | ^^^^ type mismatch resolving `<isize as Foo>::A == Bar`
+ | ---- ^ type mismatch resolving `<isize as Foo>::A == Bar`
+ | |
+ | required by a bound introduced by this call
|
note: expected this to be `Bar`
--> $DIR/associated-types-eq-3.rs:12:14
diff --git a/src/test/ui/associated-types/associated-types-eq-hr.stderr b/src/test/ui/associated-types/associated-types-eq-hr.stderr
index b306ae273..6cff403b3 100644
--- a/src/test/ui/associated-types/associated-types-eq-hr.stderr
+++ b/src/test/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`
- --> $DIR/associated-types-eq-hr.rs:87:5
+ --> $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 `for<'x> <UintStruct as TheTrait<&'x isize>>::A == &'x isize`
|
note: expected this to be `&isize`
--> $DIR/associated-types-eq-hr.rs:26:14
@@ -21,10 +21,10 @@ 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`
- --> $DIR/associated-types-eq-hr.rs:91:5
+ --> $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 `for<'x> <IntStruct as TheTrait<&'x isize>>::A == &'x usize`
|
note: expected this to be `&usize`
--> $DIR/associated-types-eq-hr.rs:14:14
diff --git a/src/test/ui/associated-types/associated-types-for-unimpl-trait.stderr b/src/test/ui/associated-types/associated-types-for-unimpl-trait.stderr
index 6552c8be7..389cc7bed 100644
--- a/src/test/ui/associated-types/associated-types-for-unimpl-trait.stderr
+++ b/src/test/ui/associated-types/associated-types-for-unimpl-trait.stderr
@@ -1,8 +1,8 @@
error[E0277]: the trait bound `Self: Get` is not satisfied
- --> $DIR/associated-types-for-unimpl-trait.rs:10:40
+ --> $DIR/associated-types-for-unimpl-trait.rs:10:5
|
LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) {}
- | ^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self`
|
help: consider further restricting `Self`
|
diff --git a/src/test/ui/associated-types/associated-types-issue-20346.stderr b/src/test/ui/associated-types/associated-types-issue-20346.stderr
index a67cf9928..b1708b96e 100644
--- a/src/test/ui/associated-types/associated-types-issue-20346.stderr
+++ b/src/test/ui/associated-types/associated-types-issue-20346.stderr
@@ -1,11 +1,13 @@
error[E0271]: type mismatch resolving `<Adapter<I> as Iterator>::Item == Option<T>`
- --> $DIR/associated-types-issue-20346.rs:34:5
+ --> $DIR/associated-types-issue-20346.rs:34:36
|
LL | fn test_adapter<T, I: Iterator<Item=Option<T>>>(it: I) {
| - this type parameter
...
LL | is_iterator_of::<Option<T>, _>(&adapter);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type mismatch resolving `<Adapter<I> as Iterator>::Item == Option<T>`
+ | ------------------------------ ^^^^^^^^ type mismatch resolving `<Adapter<I> as Iterator>::Item == Option<T>`
+ | |
+ | required by a bound introduced by this call
|
note: expected this to be `Option<T>`
--> $DIR/associated-types-issue-20346.rs:23:17
diff --git a/src/test/ui/associated-types/associated-types-multiple-types-one-trait.stderr b/src/test/ui/associated-types/associated-types-multiple-types-one-trait.stderr
index 922cf88a0..89cdba524 100644
--- a/src/test/ui/associated-types/associated-types-multiple-types-one-trait.stderr
+++ b/src/test/ui/associated-types/associated-types-multiple-types-one-trait.stderr
@@ -1,8 +1,10 @@
error[E0271]: type mismatch resolving `<T as Foo>::Y == i32`
- --> $DIR/associated-types-multiple-types-one-trait.rs:13:5
+ --> $DIR/associated-types-multiple-types-one-trait.rs:13:12
|
LL | want_y(t);
- | ^^^^^^ expected `i32`, found associated type
+ | ------ ^ expected `i32`, found associated type
+ | |
+ | required by a bound introduced by this call
|
= note: expected type `i32`
found associated type `<T as Foo>::Y`
@@ -17,10 +19,12 @@ LL | fn have_x_want_y<T:Foo<X=u32, Y = i32>>(t: &T)
| +++++++++
error[E0271]: type mismatch resolving `<T as Foo>::X == u32`
- --> $DIR/associated-types-multiple-types-one-trait.rs:18:5
+ --> $DIR/associated-types-multiple-types-one-trait.rs:18:12
|
LL | want_x(t);
- | ^^^^^^ expected `u32`, found associated type
+ | ------ ^ expected `u32`, found associated type
+ | |
+ | required by a bound introduced by this call
|
= note: expected type `u32`
found associated type `<T as Foo>::X`
diff --git a/src/test/ui/associated-types/associated-types-no-suitable-bound.stderr b/src/test/ui/associated-types/associated-types-no-suitable-bound.stderr
index b2ee1b5e6..1feaa612e 100644
--- a/src/test/ui/associated-types/associated-types-no-suitable-bound.stderr
+++ b/src/test/ui/associated-types/associated-types-no-suitable-bound.stderr
@@ -1,8 +1,8 @@
error[E0277]: the trait bound `T: Get` is not satisfied
- --> $DIR/associated-types-no-suitable-bound.rs:11:21
+ --> $DIR/associated-types-no-suitable-bound.rs:11:5
|
LL | fn uhoh<T>(foo: <T as Get>::Value) {}
- | ^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `T`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `T`
|
help: consider restricting type parameter `T`
|
diff --git a/src/test/ui/associated-types/associated-types-no-suitable-supertrait-2.stderr b/src/test/ui/associated-types/associated-types-no-suitable-supertrait-2.stderr
index 2e40dbd06..cc3ed5561 100644
--- a/src/test/ui/associated-types/associated-types-no-suitable-supertrait-2.stderr
+++ b/src/test/ui/associated-types/associated-types-no-suitable-supertrait-2.stderr
@@ -1,8 +1,8 @@
error[E0277]: the trait bound `Self: Get` is not satisfied
- --> $DIR/associated-types-no-suitable-supertrait-2.rs:17:40
+ --> $DIR/associated-types-no-suitable-supertrait-2.rs:17:5
|
LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) {}
- | ^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self`
|
help: consider further restricting `Self`
|
diff --git a/src/test/ui/associated-types/associated-types-no-suitable-supertrait.stderr b/src/test/ui/associated-types/associated-types-no-suitable-supertrait.stderr
index bd3ee2abd..18f2830d8 100644
--- a/src/test/ui/associated-types/associated-types-no-suitable-supertrait.stderr
+++ b/src/test/ui/associated-types/associated-types-no-suitable-supertrait.stderr
@@ -1,14 +1,14 @@
error[E0277]: the trait bound `(T, U): Get` is not satisfied
- --> $DIR/associated-types-no-suitable-supertrait.rs:22:40
+ --> $DIR/associated-types-no-suitable-supertrait.rs:22:5
|
LL | fn uhoh<U:Get>(&self, foo: U, bar: <(T, U) as Get>::Value) {}
- | ^^^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `(T, U)`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `(T, U)`
error[E0277]: the trait bound `Self: Get` is not satisfied
- --> $DIR/associated-types-no-suitable-supertrait.rs:17:40
+ --> $DIR/associated-types-no-suitable-supertrait.rs:17:5
|
LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) {}
- | ^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self`
|
help: consider further restricting `Self`
|
diff --git a/src/test/ui/associated-types/associated-types-overridden-binding-2.rs b/src/test/ui/associated-types/associated-types-overridden-binding-2.rs
index 109feb8e9..26b9f4b3a 100644
--- a/src/test/ui/associated-types/associated-types-overridden-binding-2.rs
+++ b/src/test/ui/associated-types/associated-types-overridden-binding-2.rs
@@ -4,5 +4,5 @@ trait I32Iterator = Iterator<Item = i32>;
fn main() {
let _: &dyn I32Iterator<Item = u32> = &vec![42].into_iter();
- //~^ ERROR type mismatch
+ //~^ ERROR expected `std::vec::IntoIter<u32>` to be an iterator that yields `i32`, but it yields `u32`
}
diff --git a/src/test/ui/associated-types/associated-types-overridden-binding-2.stderr b/src/test/ui/associated-types/associated-types-overridden-binding-2.stderr
index dbd9a44ed..2d25f68de 100644
--- a/src/test/ui/associated-types/associated-types-overridden-binding-2.stderr
+++ b/src/test/ui/associated-types/associated-types-overridden-binding-2.stderr
@@ -1,4 +1,4 @@
-error[E0271]: type mismatch resolving `<std::vec::IntoIter<u32> as Iterator>::Item == i32`
+error[E0271]: expected `std::vec::IntoIter<u32>` to be an iterator that yields `i32`, but it yields `u32`
--> $DIR/associated-types-overridden-binding-2.rs:6:43
|
LL | let _: &dyn I32Iterator<Item = u32> = &vec![42].into_iter();
diff --git a/src/test/ui/associated-types/associated-types-path-2.rs b/src/test/ui/associated-types/associated-types-path-2.rs
index c993e1d27..00066efcc 100644
--- a/src/test/ui/associated-types/associated-types-path-2.rs
+++ b/src/test/ui/associated-types/associated-types-path-2.rs
@@ -29,12 +29,14 @@ pub fn f1_uint_uint() {
f1(2u32, 4u32);
//~^ ERROR `u32: Foo` is not satisfied
//~| ERROR `u32: Foo` is not satisfied
+ //~| ERROR `u32: Foo` is not satisfied
}
pub fn f1_uint_int() {
f1(2u32, 4i32);
//~^ ERROR `u32: Foo` is not satisfied
//~| ERROR `u32: Foo` is not satisfied
+ //~| ERROR `u32: Foo` is not satisfied
}
pub fn f2_int() {
diff --git a/src/test/ui/associated-types/associated-types-path-2.stderr b/src/test/ui/associated-types/associated-types-path-2.stderr
index 1d0b84d31..206f49024 100644
--- a/src/test/ui/associated-types/associated-types-path-2.stderr
+++ b/src/test/ui/associated-types/associated-types-path-2.stderr
@@ -10,17 +10,19 @@ note: function defined here
--> $DIR/associated-types-path-2.rs:13:8
|
LL | pub fn f1<T: Foo>(a: T, x: T::A) {}
- | ^^ ---- -------
+ | ^^ -------
help: change the type of the numeric literal from `i32` to `u32`
|
LL | f1(2i32, 4u32);
| ~~~
error[E0277]: the trait bound `u32: Foo` is not satisfied
- --> $DIR/associated-types-path-2.rs:29:5
+ --> $DIR/associated-types-path-2.rs:29:8
|
LL | f1(2u32, 4u32);
- | ^^ the trait `Foo` is not implemented for `u32`
+ | -- ^^^^ the trait `Foo` is not implemented for `u32`
+ | |
+ | required by a bound introduced by this call
|
= help: the trait `Foo` is implemented for `i32`
note: required by a bound in `f1`
@@ -30,6 +32,14 @@ LL | pub fn f1<T: Foo>(a: T, x: T::A) {}
| ^^^ required by this bound in `f1`
error[E0277]: the trait bound `u32: Foo` is not satisfied
+ --> $DIR/associated-types-path-2.rs:29:5
+ |
+LL | f1(2u32, 4u32);
+ | ^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `u32`
+ |
+ = help: the trait `Foo` is implemented for `i32`
+
+error[E0277]: the trait bound `u32: Foo` is not satisfied
--> $DIR/associated-types-path-2.rs:29:14
|
LL | f1(2u32, 4u32);
@@ -38,7 +48,7 @@ LL | f1(2u32, 4u32);
= help: the trait `Foo` is implemented for `i32`
error[E0277]: the trait bound `u32: Foo` is not satisfied
- --> $DIR/associated-types-path-2.rs:35:8
+ --> $DIR/associated-types-path-2.rs:36:8
|
LL | f1(2u32, 4i32);
| -- ^^^^ the trait `Foo` is not implemented for `u32`
@@ -53,7 +63,15 @@ LL | pub fn f1<T: Foo>(a: T, x: T::A) {}
| ^^^ required by this bound in `f1`
error[E0277]: the trait bound `u32: Foo` is not satisfied
- --> $DIR/associated-types-path-2.rs:35:14
+ --> $DIR/associated-types-path-2.rs:36:5
+ |
+LL | f1(2u32, 4i32);
+ | ^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `u32`
+ |
+ = help: the trait `Foo` is implemented for `i32`
+
+error[E0277]: the trait bound `u32: Foo` is not satisfied
+ --> $DIR/associated-types-path-2.rs:36:14
|
LL | f1(2u32, 4i32);
| ^^^^ the trait `Foo` is not implemented for `u32`
@@ -61,7 +79,7 @@ LL | f1(2u32, 4i32);
= help: the trait `Foo` is implemented for `i32`
error[E0308]: mismatched types
- --> $DIR/associated-types-path-2.rs:41:18
+ --> $DIR/associated-types-path-2.rs:43:18
|
LL | let _: i32 = f2(2i32);
| --- ^^^^^^^^ expected `i32`, found `u32`
@@ -73,7 +91,7 @@ help: you can convert a `u32` to an `i32` and panic if the converted value doesn
LL | let _: i32 = f2(2i32).try_into().unwrap();
| ++++++++++++++++++++
-error: aborting due to 6 previous errors
+error: aborting due to 8 previous errors
Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.
diff --git a/src/test/ui/associated-types/associated-types-projection-to-unrelated-trait-in-method-without-default.stderr b/src/test/ui/associated-types/associated-types-projection-to-unrelated-trait-in-method-without-default.stderr
index 2e67c2194..66d59bccd 100644
--- a/src/test/ui/associated-types/associated-types-projection-to-unrelated-trait-in-method-without-default.stderr
+++ b/src/test/ui/associated-types/associated-types-projection-to-unrelated-trait-in-method-without-default.stderr
@@ -1,8 +1,8 @@
error[E0277]: the trait bound `Self: Get` is not satisfied
- --> $DIR/associated-types-projection-to-unrelated-trait-in-method-without-default.rs:10:40
+ --> $DIR/associated-types-projection-to-unrelated-trait-in-method-without-default.rs:10:5
|
LL | fn okay<U:Get>(&self, foo: U, bar: <Self as Get>::Value);
- | ^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self`
|
help: consider further restricting `Self`
|
diff --git a/src/test/ui/associated-types/defaults-suitability.stderr b/src/test/ui/associated-types/defaults-suitability.stderr
index 43541c5df..eadad4cd5 100644
--- a/src/test/ui/associated-types/defaults-suitability.stderr
+++ b/src/test/ui/associated-types/defaults-suitability.stderr
@@ -39,7 +39,7 @@ error[E0277]: the trait bound `T: Clone` is not satisfied
LL | type Bar: Clone = Vec<T>;
| ^^^^^^ the trait `Clone` is not implemented for `T`
|
- = note: required because of the requirements on the impl of `Clone` for `Vec<T>`
+ = note: required for `Vec<T>` to implement `Clone`
note: required by a bound in `Foo::Bar`
--> $DIR/defaults-suitability.rs:28:15
|
@@ -83,7 +83,7 @@ error[E0277]: the trait bound `<Self as Foo2<T>>::Baz: Clone` is not satisfied
LL | type Bar: Clone = Vec<Self::Baz>;
| ^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `<Self as Foo2<T>>::Baz`
|
- = note: required because of the requirements on the impl of `Clone` for `Vec<<Self as Foo2<T>>::Baz>`
+ = note: required for `Vec<<Self as Foo2<T>>::Baz>` to implement `Clone`
note: required by a bound in `Foo2::Bar`
--> $DIR/defaults-suitability.rs:65:15
|
@@ -100,7 +100,7 @@ error[E0277]: the trait bound `<Self as Foo25<T>>::Baz: Clone` is not satisfied
LL | type Bar: Clone = Vec<Self::Baz>;
| ^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `<Self as Foo25<T>>::Baz`
|
- = note: required because of the requirements on the impl of `Clone` for `Vec<<Self as Foo25<T>>::Baz>`
+ = note: required for `Vec<<Self as Foo25<T>>::Baz>` to implement `Clone`
note: required by a bound in `Foo25::Bar`
--> $DIR/defaults-suitability.rs:74:15
|
diff --git a/src/test/ui/associated-types/higher-ranked-projection.badbase.stderr b/src/test/ui/associated-types/higher-ranked-projection.badbase.stderr
deleted file mode 100644
index 8b2b87223..000000000
--- a/src/test/ui/associated-types/higher-ranked-projection.badbase.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-error[E0308]: mismatched types
- --> $DIR/higher-ranked-projection.rs:25:5
- |
-LL | foo(());
- | ^^^^^^^ one type is more general than the other
- |
- = note: expected reference `&'a ()`
- found reference `&()`
-note: the lifetime requirement is introduced here
- --> $DIR/higher-ranked-projection.rs:16:33
- |
-LL | where for<'a> &'a T: Mirror<Image=U>
- | ^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/associated-types/higher-ranked-projection.badnll.stderr b/src/test/ui/associated-types/higher-ranked-projection.badnll.stderr
deleted file mode 100644
index 217392aa3..000000000
--- a/src/test/ui/associated-types/higher-ranked-projection.badnll.stderr
+++ /dev/null
@@ -1,2 +0,0 @@
-error: unknown debugging option: `borrowck`
-
diff --git a/src/test/ui/associated-types/hr-associated-type-bound-2.stderr b/src/test/ui/associated-types/hr-associated-type-bound-2.stderr
index e007f5a16..a85edd7a0 100644
--- a/src/test/ui/associated-types/hr-associated-type-bound-2.stderr
+++ b/src/test/ui/associated-types/hr-associated-type-bound-2.stderr
@@ -5,13 +5,13 @@ LL | impl X<'_> for u32
| ^^^^^^^^^^^^^^^^^^
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`hr_associated_type_bound_2`)
-note: required because of the requirements on the impl of `for<'b> X<'b>` for `u32`
+note: required for `u32` to implement `for<'b> X<'b>`
--> $DIR/hr-associated-type-bound-2.rs:11:6
|
LL | impl X<'_> for u32
| ^^^^^ ^^^
= note: 128 redundant requirements hidden
- = note: required because of the requirements on the impl of `for<'b> X<'b>` for `u32`
+ = note: required for `u32` to implement `for<'b> X<'b>`
error: aborting due to previous error
diff --git a/src/test/ui/associated-types/impl-wf-cycle-1.stderr b/src/test/ui/associated-types/impl-wf-cycle-1.stderr
index 939c9bbdb..6661347e4 100644
--- a/src/test/ui/associated-types/impl-wf-cycle-1.stderr
+++ b/src/test/ui/associated-types/impl-wf-cycle-1.stderr
@@ -4,13 +4,13 @@ error[E0275]: overflow evaluating the requirement `<(T,) as Grault>::A == _`
LL | impl<T: Grault> Grault for (T,)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
-note: required because of the requirements on the impl of `Grault` for `(T,)`
+note: required for `(T,)` to implement `Grault`
--> $DIR/impl-wf-cycle-1.rs:15:17
|
LL | impl<T: Grault> Grault for (T,)
| ^^^^^^ ^^^^
= note: 1 redundant requirement hidden
- = note: required because of the requirements on the impl of `Grault` for `(T,)`
+ = note: required for `(T,)` to implement `Grault`
error: aborting due to previous error
diff --git a/src/test/ui/associated-types/impl-wf-cycle-2.stderr b/src/test/ui/associated-types/impl-wf-cycle-2.stderr
index d02ed2cac..ec4ffe27c 100644
--- a/src/test/ui/associated-types/impl-wf-cycle-2.stderr
+++ b/src/test/ui/associated-types/impl-wf-cycle-2.stderr
@@ -4,7 +4,7 @@ error[E0275]: overflow evaluating the requirement `<(T,) as Grault>::A == _`
LL | impl<T: Grault> Grault for (T,)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
-note: required because of the requirements on the impl of `Grault` for `(T,)`
+note: required for `(T,)` to implement `Grault`
--> $DIR/impl-wf-cycle-2.rs:7:17
|
LL | impl<T: Grault> Grault for (T,)
diff --git a/src/test/ui/associated-types/issue-22560.stderr b/src/test/ui/associated-types/issue-22560.stderr
index 700923c1b..2b88cf0b4 100644
--- a/src/test/ui/associated-types/issue-22560.stderr
+++ b/src/test/ui/associated-types/issue-22560.stderr
@@ -1,25 +1,3 @@
-error[E0393]: the type parameter `Rhs` must be explicitly specified
- --> $DIR/issue-22560.rs:9:23
- |
-LL | trait Sub<Rhs=Self> {
- | ------------------- type parameter `Rhs` must be specified for this
-...
-LL | type Test = dyn Add + Sub;
- | ^^^ help: set the type parameter to the desired type: `Sub<Rhs>`
- |
- = note: because of the default `Self` reference, type parameters must be specified on object types
-
-error[E0393]: the type parameter `Rhs` must be explicitly specified
- --> $DIR/issue-22560.rs:9:17
- |
-LL | trait Add<Rhs=Self> {
- | ------------------- type parameter `Rhs` must be specified for this
-...
-LL | type Test = dyn Add + Sub;
- | ^^^ help: set the type parameter to the desired type: `Add<Rhs>`
- |
- = note: because of the default `Self` reference, type parameters must be specified on object types
-
error[E0225]: only auto traits can be used as additional traits in a trait object
--> $DIR/issue-22560.rs:9:23
|
@@ -28,7 +6,7 @@ LL | type Test = dyn Add + Sub;
| |
| first non-auto trait
|
- = help: consider creating a new trait with all of these as supertraits and using that trait here instead: `trait NewTrait: Add<[type error]> + Sub<[type error]> {}`
+ = help: consider creating a new trait with all of these as supertraits and using that trait here instead: `trait NewTrait: Add + Sub {}`
= note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>
error[E0191]: the value of the associated types `Output` (from trait `Add`), `Output` (from trait `Sub`) must be specified
@@ -50,6 +28,28 @@ help: specify the associated types
LL | type Test = dyn Add<Output = Type> + Sub<Output = Type>;
| ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
+error[E0393]: the type parameter `Rhs` must be explicitly specified
+ --> $DIR/issue-22560.rs:9:17
+ |
+LL | trait Add<Rhs=Self> {
+ | ------------------- type parameter `Rhs` must be specified for this
+...
+LL | type Test = dyn Add + Sub;
+ | ^^^ help: set the type parameter to the desired type: `Add<Rhs>`
+ |
+ = note: because of the default `Self` reference, type parameters must be specified on object types
+
+error[E0393]: the type parameter `Rhs` must be explicitly specified
+ --> $DIR/issue-22560.rs:9:23
+ |
+LL | trait Sub<Rhs=Self> {
+ | ------------------- type parameter `Rhs` must be specified for this
+...
+LL | type Test = dyn Add + Sub;
+ | ^^^ help: set the type parameter to the desired type: `Sub<Rhs>`
+ |
+ = note: because of the default `Self` reference, type parameters must be specified on object types
+
error: aborting due to 4 previous errors
Some errors have detailed explanations: E0191, E0225, E0393.
diff --git a/src/test/ui/associated-types/issue-27675-unchecked-bounds.stderr b/src/test/ui/associated-types/issue-27675-unchecked-bounds.stderr
index 22daaf329..a14a273b3 100644
--- a/src/test/ui/associated-types/issue-27675-unchecked-bounds.stderr
+++ b/src/test/ui/associated-types/issue-27675-unchecked-bounds.stderr
@@ -1,10 +1,8 @@
error[E0277]: the trait bound `T: Copy` is not satisfied
- --> $DIR/issue-27675-unchecked-bounds.rs:15:31
+ --> $DIR/issue-27675-unchecked-bounds.rs:15:12
|
LL | copy::<dyn Setup<From=T>>(t)
- | ------------------------- ^ the trait `Copy` is not implemented for `T`
- | |
- | required by a bound introduced by this call
+ | ^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `T`
|
note: required by a bound in `copy`
--> $DIR/issue-27675-unchecked-bounds.rs:10:12
diff --git a/src/test/ui/associated-types/issue-44153.stderr b/src/test/ui/associated-types/issue-44153.stderr
index 200efbe02..9c92f19d8 100644
--- a/src/test/ui/associated-types/issue-44153.stderr
+++ b/src/test/ui/associated-types/issue-44153.stderr
@@ -9,7 +9,7 @@ note: expected this to be `&()`
|
LL | type Element = ();
| ^^
-note: required because of the requirements on the impl of `Visit` for `()`
+note: required for `()` to implement `Visit`
--> $DIR/issue-44153.rs:13:10
|
LL | impl<'a> Visit for () where
diff --git a/src/test/ui/associated-types/issue-59324.rs b/src/test/ui/associated-types/issue-59324.rs
index 162f9e00e..9e68e9e77 100644
--- a/src/test/ui/associated-types/issue-59324.rs
+++ b/src/test/ui/associated-types/issue-59324.rs
@@ -15,9 +15,9 @@ pub trait ThriftService<Bug: NotFoo>:
{
fn get_service(
//~^ ERROR the trait bound `Bug: Foo` is not satisfied
+ //~| ERROR the trait bound `Bug: Foo` is not satisfied
&self,
) -> Self::AssocType;
- //~^ the trait bound `Bug: Foo` is not satisfied
}
fn with_factory<H>(factory: dyn ThriftService<()>) {}
diff --git a/src/test/ui/associated-types/issue-59324.stderr b/src/test/ui/associated-types/issue-59324.stderr
index a84b599b5..62cf1f37a 100644
--- a/src/test/ui/associated-types/issue-59324.stderr
+++ b/src/test/ui/associated-types/issue-59324.stderr
@@ -20,7 +20,7 @@ LL | |
LL | |
LL | | Service<AssocType = <Bug as Foo>::OnlyFoo>
... |
-LL | |
+LL | | ) -> Self::AssocType;
LL | | }
| |_^ the trait `Foo` is not implemented for `Bug`
|
@@ -34,6 +34,7 @@ error[E0277]: the trait bound `Bug: Foo` is not satisfied
|
LL | / fn get_service(
LL | |
+LL | |
LL | | &self,
LL | | ) -> Self::AssocType;
| |_________________________^ the trait `Foo` is not implemented for `Bug`
@@ -44,16 +45,20 @@ LL | pub trait ThriftService<Bug: NotFoo + Foo>:
| +++++
error[E0277]: the trait bound `(): Foo` is not satisfied
- --> $DIR/issue-59324.rs:23:29
+ --> $DIR/issue-59324.rs:23:1
|
LL | fn with_factory<H>(factory: dyn ThriftService<()>) {}
- | ^^^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `()`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `()`
error[E0277]: the trait bound `Bug: Foo` is not satisfied
- --> $DIR/issue-59324.rs:19:10
+ --> $DIR/issue-59324.rs:16:5
|
-LL | ) -> Self::AssocType;
- | ^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `Bug`
+LL | / fn get_service(
+LL | |
+LL | |
+LL | | &self,
+LL | | ) -> Self::AssocType;
+ | |_________________________^ the trait `Foo` is not implemented for `Bug`
|
help: consider further restricting this bound
|
diff --git a/src/test/ui/associated-types/issue-62200.rs b/src/test/ui/associated-types/issue-62200.rs
index 9d18690e9..499bbd6b6 100644
--- a/src/test/ui/associated-types/issue-62200.rs
+++ b/src/test/ui/associated-types/issue-62200.rs
@@ -10,6 +10,7 @@ impl T<'_> for S {
fn foo(x: impl Fn(<S as T<'_>>::A) -> <S as T<'_>>::A) {}
//~^ ERROR binding for associated type `Output` references an anonymous lifetime
-//~^^ NOTE lifetimes appearing in an associated type are not considered constrained
+//~| NOTE lifetimes appearing in an associated or opaque type are not considered constrained
+//~| NOTE consider introducing a named lifetime parameter
fn main() {}
diff --git a/src/test/ui/associated-types/issue-62200.stderr b/src/test/ui/associated-types/issue-62200.stderr
index f14cd81fd..04f0728f5 100644
--- a/src/test/ui/associated-types/issue-62200.stderr
+++ b/src/test/ui/associated-types/issue-62200.stderr
@@ -4,7 +4,8 @@ error[E0582]: binding for associated type `Output` references an anonymous lifet
LL | fn foo(x: impl Fn(<S as T<'_>>::A) -> <S as T<'_>>::A) {}
| ^^^^^^^^^^^^^^^
|
- = note: lifetimes appearing in an associated type are not considered constrained
+ = note: lifetimes appearing in an associated or opaque type are not considered constrained
+ = note: consider introducing a named lifetime parameter
error: aborting due to previous error
diff --git a/src/test/ui/associated-types/issue-65774-1.stderr b/src/test/ui/associated-types/issue-65774-1.stderr
index 419de689c..3b294d65d 100644
--- a/src/test/ui/associated-types/issue-65774-1.stderr
+++ b/src/test/ui/associated-types/issue-65774-1.stderr
@@ -18,7 +18,7 @@ LL | let closure = |config: &mut <S as MPU>::MpuConfig| writer.my_write(
| ^^^^^^^ the trait `MyDisplay` is not implemented for `T`
|
= help: the trait `MyDisplay` is implemented for `&'a mut T`
-note: required because of the requirements on the impl of `MyDisplay` for `&mut T`
+note: required for `&mut T` to implement `MyDisplay`
--> $DIR/issue-65774-1.rs:5:24
|
LL | impl<'a, T: MyDisplay> MyDisplay for &'a mut T { }
diff --git a/src/test/ui/associated-types/issue-87261.stderr b/src/test/ui/associated-types/issue-87261.stderr
index 8db4a49da..f24423dd1 100644
--- a/src/test/ui/associated-types/issue-87261.stderr
+++ b/src/test/ui/associated-types/issue-87261.stderr
@@ -1,8 +1,10 @@
error[E0271]: type mismatch resolving `<A as Trait>::Associated == ()`
- --> $DIR/issue-87261.rs:56:5
+ --> $DIR/issue-87261.rs:56:19
|
LL | accepts_trait(a);
- | ^^^^^^^^^^^^^ expected `()`, found associated type
+ | ------------- ^ expected `()`, found associated type
+ | |
+ | required by a bound introduced by this call
|
= note: expected unit type `()`
found associated type `<A as Trait>::Associated`
@@ -17,10 +19,12 @@ LL | A: Trait<Associated = ()> + 'static,
| +++++++++++++++++
error[E0271]: type mismatch resolving `<B as Trait>::Associated == ()`
- --> $DIR/issue-87261.rs:59:5
+ --> $DIR/issue-87261.rs:59:19
|
LL | accepts_trait(b);
- | ^^^^^^^^^^^^^ expected `()`, found associated type
+ | ------------- ^ expected `()`, found associated type
+ | |
+ | required by a bound introduced by this call
|
= note: expected unit type `()`
found associated type `<B as Trait>::Associated`
@@ -33,10 +37,12 @@ LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
| ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
error[E0271]: type mismatch resolving `<C as Trait>::Associated == ()`
- --> $DIR/issue-87261.rs:62:5
+ --> $DIR/issue-87261.rs:62:19
|
LL | accepts_trait(c);
- | ^^^^^^^^^^^^^ expected `()`, found associated type
+ | ------------- ^ expected `()`, found associated type
+ | |
+ | required by a bound introduced by this call
|
= note: expected unit type `()`
found associated type `<C as Trait>::Associated`
@@ -51,10 +57,12 @@ LL | C: Trait<Associated = ()> + Foo,
| +++++++++++++++++
error[E0271]: type mismatch resolving `<D as Trait>::Associated == ()`
- --> $DIR/issue-87261.rs:65:5
+ --> $DIR/issue-87261.rs:65:19
|
LL | accepts_trait(d);
- | ^^^^^^^^^^^^^ expected `()`, found associated type
+ | ------------- ^ expected `()`, found associated type
+ | |
+ | required by a bound introduced by this call
|
= note: expected unit type `()`
found associated type `<D as Trait>::Associated`
@@ -67,10 +75,12 @@ LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
| ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
error[E0271]: type mismatch resolving `<E as GenericTrait<()>>::Associated == ()`
- --> $DIR/issue-87261.rs:68:5
+ --> $DIR/issue-87261.rs:68:27
|
LL | accepts_generic_trait(e);
- | ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
+ | --------------------- ^ expected `()`, found associated type
+ | |
+ | required by a bound introduced by this call
|
= note: expected unit type `()`
found associated type `<E as GenericTrait<()>>::Associated`
@@ -85,10 +95,12 @@ LL | E: GenericTrait<(), Associated = ()> + 'static,
| +++++++++++++++++
error[E0271]: type mismatch resolving `<F as GenericTrait<()>>::Associated == ()`
- --> $DIR/issue-87261.rs:71:5
+ --> $DIR/issue-87261.rs:71:27
|
LL | accepts_generic_trait(f);
- | ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
+ | --------------------- ^ expected `()`, found associated type
+ | |
+ | required by a bound introduced by this call
|
= note: expected unit type `()`
found associated type `<F as GenericTrait<()>>::Associated`
@@ -103,10 +115,12 @@ LL | F: GenericTrait<(), Associated = ()> + Foo,
| +++++++++++++++++
error[E0271]: type mismatch resolving `<G as GenericTrait<()>>::Associated == ()`
- --> $DIR/issue-87261.rs:74:5
+ --> $DIR/issue-87261.rs:74:27
|
LL | accepts_generic_trait(g);
- | ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
+ | --------------------- ^ expected `()`, found associated type
+ | |
+ | required by a bound introduced by this call
|
= note: expected unit type `()`
found associated type `<G as GenericTrait<()>>::Associated`
@@ -119,13 +133,15 @@ LL | fn accepts_generic_trait<T: GenericTrait<(), Associated = ()>>(_: T) {}
| ^^^^^^^^^^^^^^^ required by this bound in `accepts_generic_trait`
error[E0271]: type mismatch resolving `<impl Trait as Trait>::Associated == ()`
- --> $DIR/issue-87261.rs:79:5
+ --> $DIR/issue-87261.rs:79:19
|
LL | fn returns_opaque() -> impl Trait + 'static {
| -------------------- the found opaque type
...
LL | accepts_trait(returns_opaque());
- | ^^^^^^^^^^^^^ expected `()`, found associated type
+ | ------------- ^^^^^^^^^^^^^^^^ expected `()`, found associated type
+ | |
+ | required by a bound introduced by this call
|
= note: expected unit type `()`
found associated type `<impl Trait as Trait>::Associated`
@@ -140,13 +156,15 @@ LL | fn returns_opaque() -> impl Trait<Associated = ()> + 'static {
| +++++++++++++++++
error[E0271]: type mismatch resolving `<impl DerivedTrait as Trait>::Associated == ()`
- --> $DIR/issue-87261.rs:82:5
+ --> $DIR/issue-87261.rs:82:19
|
LL | fn returns_opaque_derived() -> impl DerivedTrait + 'static {
| --------------------------- the found opaque type
...
LL | accepts_trait(returns_opaque_derived());
- | ^^^^^^^^^^^^^ expected `()`, found associated type
+ | ------------- ^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
+ | |
+ | required by a bound introduced by this call
|
= note: expected unit type `()`
found associated type `<impl DerivedTrait as Trait>::Associated`
@@ -161,13 +179,15 @@ LL | fn returns_opaque_derived() -> impl DerivedTrait<Associated = ()> + 'static
| +++++++++++++++++
error[E0271]: type mismatch resolving `<impl Trait + Foo as Trait>::Associated == ()`
- --> $DIR/issue-87261.rs:85:5
+ --> $DIR/issue-87261.rs:85:19
|
LL | fn returns_opaque_foo() -> impl Trait + Foo {
| ---------------- the found opaque type
...
LL | accepts_trait(returns_opaque_foo());
- | ^^^^^^^^^^^^^ expected `()`, found associated type
+ | ------------- ^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
+ | |
+ | required by a bound introduced by this call
|
= note: expected unit type `()`
found associated type `<impl Trait + Foo as Trait>::Associated`
@@ -182,13 +202,15 @@ LL | fn returns_opaque_foo() -> impl Trait<Associated = ()> + Foo {
| +++++++++++++++++
error[E0271]: type mismatch resolving `<impl DerivedTrait + Foo as Trait>::Associated == ()`
- --> $DIR/issue-87261.rs:88:5
+ --> $DIR/issue-87261.rs:88:19
|
LL | fn returns_opaque_derived_foo() -> impl DerivedTrait + Foo {
| ----------------------- the found opaque type
...
LL | accepts_trait(returns_opaque_derived_foo());
- | ^^^^^^^^^^^^^ expected `()`, found associated type
+ | ------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
+ | |
+ | required by a bound introduced by this call
|
= note: expected unit type `()`
found associated type `<impl DerivedTrait + Foo as Trait>::Associated`
@@ -201,13 +223,15 @@ LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
| ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
error[E0271]: type mismatch resolving `<impl GenericTrait<()> as GenericTrait<()>>::Associated == ()`
- --> $DIR/issue-87261.rs:91:5
+ --> $DIR/issue-87261.rs:91:27
|
LL | fn returns_opaque_generic() -> impl GenericTrait<()> + 'static {
| ------------------------------- the found opaque type
...
LL | accepts_generic_trait(returns_opaque_generic());
- | ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
+ | --------------------- ^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
+ | |
+ | required by a bound introduced by this call
|
= note: expected unit type `()`
found associated type `<impl GenericTrait<()> as GenericTrait<()>>::Associated`
@@ -222,13 +246,15 @@ LL | fn returns_opaque_generic() -> impl GenericTrait<(), Associated = ()> + 'st
| +++++++++++++++++
error[E0271]: type mismatch resolving `<impl GenericTrait<()> + Foo as GenericTrait<()>>::Associated == ()`
- --> $DIR/issue-87261.rs:94:5
+ --> $DIR/issue-87261.rs:94:27
|
LL | fn returns_opaque_generic_foo() -> impl GenericTrait<()> + Foo {
| --------------------------- the found opaque type
...
LL | accepts_generic_trait(returns_opaque_generic_foo());
- | ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
+ | --------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
+ | |
+ | required by a bound introduced by this call
|
= note: expected unit type `()`
found associated type `<impl GenericTrait<()> + Foo as GenericTrait<()>>::Associated`
@@ -243,13 +269,15 @@ LL | fn returns_opaque_generic_foo() -> impl GenericTrait<(), Associated = ()> +
| +++++++++++++++++
error[E0271]: type mismatch resolving `<impl GenericTrait<()> + GenericTrait<u8> as GenericTrait<()>>::Associated == ()`
- --> $DIR/issue-87261.rs:97:5
+ --> $DIR/issue-87261.rs:97:27
|
LL | fn returns_opaque_generic_duplicate() -> impl GenericTrait<()> + GenericTrait<u8> {
| ---------------------------------------- the found opaque type
...
LL | accepts_generic_trait(returns_opaque_generic_duplicate());
- | ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
+ | --------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
+ | |
+ | required by a bound introduced by this call
|
= note: expected unit type `()`
found associated type `<impl GenericTrait<()> + GenericTrait<u8> as GenericTrait<()>>::Associated`
diff --git a/src/test/ui/associated-types/substs-ppaux.normal.stderr b/src/test/ui/associated-types/substs-ppaux.normal.stderr
index 085c56870..3f180cf4f 100644
--- a/src/test/ui/associated-types/substs-ppaux.normal.stderr
+++ b/src/test/ui/associated-types/substs-ppaux.normal.stderr
@@ -11,7 +11,7 @@ LL | let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>;
|
= note: expected unit type `()`
found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::bar::<'static, char>}`
-help: use parentheses to call this function
+help: use parentheses to call this associated function
|
LL | let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>();
| ++
@@ -29,7 +29,7 @@ LL | let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>;
|
= note: expected unit type `()`
found fn item `fn() {<i8 as Foo<'static, 'static>>::bar::<'static, char>}`
-help: use parentheses to call this function
+help: use parentheses to call this associated function
|
LL | let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>();
| ++
@@ -47,7 +47,7 @@ LL | let x: () = <i8 as Foo<'static, 'static, u8>>::baz;
|
= note: expected unit type `()`
found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::baz}`
-help: use parentheses to call this function
+help: use parentheses to call this associated function
|
LL | let x: () = <i8 as Foo<'static, 'static, u8>>::baz();
| ++
@@ -77,7 +77,7 @@ LL | <str as Foo<u8>>::bar;
| ^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `str`
-note: required because of the requirements on the impl of `Foo<'_, '_, u8>` for `str`
+note: required for `str` to implement `Foo<'_, '_, u8>`
--> $DIR/substs-ppaux.rs:11:17
|
LL | impl<'a,'b,T,S> Foo<'a, 'b, S> for T {}
diff --git a/src/test/ui/associated-types/substs-ppaux.verbose.stderr b/src/test/ui/associated-types/substs-ppaux.verbose.stderr
index b831f3b7a..16dd29de2 100644
--- a/src/test/ui/associated-types/substs-ppaux.verbose.stderr
+++ b/src/test/ui/associated-types/substs-ppaux.verbose.stderr
@@ -11,7 +11,7 @@ LL | let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>;
|
= note: expected unit type `()`
found fn item `fn() {<i8 as Foo<ReStatic, ReStatic, u8>>::bar::<ReStatic, char>}`
-help: use parentheses to call this function
+help: use parentheses to call this associated function
|
LL | let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>();
| ++
@@ -29,7 +29,7 @@ LL | let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>;
|
= note: expected unit type `()`
found fn item `fn() {<i8 as Foo<ReStatic, ReStatic>>::bar::<ReStatic, char>}`
-help: use parentheses to call this function
+help: use parentheses to call this associated function
|
LL | let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>();
| ++
@@ -47,7 +47,7 @@ LL | let x: () = <i8 as Foo<'static, 'static, u8>>::baz;
|
= note: expected unit type `()`
found fn item `fn() {<i8 as Foo<ReStatic, ReStatic, u8>>::baz}`
-help: use parentheses to call this function
+help: use parentheses to call this associated function
|
LL | let x: () = <i8 as Foo<'static, 'static, u8>>::baz();
| ++
@@ -77,7 +77,7 @@ LL | <str as Foo<u8>>::bar;
| ^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `str`
-note: required because of the requirements on the impl of `Foo<'_#0r, '_#1r, u8>` for `str`
+note: required for `str` to implement `Foo<'_#0r, '_#1r, u8>`
--> $DIR/substs-ppaux.rs:11:17
|
LL | impl<'a,'b,T,S> Foo<'a, 'b, S> for T {}