diff options
| author | Esteban Kuber <esteban@kuber.com.ar> | 2021-10-05 23:04:09 +0000 |
|---|---|---|
| committer | Esteban Kuber <esteban@kuber.com.ar> | 2021-11-20 18:54:31 +0000 |
| commit | 6b9d910639d50a26cec46e326e1556665b22decf (patch) | |
| tree | 773eff83fdd65cbe5b397373665889c97d4eccb2 /src | |
| parent | 93542a8240c5f926ac5f3f99cef99366082f9c2b (diff) | |
Point at source of trait bound obligations in more places
Be more thorough in using `ItemObligation` and `BindingObligation` when evaluating obligations so that we can point at trait bounds that introduced unfulfilled obligations. We no longer incorrectly point at unrelated trait bounds (`substs-ppaux.verbose.stderr`). In particular, we now point at trait bounds on method calls. We no longer point at "obvious" obligation sources (we no longer have a note pointing at `Trait` saying "required by a bound in `Trait`", like in `associated-types-no-suitable-supertrait*`). Address part of #89418.
Diffstat (limited to 'src')
92 files changed, 479 insertions, 341 deletions
diff --git a/src/test/ui/associated-type-bounds/bad-bounds-on-assoc-in-trait.stderr b/src/test/ui/associated-type-bounds/bad-bounds-on-assoc-in-trait.stderr index 57aacf67e05..4ecae471ec2 100644 --- a/src/test/ui/associated-type-bounds/bad-bounds-on-assoc-in-trait.stderr +++ b/src/test/ui/associated-type-bounds/bad-bounds-on-assoc-in-trait.stderr @@ -5,13 +5,6 @@ LL | type C: Clone + Iterator<Item: Send + Iterator<Item: for<'a> Lam<&'a u8 | ^^^^ `<<Self as Case1>::C as Iterator>::Item` cannot be sent between threads safely | = help: the trait `Send` is not implemented for `<<Self as Case1>::C as Iterator>::Item` -note: required by a bound in `Send` - --> $SRC_DIR/core/src/marker.rs:LL:COL - | -LL | / pub unsafe auto trait Send { -LL | | // empty. -LL | | } - | |_^ required by this bound in `Send` help: consider further restricting the associated type | LL | trait Case1 where <<Self as Case1>::C as Iterator>::Item: Send { @@ -24,17 +17,6 @@ LL | type C: Clone + Iterator<Item: Send + Iterator<Item: for<'a> Lam<&'a u8 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `<<Self as Case1>::C as Iterator>::Item` is not an iterator | = help: the trait `Iterator` is not implemented for `<<Self as Case1>::C as Iterator>::Item` -note: required by a bound in `Iterator` - --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | / pub trait Iterator { -LL | | /// The type of the elements being iterated over. -LL | | #[stable(feature = "rust1", since = "1.0.0")] -LL | | type Item; -... | -LL | | } -LL | | } - | |_^ required by this bound in `Iterator` help: consider further restricting the associated type | LL | trait Case1 where <<Self as Case1>::C as Iterator>::Item: Iterator { @@ -47,17 +29,6 @@ LL | type C: Clone + Iterator<Item: Send + Iterator<Item: for<'a> Lam<&'a u8 | ^^^^ `<<Self as Case1>::C as Iterator>::Item` cannot be shared between threads safely | = help: the trait `Sync` is not implemented for `<<Self as Case1>::C as Iterator>::Item` -note: required by a bound in `Sync` - --> $SRC_DIR/core/src/marker.rs:LL:COL - | -LL | / pub unsafe auto trait Sync { -LL | | // FIXME(estebank): once support to add notes in `rustc_on_unimplemented` -LL | | // lands in beta, and it has been extended to check whether a closure is -LL | | // anywhere in the requirement chain, extend it as such (#48534): -... | -LL | | // Empty -LL | | } - | |_^ required by this bound in `Sync` help: consider further restricting the associated type | LL | trait Case1 where <<Self as Case1>::C as Iterator>::Item: Sync { diff --git a/src/test/ui/associated-type-bounds/bounds-on-assoc-in-trait.stderr b/src/test/ui/associated-type-bounds/bounds-on-assoc-in-trait.stderr index 4da5a2cbd41..4e2313bd4e4 100644 --- a/src/test/ui/associated-type-bounds/bounds-on-assoc-in-trait.stderr +++ b/src/test/ui/associated-type-bounds/bounds-on-assoc-in-trait.stderr @@ -5,17 +5,6 @@ LL | type A: Iterator<Item: Debug>; | ^^^^^ `<<Self as Case1>::A as Iterator>::Item` cannot be formatted using `{:?}` because it doesn't implement `Debug` | = help: the trait `Debug` is not implemented for `<<Self as Case1>::A as Iterator>::Item` -note: required by a bound in `Debug` - --> $SRC_DIR/core/src/fmt/mod.rs:LL:COL - | -LL | / pub trait Debug { -LL | | /// Formats the value using the given formatter. -LL | | /// -LL | | /// # Examples -... | -LL | | fn fmt(&self, f: &mut Formatter<'_>) -> Result; -LL | | } - | |_^ required by this bound in `Debug` help: consider further restricting the associated type | LL | trait Case1 where <<Self as Case1>::A as Iterator>::Item: Debug { @@ -27,17 +16,6 @@ error[E0277]: the trait bound `<<Self as Foo>::Out as Baz>::Assoc: Default` is n LL | pub trait Foo { type Out: Baz<Assoc: Default>; } | ^^^^^^^ the trait `Default` is not implemented for `<<Self as Foo>::Out as Baz>::Assoc` | -note: required by a bound in `Default` - --> $SRC_DIR/core/src/default.rs:LL:COL - | -LL | / pub trait Default: Sized { -LL | | /// Returns the "default value" for a type. -LL | | /// -LL | | /// Default values are often some kind of initial value, identity value, or anything else that -... | -LL | | fn default() -> Self; -LL | | } - | |_^ required by this bound in `Default` help: consider further restricting the associated type | LL | pub trait Foo where <<Self as Foo>::Out as Baz>::Assoc: Default { type Out: Baz<Assoc: Default>; } 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 92c963a9ef9..6552c8be780 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 @@ -4,11 +4,6 @@ error[E0277]: the trait bound `Self: Get` is not satisfied LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) {} | ^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self` | -note: required by a bound in `Get` - --> $DIR/associated-types-for-unimpl-trait.rs:4:1 - | -LL | trait Get { - | ^^^^^^^^^ required by this bound in `Get` help: consider further restricting `Self` | LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Get {} 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 509d548c69d..b2ee1b5e6d0 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 @@ -4,11 +4,6 @@ error[E0277]: the trait bound `T: Get` is not satisfied LL | fn uhoh<T>(foo: <T as Get>::Value) {} | ^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `T` | -note: required by a bound in `Get` - --> $DIR/associated-types-no-suitable-bound.rs:1:1 - | -LL | trait Get { - | ^^^^^^^^^ required by this bound in `Get` help: consider restricting type parameter `T` | LL | fn uhoh<T: Get>(foo: <T as Get>::Value) {} 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 1cb9ac8fdef..2e40dbd065d 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 @@ -4,11 +4,6 @@ error[E0277]: the trait bound `Self: Get` is not satisfied LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) {} | ^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self` | -note: required by a bound in `Get` - --> $DIR/associated-types-no-suitable-supertrait-2.rs:12:1 - | -LL | trait Get { - | ^^^^^^^^^ required by this bound in `Get` help: consider further restricting `Self` | LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Get {} 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 e3185fbe939..da79c7ac77f 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 @@ -4,11 +4,6 @@ error[E0277]: the trait bound `Self: Get` is not satisfied LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) {} | ^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self` | -note: required by a bound in `Get` - --> $DIR/associated-types-no-suitable-supertrait.rs:12:1 - | -LL | trait Get { - | ^^^^^^^^^ required by this bound in `Get` help: consider further restricting `Self` | LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Get {} @@ -19,12 +14,6 @@ error[E0277]: the trait bound `(T, U): Get` is not satisfied | LL | fn uhoh<U:Get>(&self, foo: U, bar: <(T, U) as Get>::Value) {} | ^^^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `(T, U)` - | -note: required by a bound in `Get` - --> $DIR/associated-types-no-suitable-supertrait.rs:12:1 - | -LL | trait Get { - | ^^^^^^^^^ required by this bound in `Get` error: aborting due to 2 previous errors 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 09ec0e11617..2e67c21940f 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 @@ -4,11 +4,6 @@ error[E0277]: the trait bound `Self: Get` is not satisfied LL | fn okay<U:Get>(&self, foo: U, bar: <Self as Get>::Value); | ^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self` | -note: required by a bound in `Get` - --> $DIR/associated-types-projection-to-unrelated-trait-in-method-without-default.rs:5:1 - | -LL | trait Get { - | ^^^^^^^^^ required by this bound in `Get` help: consider further restricting `Self` | LL | fn okay<U:Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Get; diff --git a/src/test/ui/async-await/pin-needed-to-poll-2.stderr b/src/test/ui/async-await/pin-needed-to-poll-2.stderr index b63ea106d90..83d1a02c876 100644 --- a/src/test/ui/async-await/pin-needed-to-poll-2.stderr +++ b/src/test/ui/async-await/pin-needed-to-poll-2.stderr @@ -12,11 +12,11 @@ note: required because it appears within the type `Sleep` | LL | struct Sleep(std::marker::PhantomPinned); | ^^^^^ -note: required by `Pin::<P>::new` +note: required by a bound in `Pin::<P>::new` --> $SRC_DIR/core/src/pin.rs:LL:COL | -LL | pub const fn new(pointer: P) -> Pin<P> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | impl<P: Deref<Target: Unpin>> Pin<P> { + | ^^^^^ required by this bound in `Pin::<P>::new` error: aborting due to previous error diff --git a/src/test/ui/box/into-boxed-slice-fail.stderr b/src/test/ui/box/into-boxed-slice-fail.stderr index 2f1dec9d209..de654fdc1a4 100644 --- a/src/test/ui/box/into-boxed-slice-fail.stderr +++ b/src/test/ui/box/into-boxed-slice-fail.stderr @@ -7,11 +7,11 @@ LL | let _ = Box::into_boxed_slice(boxed_slice); | required by a bound introduced by this call | = help: the trait `Sized` is not implemented for `[u8]` -note: required by `Box::<T, A>::into_boxed_slice` +note: required by a bound in `Box::<T, A>::into_boxed_slice` --> $SRC_DIR/alloc/src/boxed.rs:LL:COL | -LL | pub fn into_boxed_slice(boxed: Self) -> Box<[T], A> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | impl<T, A: Allocator> Box<T, A> { + | ^ required by this bound in `Box::<T, A>::into_boxed_slice` error[E0277]: the size for values of type `[u8]` cannot be known at compilation time --> $DIR/into-boxed-slice-fail.rs:7:13 @@ -31,11 +31,11 @@ LL | let _ = Box::into_boxed_slice(boxed_trait); | required by a bound introduced by this call | = help: the trait `Sized` is not implemented for `dyn Debug` -note: required by `Box::<T, A>::into_boxed_slice` +note: required by a bound in `Box::<T, A>::into_boxed_slice` --> $SRC_DIR/alloc/src/boxed.rs:LL:COL | -LL | pub fn into_boxed_slice(boxed: Self) -> Box<[T], A> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | impl<T, A: Allocator> Box<T, A> { + | ^ required by this bound in `Box::<T, A>::into_boxed_slice` error[E0277]: the size for values of type `dyn Debug` cannot be known at compilation time --> $DIR/into-boxed-slice-fail.rs:11:13 diff --git a/src/test/ui/chalkify/type_wf.stderr b/src/test/ui/chalkify/type_wf.stderr index ebd885a7d32..57902efa201 100644 --- a/src/test/ui/chalkify/type_wf.stderr +++ b/src/test/ui/chalkify/type_wf.stderr @@ -7,11 +7,11 @@ LL | let s = S { = help: the following implementations were found: <Option<T> as Foo> <i32 as Foo> -note: required by `S` - --> $DIR/type_wf.rs:6:1 +note: required by a bound in `S` + --> $DIR/type_wf.rs:6:13 | LL | struct S<T: Foo> { - | ^^^^^^^^^^^^^^^^ + | ^^^ required by this bound in `S` error: aborting due to previous error diff --git a/src/test/ui/closures/closure-expected.stderr b/src/test/ui/closures/closure-expected.stderr index d4f23078043..8b38d5ff459 100644 --- a/src/test/ui/closures/closure-expected.stderr +++ b/src/test/ui/closures/closure-expected.stderr @@ -8,6 +8,11 @@ LL | let y = x.or_else(4); | = help: the trait `FnOnce<()>` is not implemented for `{integer}` = note: wrap the `{integer}` in a closure with no arguments: `|| { /* code */ }` +note: required by a bound in `Option::<T>::or_else` + --> $SRC_DIR/core/src/option.rs:LL:COL + | +LL | pub fn or_else<F: FnOnce() -> Option<T>>(self, f: F) -> Option<T> { + | ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Option::<T>::or_else` error: aborting due to previous error diff --git a/src/test/ui/closures/coerce-unsafe-to-closure.stderr b/src/test/ui/closures/coerce-unsafe-to-closure.stderr index 4a47e054915..24db2725347 100644 --- a/src/test/ui/closures/coerce-unsafe-to-closure.stderr +++ b/src/test/ui/closures/coerce-unsafe-to-closure.stderr @@ -7,6 +7,11 @@ LL | let x: Option<&[u8]> = Some("foo").map(std::mem::transmute); | required by a bound introduced by this call | = help: the trait `FnOnce<(&str,)>` is not implemented for `unsafe extern "rust-intrinsic" fn(_) -> _ {transmute::<_, _>}` +note: required by a bound in `Option::<T>::map` + --> $SRC_DIR/core/src/option.rs:LL:COL + | +LL | pub fn map<U, F: FnOnce(T) -> U>(self, f: F) -> Option<U> { + | ^^^^^^^^^^^^^^ required by this bound in `Option::<T>::map` error: aborting due to previous error diff --git a/src/test/ui/coherence/coherence-overlap-trait-alias.stderr b/src/test/ui/coherence/coherence-overlap-trait-alias.stderr index affc58b84d4..5b389f24bf1 100644 --- a/src/test/ui/coherence/coherence-overlap-trait-alias.stderr +++ b/src/test/ui/coherence/coherence-overlap-trait-alias.stderr @@ -12,11 +12,6 @@ LL | impl<T: AB> C for T {} LL | #[rustc_strict_coherence] LL | impl C for u32 {} | ^^^^^^^^^^^^^^ -note: required by a bound in `C` - --> $DIR/coherence-overlap-trait-alias.rs:11:1 - | -LL | trait C {} - | ^^^^^^^ required by this bound in `C` error: aborting due to previous error diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-72787.min.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-72787.min.stderr index 3c7a740e843..02dce4f7a97 100644 --- a/src/test/ui/const-generics/generic_const_exprs/issue-72787.min.stderr +++ b/src/test/ui/const-generics/generic_const_exprs/issue-72787.min.stderr @@ -41,11 +41,6 @@ LL | IsLessOrEqual<I, 8>: True, | ^^^^ cannot infer type for struct `IsLessOrEqual<I, 8_u32>` | = note: cannot satisfy `IsLessOrEqual<I, 8_u32>: True` -note: required by a bound in `True` - --> $DIR/issue-72787.rs:8:1 - | -LL | pub trait True {} - | ^^^^^^^^^^^^^^ required by this bound in `True` error[E0283]: type annotations needed --> $DIR/issue-72787.rs:21:26 @@ -54,11 +49,6 @@ LL | IsLessOrEqual<I, 8>: True, | ^^^^ cannot infer type for struct `IsLessOrEqual<I, 8_u32>` | = note: cannot satisfy `IsLessOrEqual<I, 8_u32>: True` -note: required by a bound in `True` - --> $DIR/issue-72787.rs:8:1 - | -LL | pub trait True {} - | ^^^^^^^^^^^^^^ required by this bound in `True` error: aborting due to 6 previous errors diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-83765.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-83765.stderr index ef785bf07eb..0332e82fe07 100644 --- a/src/test/ui/const-generics/generic_const_exprs/issue-83765.stderr +++ b/src/test/ui/const-generics/generic_const_exprs/issue-83765.stderr @@ -14,6 +14,11 @@ LL | self.reference.size() | ^^^^ | = help: try adding a `where` bound using this expression: `where [(); Self::DIM]:` +note: required by a bound in `TensorSize::size` + --> $DIR/issue-83765.rs:9:31 + | +LL | fn size(&self) -> [usize; Self::DIM]; + | ^^^^^^^^^ required by this bound in `TensorSize::size` error[E0308]: mismatched types --> $DIR/issue-83765.rs:32:9 diff --git a/src/test/ui/const-generics/occurs-check/unused-substs-1.stderr b/src/test/ui/const-generics/occurs-check/unused-substs-1.stderr index 382dd0ee5a6..486a298a9ff 100644 --- a/src/test/ui/const-generics/occurs-check/unused-substs-1.stderr +++ b/src/test/ui/const-generics/occurs-check/unused-substs-1.stderr @@ -6,13 +6,11 @@ LL | let _ = A; | = help: the following implementations were found: <A<7_usize> as Bar<N>> -note: required by `A` - --> $DIR/unused-substs-1.rs:7:1 +note: required by a bound in `A` + --> $DIR/unused-substs-1.rs:9:11 | -LL | / struct A<const N: usize> -LL | | where -LL | | A<N>: Bar<N>; - | |_________________^ +LL | A<N>: Bar<N>; + | ^^^^^^ required by this bound in `A` error: aborting due to previous error diff --git a/src/test/ui/derives/derives-span-Hash-enum-struct-variant.stderr b/src/test/ui/derives/derives-span-Hash-enum-struct-variant.stderr index 47c7f1c2c33..af4576b7a17 100644 --- a/src/test/ui/derives/derives-span-Hash-enum-struct-variant.stderr +++ b/src/test/ui/derives/derives-span-Hash-enum-struct-variant.stderr @@ -7,11 +7,11 @@ LL | #[derive(Hash)] LL | x: Error | ^^^^^^^^ the trait `Hash` is not implemented for `Error` | -note: required by a bound in `std::hash::Hash::hash` +note: required by `std::hash::Hash::hash` --> $SRC_DIR/core/src/hash/mod.rs:LL:COL | LL | fn hash<H: Hasher>(&self, state: &mut H); - | ^ required by this bound in `std::hash::Hash::hash` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/derives/derives-span-Hash-enum.stderr b/src/test/ui/derives/derives-span-Hash-enum.stderr index 92f084b58e3..e4e507be2f2 100644 --- a/src/test/ui/derives/derives-span-Hash-enum.stderr +++ b/src/test/ui/derives/derives-span-Hash-enum.stderr @@ -7,11 +7,11 @@ LL | #[derive(Hash)] LL | Error | ^^^^^ the trait `Hash` is not implemented for `Error` | -note: required by a bound in `std::hash::Hash::hash` +note: required by `std::hash::Hash::hash` --> $SRC_DIR/core/src/hash/mod.rs:LL:COL | LL | fn hash<H: Hasher>(&self, state: &mut H); - | ^ required by this bound in `std::hash::Hash::hash` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/derives/derives-span-Hash-struct.stderr b/src/test/ui/derives/derives-span-Hash-struct.stderr index c57cebe04eb..401df39155d 100644 --- a/src/test/ui/derives/derives-span-Hash-struct.stderr +++ b/src/test/ui/derives/derives-span-Hash-struct.stderr @@ -7,11 +7,11 @@ LL | struct Struct { LL | x: Error | ^^^^^^^^ the trait `Hash` is not implemented for `Error` | -note: required by a bound in `std::hash::Hash::hash` +note: required by `std::hash::Hash::hash` --> $SRC_DIR/core/src/hash/mod.rs:LL:COL | LL | fn hash<H: Hasher>(&self, state: &mut H); - | ^ required by this bound in `std::hash::Hash::hash` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/derives/derives-span-Hash-tuple-struct.stderr b/src/test/ui/derives/derives-span-Hash-tuple-struct.stderr index 200937f0c9f..ec92a1360fd 100644 --- a/src/test/ui/derives/derives-span-Hash-tuple-struct.stderr +++ b/src/test/ui/derives/derives-span-Hash-tuple-struct.stderr @@ -7,11 +7,11 @@ LL | struct Struct( LL | Error | ^^^^^ the trait `Hash` is not implemented for `Error` | -note: required by a bound in `std::hash::Hash::hash` +note: required by `std::hash::Hash::hash` --> $SRC_DIR/core/src/hash/mod.rs:LL:COL | LL | fn hash<H: Hasher>(&self, state: &mut H); - | ^ required by this bound in `std::hash::Hash::hash` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-1.stderr b/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-1.stderr index 8aedb4229e6..44504aeb07c 100644 --- a/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-1.stderr +++ b/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-1.stderr @@ -7,6 +7,11 @@ LL | f1.foo(1usize); = help: the following implementations were found: <Bar as Foo<i32>> <Bar as Foo<u8>> +note: required by `Foo::foo` + --> $DIR/issue-21659-show-relevant-trait-impls-1.rs:2:5 + | +LL | fn foo(&self, a: A) -> A { + | ^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.stderr b/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.stderr index d6d5ce4d1a7..c0553a37313 100644 --- a/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.stderr +++ b/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.stderr @@ -10,6 +10,11 @@ LL | f1.foo(1usize); <Bar as Foo<i8>> <Bar as Foo<u16>> and 2 others +note: required by `Foo::foo` + --> $DIR/issue-21659-show-relevant-trait-impls-2.rs:2:5 + | +LL | fn foo(&self, a: A) -> A { + | ^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/error-codes/E0275.stderr b/src/test/ui/error-codes/E0275.stderr index e13f0961a18..dfffbb182ad 100644 --- a/src/test/ui/error-codes/E0275.stderr +++ b/src/test/ui/error-codes/E0275.stderr @@ -12,11 +12,6 @@ LL | impl<T> Foo for T where Bar<T>: Foo {} | ^^^ ^ = note: 127 redundant requirements hidden = note: required because of the requirements on the impl of `Foo` for `Bar<T>` -note: required by a bound in `Foo` - --> $DIR/E0275.rs:1:1 - | -LL | trait Foo {} - | ^^^^^^^^^ required by this bound in `Foo` error: aborting due to previous error diff --git a/src/test/ui/error-codes/E0283.stderr b/src/test/ui/error-codes/E0283.stderr index 95437bf11ad..33f966a6e6b 100644 --- a/src/test/ui/error-codes/E0283.stderr +++ b/src/test/ui/error-codes/E0283.stderr @@ -29,6 +29,11 @@ LL | impl Into<u32> for Impl { = note: and another `impl` found in the `core` crate: - impl<T, U> Into<U> for T where U: From<T>; +note: required by `into` + --> $SRC_DIR/core/src/convert/mod.rs:LL:COL + | +LL | fn into(self) -> T; + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/expr/malformed_closure/ruby_style_closure.stderr b/src/test/ui/expr/malformed_closure/ruby_style_closure.stderr index 14d28b59648..53924e24e46 100644 --- a/src/test/ui/expr/malformed_closure/ruby_style_closure.stderr +++ b/src/test/ui/expr/malformed_closure/ruby_style_closure.stderr @@ -20,6 +20,11 @@ LL | | }); | |_____^ expected an `FnOnce<({integer},)>` closure, found `Option<_>` | = help: the trait `FnOnce<({integer},)>` is not implemented for `Option<_>` +note: required by a bound in `Option::<T>::and_then` + --> $SRC_DIR/core/src/option.rs:LL:COL + | +LL | pub fn and_then<U, F: FnOnce(T) -> Option<U>>(self, f: F) -> Option<U> { + | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Option::<T>::and_then` error: aborting due to 2 previous errors diff --git a/src/test/ui/feature-gates/feature-gate-associated_type_bounds.stderr b/src/test/ui/feature-gates/feature-gate-associated_type_bounds.stderr index 8df5fbcc7eb..8c5d72d7efe 100644 --- a/src/test/ui/feature-gates/feature-gate-associated_type_bounds.stderr +++ b/src/test/ui/feature-gates/feature-gate-associated_type_bounds.stderr @@ -139,13 +139,6 @@ error[E0277]: the trait bound `<<Self as _Tr3>::A as Iterator>::Item: Copy` is n LL | type A: Iterator<Item: Copy>; | ^^^^ the trait `Copy` is not implemented for `<<Self as _Tr3>::A as Iterator>::Item` | -note: required by a bound in `Copy` - --> $SRC_DIR/core/src/marker.rs:LL:COL - | -LL | / pub trait Copy: Clone { -LL | | // Empty. -LL | | } - | |_^ required by this bound in `Copy` help: consider further restricting the associated type | LL | trait _Tr3 where <<Self as _Tr3>::A as Iterator>::Item: Copy { diff --git a/src/test/ui/generic-associated-types/issue-86483.stderr b/src/test/ui/generic-associated-types/issue-86483.stderr index d6978794e1e..2f29cd5d9e9 100644 --- a/src/test/ui/generic-associated-types/issue-86483.stderr +++ b/src/test/ui/generic-associated-types/issue-86483.stderr @@ -11,8 +11,9 @@ LL | | { ... | LL | | LL | | } - | |_^ ...so that the type `T` will meet its required lifetime bounds... + | |_^ | + = note: ...so that the type `T` will meet its required lifetime bounds... note: ...that is required by this bound --> $DIR/issue-86483.rs:7:16 | diff --git a/src/test/ui/hrtb/issue-62203-hrtb-ice.stderr b/src/test/ui/hrtb/issue-62203-hrtb-ice.stderr index 4c5c59c2209..5db17cb1bf4 100644 --- a/src/test/ui/hrtb/issue-62203-hrtb-ice.stderr +++ b/src/test/ui/hrtb/issue-62203-hrtb-ice.stderr @@ -2,12 +2,20 @@ error[E0271]: type mismatch resolving `for<'r> <L<[closure@$DIR/issue-62203-hrtb --> $DIR/issue-62203-hrtb-ice.rs:38:19 | LL | let v = Unit2.m( - | ^ expected struct `Unit4`, found associated type + | ^ expected associated type, found struct `Unit4` | - = note: expected struct `Unit4` - found associated type `<_ as Ty<'_>>::V` - = help: consider constraining the associated type `<_ as Ty<'_>>::V` to `Unit4` + = note: expected associated type `<_ as Ty<'_>>::V` + found struct `Unit4` + = help: consider constraining the associated type `<_ as Ty<'_>>::V` to `Unit4` or calling a method that returns `<_ as Ty<'_>>::V` = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html +note: required by a bound in `T1::m` + --> $DIR/issue-62203-hrtb-ice.rs:27:51 + | +LL | fn m<'a, B: Ty<'a>, F>(&self, f: F) -> Unit1 + | - required by a bound in this +LL | where +LL | F: for<'r> T0<'r, (<Self as Ty<'r>>::V,), O = <B as Ty<'r>>::V>, + | ^^^^^^^^^^^^^^^^^^^^ required by this bound in `T1::m` error[E0271]: type mismatch resolving `for<'r> <[closure@$DIR/issue-62203-hrtb-ice.rs:42:17: 42:39] as FnOnce<((&'r u8,),)>>::Output == Unit3` --> $DIR/issue-62203-hrtb-ice.rs:40:9 @@ -19,13 +27,21 @@ LL | / L { LL | | LL | | f : |x| { drop(x); Unit4 } LL | | }); - | |_________^ expected struct `Unit4`, found struct `Unit3` + | |_________^ expected struct `Unit3`, found struct `Unit4` | note: required because of the requirements on the impl of `for<'r> T0<'r, (&'r u8,)>` for `L<[closure@$DIR/issue-62203-hrtb-ice.rs:42:17: 42:39]>` --> $DIR/issue-62203-hrtb-ice.rs:17:16 | LL | impl<'a, A, T> T0<'a, A> for L<T> | ^^^^^^^^^ ^^^^ +note: required by a bound in `T1::m` + --> $DIR/issue-62203-hrtb-ice.rs:27:12 + | +LL | fn m<'a, B: Ty<'a>, F>(&self, f: F) -> Unit1 + | - required by a bound in this +LL | where +LL | F: for<'r> T0<'r, (<Self as Ty<'r>>::V,), O = <B as Ty<'r>>::V>, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `T1::m` error: aborting due to 2 previous errors diff --git a/src/test/ui/inference/issue-71732.stderr b/src/test/ui/inference/issue-71732.stderr index 739847c5cd5..0369196c910 100644 --- a/src/test/ui/inference/issue-71732.stderr +++ b/src/test/ui/inference/issue-71732.stderr @@ -10,6 +10,15 @@ LL | .get(&"key".into()) - impl Borrow<str> for String; - impl<T> Borrow<T> for T where T: ?Sized; +note: required by a bound in `HashMap::<K, V, S>::get` + --> $SRC_DIR/std/src/collections/hash/map.rs:LL:COL + | +LL | K: Borrow<Q>, + | ^^^^^^^^^ required by this bound in `HashMap::<K, V, S>::get` +help: consider specifying the type argument in the function call + | +LL | .get::<Q>(&"key".into()) + | +++++ error: aborting due to previous error diff --git a/src/test/ui/issues/issue-17651.stderr b/src/test/ui/issues/issue-17651.stderr index 214477f6c60..efaaeeda2fa 100644 --- a/src/test/ui/issues/issue-17651.stderr +++ b/src/test/ui/issues/issue-17651.stderr @@ -7,11 +7,11 @@ LL | (|| Box::new(*(&[0][..])))(); | required by a bound introduced by this call | = help: the trait `Sized` is not implemented for `[{integer}]` -note: required by `Box::<T>::new` +note: required by a bound in `Box::<T>::new` --> $SRC_DIR/alloc/src/boxed.rs:LL:COL | -LL | pub fn new(x: T) -> Self { - | ^^^^^^^^^^^^^^^^^^^^^^^^ +LL | impl<T> Box<T> { + | ^ required by this bound in `Box::<T>::new` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-18400.stderr b/src/test/ui/issues/issue-18400.stderr index 92e0f60079f..696ca402d11 100644 --- a/src/test/ui/issues/issue-18400.stderr +++ b/src/test/ui/issues/issue-18400.stderr @@ -12,6 +12,11 @@ LL | impl<'a, T, S> Set<&'a [T]> for S where | ^^^^^^^^^^^^ ^ = note: 128 redundant requirements hidden = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` +note: required by `Set::contains` + --> $DIR/issue-18400.rs:2:5 + | +LL | fn contains(&self, _: T) -> bool; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/issues/issue-18611.stderr b/src/test/ui/issues/issue-18611.stderr index b702196abdf..bd18d46223e 100644 --- a/src/test/ui/issues/issue-18611.stderr +++ b/src/test/ui/issues/issue-18611.stderr @@ -3,12 +3,6 @@ error[E0277]: the trait bound `isize: HasState` is not satisfied | LL | fn add_state(op: <isize as HasState>::State) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `HasState` is not implemented for `isize` - | -note: required by a bound in `HasState` - --> $DIR/issue-18611.rs:5:1 - | -LL | trait HasState { - | ^^^^^^^^^^^^^^ required by this bound in `HasState` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-20162.stderr b/src/test/ui/issues/issue-20162.stderr index ef1eb2ea6c0..6848c3f0d8a 100644 --- a/src/test/ui/issues/issue-20162.stderr +++ b/src/test/ui/issues/issue-20162.stderr @@ -3,6 +3,12 @@ error[E0277]: the trait bound `X: Ord` is not satisfied | LL | b.sort(); | ^^^^ the trait `Ord` is not implemented for `X` + | +note: required by a bound in `slice::<impl [T]>::sort` + --> $SRC_DIR/alloc/src/slice.rs:LL:COL + | +LL | T: Ord, + | ^^^ required by this bound in `slice::<impl [T]>::sort` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-20413.stderr b/src/test/ui/issues/issue-20413.stderr index 9135c5ac36a..29352141404 100644 --- a/src/test/ui/issues/issue-20413.stderr +++ b/src/test/ui/issues/issue-20413.stderr @@ -21,11 +21,6 @@ LL | impl<T> Foo for T where NoData<T>: Foo { | ^^^ ^ = note: 127 redundant requirements hidden = note: required because of the requirements on the impl of `Foo` for `NoData<T>` -note: required by a bound in `Foo` - --> $DIR/issue-20413.rs:1:1 - | -LL | trait Foo { - | ^^^^^^^^^ required by this bound in `Foo` error[E0275]: overflow evaluating the requirement `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>: Foo` --> $DIR/issue-20413.rs:8:36 @@ -41,11 +36,6 @@ LL | impl<T> Foo for T where NoData<T>: Foo { | ^^^ ^ = note: 127 redundant requirements hidden = note: required because of the requirements on the impl of `Foo` for `NoData<T>` -note: required by a bound in `Foo` - --> $DIR/issue-20413.rs:1:1 - | -LL | trait Foo { - | ^^^^^^^^^ required by this bound in `Foo` error[E0275]: overflow evaluating the requirement `EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>: Baz` --> $DIR/issue-20413.rs:28:42 @@ -66,11 +56,6 @@ LL | impl<T> Baz for T where AlmostNoData<T>: Bar { | ^^^ ^ = note: 126 redundant requirements hidden = note: required because of the requirements on the impl of `Baz` for `EvenLessData<T>` -note: required by a bound in `Baz` - --> $DIR/issue-20413.rs:20:1 - | -LL | trait Baz { - | ^^^^^^^^^ required by this bound in `Baz` error[E0275]: overflow evaluating the requirement `EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>: Baz` --> $DIR/issue-20413.rs:28:42 @@ -91,11 +76,6 @@ LL | impl<T> Baz for T where AlmostNoData<T>: Bar { | ^^^ ^ = note: 126 redundant requirements hidden = note: required because of the requirements on the impl of `Baz` for `EvenLessData<T>` -note: required by a bound in `Baz` - --> $DIR/issue-20413.rs:20:1 - | -LL | trait Baz { - | ^^^^^^^^^ required by this bound in `Baz` error[E0275]: overflow evaluating the requirement `AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>: Bar` --> $DIR/issue-20413.rs:36:42 @@ -116,11 +96,6 @@ LL | impl<T> Bar for T where EvenLessData<T>: Baz { | ^^^ ^ = note: 126 redundant requirements hidden = note: required because of the requirements on the impl of `Bar` for `AlmostNoData<T>` -note: required by a bound in `Bar` - --> $DIR/issue-20413.rs:16:1 - | -LL | trait Bar { - | ^^^^^^^^^ required by this bound in `Bar` error[E0275]: overflow evaluating the requirement `AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>: Bar` --> $DIR/issue-20413.rs:36:42 @@ -141,11 +116,6 @@ LL | impl<T> Bar for T where EvenLessData<T>: Baz { | ^^^ ^ = note: 126 redundant requirements hidden = note: required because of the requirements on the impl of `Bar` for `AlmostNoData<T>` -note: required by a bound in `Bar` - --> $DIR/issue-20413.rs:16:1 - | -LL | trait Bar { - | ^^^^^^^^^ required by this bound in `Bar` error: aborting due to 7 previous errors diff --git a/src/test/ui/issues/issue-21160.stderr b/src/test/ui/issues/issue-21160.stderr index 92742b50619..e869180d2e6 100644 --- a/src/test/ui/issues/issue-21160.stderr +++ b/src/test/ui/issues/issue-21160.stderr @@ -6,11 +6,11 @@ LL | #[derive(Hash)] LL | struct Foo(Bar); | ^^^ the trait `Hash` is not implemented for `Bar` | -note: required by a bound in `std::hash::Hash::hash` +note: required by `std::hash::Hash::hash` --> $SRC_DIR/core/src/hash/mod.rs:LL:COL | LL | fn hash<H: Hasher>(&self, state: &mut H); - | ^ required by this bound in `std::hash::Hash::hash` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/issues/issue-21974.stderr b/src/test/ui/issues/issue-21974.stderr index 3b6663513bb..dfabde9abc9 100644 --- a/src/test/ui/issues/issue-21974.stderr +++ b/src/test/ui/issues/issue-21974.stderr @@ -5,11 +5,6 @@ LL | where &'a T : Foo, | ^^^ cannot infer type for reference `&'a T` | = note: cannot satisfy `&'a T: Foo` -note: required by a bound in `Foo` - --> $DIR/issue-21974.rs:6:1 - | -LL | trait Foo { - | ^^^^^^^^^ required by this bound in `Foo` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-23966.stderr b/src/test/ui/issues/issue-23966.stderr index 9c87ee6104a..ae8233d5c76 100644 --- a/src/test/ui/issues/issue-23966.stderr +++ b/src/test/ui/issues/issue-23966.stderr @@ -7,6 +7,11 @@ LL | "".chars().fold(|_, _| (), ()); | required by a bound introduced by this call | = help: the trait `FnMut<(_, char)>` is not implemented for `()` +note: required by a bound in `fold` + --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL + | +LL | F: FnMut(B, Self::Item) -> B, + | ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `fold` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-24424.stderr b/src/test/ui/issues/issue-24424.stderr index 4896006b645..fa59da852f9 100644 --- a/src/test/ui/issues/issue-24424.stderr +++ b/src/test/ui/issues/issue-24424.stderr @@ -5,11 +5,6 @@ LL | impl <'l0, 'l1, T0> Trait1<'l0, T0> for bool where T0 : Trait0<'l0>, T0 : T | ^^^^^^^^^^^ cannot infer type for type parameter `T0` | = note: cannot satisfy `T0: Trait0<'l0>` -note: required by a bound in `Trait0` - --> $DIR/issue-24424.rs:2:1 - | -LL | trait Trait0<'l0> {} - | ^^^^^^^^^^^^^^^^^ required by this bound in `Trait0` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-31173.rs b/src/test/ui/issues/issue-31173.rs index 40475426cff..48061ae54ae 100644 --- a/src/test/ui/issues/issue-31173.rs +++ b/src/test/ui/issues/issue-31173.rs @@ -9,8 +9,6 @@ pub fn get_tok(it: &mut IntoIter<u8>) { }) .cloned() //~^ ERROR type mismatch resolving - //~| expected type `u8` - //~| found reference `&_` .collect(); //~ ERROR the method } diff --git a/src/test/ui/issues/issue-31173.stderr b/src/test/ui/issues/issue-31173.stderr index 8b7871ce311..982b6118ce6 100644 --- a/src/test/ui/issues/issue-31173.stderr +++ b/src/test/ui/issues/issue-31173.stderr @@ -2,13 +2,18 @@ error[E0271]: type mismatch resolving `<TakeWhile<&mut std::vec::IntoIter<u8>, [ --> $DIR/issue-31173.rs:10:10 | LL | .cloned() - | ^^^^^^ expected `u8`, found reference + | ^^^^^^ expected reference, found `u8` | - = note: expected type `u8` - found reference `&_` + = note: expected reference `&_` + found type `u8` +note: required by a bound in `cloned` + --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL + | +LL | Self: Sized + Iterator<Item = &'a T>, + | ^^^^^^^^^^^^ required by this bound in `cloned` error[E0599]: the method `collect` exists for struct `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6]>>`, but its trait bounds were not satisfied - --> $DIR/issue-31173.rs:14:10 + --> $DIR/issue-31173.rs:12:10 | LL | .collect(); | ^^^^^^^ method cannot be called on `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6]>>` due to unsatisfied trait bounds diff --git a/src/test/ui/issues/issue-33941.stderr b/src/test/ui/issues/issue-33941.stderr index d588214f507..55cb7211ebd 100644 --- a/src/test/ui/issues/issue-33941.stderr +++ b/src/test/ui/issues/issue-33941.stderr @@ -2,10 +2,15 @@ error[E0271]: type mismatch resolving `<std::collections::hash_map::Iter<'_, _, --> $DIR/issue-33941.rs:4:36 | LL | for _ in HashMap::new().iter().cloned() {} - | ^^^^^^ expected tuple, found reference + | ^^^^^^ expected reference, found tuple | - = note: expected tuple `(&_, &_)` - found reference `&_` + = note: expected reference `&_` + found tuple `(&_, &_)` +note: required by a bound in `cloned` + --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL + | +LL | Self: Sized + Iterator<Item = &'a T>, + | ^^^^^^^^^^^^ required by this bound in `cloned` error[E0271]: type mismatch resolving `<std::collections::hash_map::Iter<'_, _, _> as Iterator>::Item == &_` --> $DIR/issue-33941.rs:4:14 diff --git a/src/test/ui/issues/issue-34334.stderr b/src/test/ui/issues/issue-34334.stderr index acb44ce2c35..49d6709a860 100644 --- a/src/test/ui/issues/issue-34334.stderr +++ b/src/test/ui/issues/issue-34334.stderr @@ -14,6 +14,11 @@ LL | let sr2: Vec<(u32, _, _)> = sr.iter().map(|(faction, th_sender, th_rece | ^^^^^^^ value of type `Vec<(u32, _, _)>` cannot be built from `std::iter::Iterator<Item=()>` | = help: the trait `FromIterator<()>` is not implemented for `Vec<(u32, _, _)>` +note: required by a bound in `collect` + --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL + | +LL | fn collect<B: FromIterator<Self::Item>>(self) -> B + | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `collect` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-47706-trait.stderr b/src/test/ui/issues/issue-47706-trait.stderr index 2e542644b70..eb0c80f8f0d 100644 --- a/src/test/ui/issues/issue-47706-trait.stderr +++ b/src/test/ui/issues/issue-47706-trait.stderr @@ -7,6 +7,12 @@ LL | None::<()>.map(Self::f); | --- ^^^^^^^ expected function that takes a single 0-tuple as argument | | | required by a bound introduced by this call + | +note: required by a bound in `Option::<T>::map` + --> $SRC_DIR/core/src/option.rs:LL:COL + | +LL | pub fn map<U, F: FnOnce(T) -> U>(self, f: F) -> Option<U> { + | ^^^^^^^^^^^^^^ required by this bound in `Option::<T>::map` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-47706.stderr b/src/test/ui/issues/issue-47706.stderr index acf7626c634..237b2b9e798 100644 --- a/src/test/ui/issues/issue-47706.stderr +++ b/src/test/ui/issues/issue-47706.stderr @@ -8,6 +8,12 @@ LL | self.foo.map(Foo::new) | --- ^^^^^^^^ expected function that takes 1 argument | | | required by a bound introduced by this call + | +note: required by a bound in `Option::<T>::map` + --> $SRC_DIR/core/src/option.rs:LL:COL + | +LL | pub fn map<U, F: FnOnce(T) -> U>(self, f: F) -> Option<U> { + | ^^^^^^^^^^^^^^ required by this bound in `Option::<T>::map` error[E0593]: function is expected to take 0 arguments, but it takes 1 argument --> $DIR/issue-47706.rs:27:9 diff --git a/src/test/ui/issues/issue-54954.stderr b/src/test/ui/issues/issue-54954.stderr index df76a985559..b1b06a25179 100644 --- a/src/test/ui/issues/issue-54954.stderr +++ b/src/test/ui/issues/issue-54954.stderr @@ -11,11 +11,11 @@ LL | const ARR_LEN: usize = Tt::const_val::<[i8; 123]>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type | = note: cannot satisfy `_: Tt` -note: required by a bound in `Tt::const_val` - --> $DIR/issue-54954.rs:5:24 +note: required by `Tt::const_val` + --> $DIR/issue-54954.rs:5:5 | LL | const fn const_val<T: Sized>() -> usize { - | ^ required by this bound in `Tt::const_val` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-66923-show-error-for-correct-call.stderr b/src/test/ui/issues/issue-66923-show-error-for-correct-call.stderr index a08531000bc..6a96709cbac 100644 --- a/src/test/ui/issues/issue-66923-show-error-for-correct-call.stderr +++ b/src/test/ui/issues/issue-66923-show-error-for-correct-call.stderr @@ -5,6 +5,11 @@ LL | let x2: Vec<f64> = x1.into_iter().collect(); | ^^^^^^^ value of type `Vec<f64>` cannot be built from `std::iter::Iterator<Item=&f64>` | = help: the trait `FromIterator<&f64>` is not implemented for `Vec<f64>` +note: required by a bound in `collect` + --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL + | +LL | fn collect<B: FromIterator<Self::Item>>(self) -> B + | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `collect` error[E0277]: a value of type `Vec<f64>` cannot be built from an iterator over elements of type `&f64` --> $DIR/issue-66923-show-error-for-correct-call.rs:12:29 @@ -13,6 +18,11 @@ LL | let x3 = x1.into_iter().collect::<Vec<f64>>(); | ^^^^^^^ value of type `Vec<f64>` cannot be built from `std::iter::Iterator<Item=&f64>` | = help: the trait `FromIterator<&f64>` is not implemented for `Vec<f64>` +note: required by a bound in `collect` + --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL + | +LL | fn collect<B: FromIterator<Self::Item>>(self) -> B + | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `collect` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-69455.stderr b/src/test/ui/issues/issue-69455.stderr index da84a6b52da..4e4471b1fec 100644 --- a/src/test/ui/issues/issue-69455.stderr +++ b/src/test/ui/issues/issue-69455.stderr @@ -18,6 +18,11 @@ LL | impl Test<u32> for u64 { ... LL | impl Test<u64> for u64 { | ^^^^^^^^^^^^^^^^^^^^^^ +note: required by `Test::test` + --> $DIR/issue-69455.rs:8:5 + | +LL | fn test(self, rhs: Rhs) -> Self::Output; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider specifying the type argument in the method call | LL | println!("{}", 23u64.test(xs.iter().sum::<S>())); diff --git a/src/test/ui/issues/issue-69683.stderr b/src/test/ui/issues/issue-69683.stderr index ecf78e48e0e..b53923eec1d 100644 --- a/src/test/ui/issues/issue-69683.stderr +++ b/src/test/ui/issues/issue-69683.stderr @@ -18,6 +18,14 @@ LL | impl<T> Element<()> for T { ... LL | impl<T: Element<S>, S> Element<[S; 3]> for T { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +note: required by a bound in `Foo::foo` + --> $DIR/issue-69683.rs:15:9 + | +LL | u8: Element<I>, + | ^^^^^^^^^^ required by this bound in `Foo::foo` +LL | { +LL | fn foo(self, x: <u8 as Element<I>>::Array); + | --- required by a bound in this error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-72690.stderr b/src/test/ui/issues/issue-72690.stderr index 1747ca5bb04..920a4548a9a 100644 --- a/src/test/ui/issues/issue-72690.stderr +++ b/src/test/ui/issues/issue-72690.stderr @@ -27,6 +27,11 @@ LL | String::from("x".as_ref()); - impl AsRef<Path> for str; - impl AsRef<[u8]> for str; - impl AsRef<str> for str; +note: required by `as_ref` + --> $SRC_DIR/core/src/convert/mod.rs:LL:COL + | +LL | fn as_ref(&self) -> &T; + | ^^^^^^^^^^^^^^^^^^^^^^^ error[E0282]: type annotations needed --> $DIR/issue-72690.rs:12:6 @@ -63,6 +68,11 @@ LL | |x| String::from("x".as_ref()); - impl AsRef<Path> for str; - impl AsRef<[u8]> for str; - impl AsRef<str> for str; +note: required by `as_ref` + --> $SRC_DIR/core/src/convert/mod.rs:LL:COL + | +LL | fn as_ref(&self) -> &T; + | ^^^^^^^^^^^^^^^^^^^^^^^ error[E0283]: type annotations needed for `&T` --> $DIR/issue-72690.rs:18:17 @@ -77,6 +87,11 @@ LL | let _ = "x".as_ref(); - impl AsRef<Path> for str; - impl AsRef<[u8]> for str; - impl AsRef<str> for str; +note: required by `as_ref` + --> $SRC_DIR/core/src/convert/mod.rs:LL:COL + | +LL | fn as_ref(&self) -> &T; + | ^^^^^^^^^^^^^^^^^^^^^^^ error[E0283]: type annotations needed --> $DIR/issue-72690.rs:22:5 @@ -107,6 +122,11 @@ LL | String::from("x".as_ref()); - impl AsRef<Path> for str; - impl AsRef<[u8]> for str; - impl AsRef<str> for str; +note: required by `as_ref` + --> $SRC_DIR/core/src/convert/mod.rs:LL:COL + | +LL | fn as_ref(&self) -> &T; + | ^^^^^^^^^^^^^^^^^^^^^^^ error[E0283]: type annotations needed --> $DIR/issue-72690.rs:29:5 @@ -137,6 +157,11 @@ LL | String::from("x".as_ref()); - impl AsRef<Path> for str; - impl AsRef<[u8]> for str; - impl AsRef<str> for str; +note: required by `as_ref` + --> $SRC_DIR/core/src/convert/mod.rs:LL:COL + | +LL | fn as_ref(&self) -> &T; + | ^^^^^^^^^^^^^^^^^^^^^^^ error[E0283]: type annotations needed --> $DIR/issue-72690.rs:38:5 @@ -167,6 +192,11 @@ LL | String::from("x".as_ref()); - impl AsRef<Path> for str; - impl AsRef<[u8]> for str; - impl AsRef<str> for str; +note: required by `as_ref` + --> $SRC_DIR/core/src/convert/mod.rs:LL:COL + | +LL | fn as_ref(&self) -> &T; + | ^^^^^^^^^^^^^^^^^^^^^^^ error[E0283]: type annotations needed --> $DIR/issue-72690.rs:47:5 @@ -197,6 +227,11 @@ LL | String::from("x".as_ref()); - impl AsRef<Path> for str; - impl AsRef<[u8]> for str; - impl AsRef<str> for str; +note: required by `as_ref` + --> $SRC_DIR/core/src/convert/mod.rs:LL:COL + | +LL | fn as_ref(&self) -> &T; + | ^^^^^^^^^^^^^^^^^^^^^^^ error[E0283]: type annotations needed --> $DIR/issue-72690.rs:54:5 @@ -227,6 +262,11 @@ LL | String::from("x".as_ref()); - impl AsRef<Path> for str; - impl AsRef<[u8]> for str; - impl AsRef<str> for str; +note: required by `as_ref` + --> $SRC_DIR/core/src/convert/mod.rs:LL:COL + | +LL | fn as_ref(&self) -> &T; + | ^^^^^^^^^^^^^^^^^^^^^^^ error[E0283]: type annotations needed --> $DIR/issue-72690.rs:63:5 @@ -257,6 +297,11 @@ LL | String::from("x".as_ref()); - impl AsRef<Path> for str; - impl AsRef<[u8]> for str; - impl AsRef<str> for str; +note: required by `as_ref` + --> $SRC_DIR/core/src/convert/mod.rs:LL:COL + | +LL | fn as_ref(&self) -> &T; + | ^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 18 previous errors diff --git a/src/test/ui/lifetimes/issue-34979.stderr b/src/test/ui/lifetimes/issue-34979.stderr index b76d71a3d43..1b97f8d818a 100644 --- a/src/test/ui/lifetimes/issue-34979.stderr +++ b/src/test/ui/lifetimes/issue-34979.stderr @@ -5,11 +5,6 @@ LL | &'a (): Foo, | ^^^ cannot infer type for reference `&'a ()` | = note: cannot satisfy `&'a (): Foo` -note: required by a bound in `Foo` - --> $DIR/issue-34979.rs:1:1 - | -LL | trait Foo {} - | ^^^^^^^^^ required by this bound in `Foo` error: aborting due to previous error diff --git a/src/test/ui/marker_trait_attr/region-overlap.stderr b/src/test/ui/marker_trait_attr/region-overlap.stderr index c1cc6cdaf53..2eeab801e3d 100644 --- a/src/test/ui/marker_trait_attr/region-overlap.stderr +++ b/src/test/ui/marker_trait_attr/region-overlap.stderr @@ -11,11 +11,6 @@ LL | impl<'a> A for (&'static (), &'a ()) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ LL | impl<'a> A for (&'a (), &'static ()) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: required by a bound in `A` - --> $DIR/region-overlap.rs:4:1 - | -LL | trait A {} - | ^^^^^^^ required by this bound in `A` error[E0283]: type annotations needed --> $DIR/region-overlap.rs:6:10 @@ -30,11 +25,6 @@ LL | impl<'a> A for (&'static (), &'a ()) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ LL | impl<'a> A for (&'a (), &'static ()) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: required by a bound in `A` - --> $DIR/region-overlap.rs:4:1 - | -LL | trait A {} - | ^^^^^^^ required by this bound in `A` error: aborting due to 2 previous errors diff --git a/src/test/ui/methods/method-ambig-one-trait-unknown-int-type.stderr b/src/test/ui/methods/method-ambig-one-trait-unknown-int-type.stderr index f33672433de..93d95fadc0b 100644 --- a/src/test/ui/methods/method-ambig-one-trait-unknown-int-type.stderr +++ b/src/test/ui/methods/method-ambig-one-trait-unknown-int-type.stderr @@ -20,6 +20,11 @@ LL | impl Foo for Vec<usize> { ... LL | impl Foo for Vec<isize> { | ^^^^^^^^^^^^^^^^^^^^^^^ +note: required by `Foo::foo` + --> $DIR/method-ambig-one-trait-unknown-int-type.rs:6:5 + | +LL | fn foo(&self) -> isize; + | ^^^^^^^^^^^^^^^^^^^^^^^ error[E0308]: mismatched types --> $DIR/method-ambig-one-trait-unknown-int-type.rs:33:20 diff --git a/src/test/ui/mismatched_types/closure-arg-count.stderr b/src/test/ui/mismatched_types/closure-arg-count.stderr index e8fcf80e940..fed47e0f174 100644 --- a/src/test/ui/mismatched_types/closure-arg-count.stderr +++ b/src/test/ui/mismatched_types/closure-arg-count.stderr @@ -125,6 +125,12 @@ LL | let _it = vec![1, 2, 3].into_iter().enumerate().map(foo); ... LL | fn foo() {} | -------- takes 0 arguments + | +note: required by a bound in `map` + --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL + | +LL | F: FnMut(Self::Item) -> B, + | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map` error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 3 distinct arguments --> $DIR/closure-arg-count.rs:27:57 @@ -135,6 +141,12 @@ LL | let _it = vec![1, 2, 3].into_iter().enumerate().map(bar); | --- ^^^ expected closure that takes a single 2-tuple as argument | | | required by a bound introduced by this call + | +note: required by a bound in `map` + --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL + | +LL | F: FnMut(Self::Item) -> B, + | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map` error[E0593]: function is expected to take a single 2-tuple as argument, but it takes 2 distinct arguments --> $DIR/closure-arg-count.rs:29:57 @@ -146,6 +158,12 @@ LL | let _it = vec![1, 2, 3].into_iter().enumerate().map(qux); ... LL | fn qux(x: usize, y: usize) {} | -------------------------- takes 2 distinct arguments + | +note: required by a bound in `map` + --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL + | +LL | F: FnMut(Self::Item) -> B, + | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map` error[E0593]: function is expected to take 1 argument, but it takes 2 arguments --> $DIR/closure-arg-count.rs:32:45 @@ -154,6 +172,12 @@ LL | let _it = vec![1, 2, 3].into_iter().map(usize::checked_add); | --- ^^^^^^^^^^^^^^^^^^ expected function that takes 1 argument | | | required by a bound introduced by this call + | +note: required by a bound in `map` + --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL + | +LL | F: FnMut(Self::Item) -> B, + | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map` error[E0593]: function is expected to take 0 arguments, but it takes 1 argument --> $DIR/closure-arg-count.rs:35:10 diff --git a/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr b/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr index 0ec282dac45..f34ac35c757 100644 --- a/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr +++ b/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr @@ -5,6 +5,12 @@ LL | a.iter().map(|_: (u32, u32)| 45); | ^^^ ------------------ found signature of `fn((u32, u32)) -> _` | | | expected signature of `fn(&(u32, u32)) -> _` + | +note: required by a bound in `map` + --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL + | +LL | F: FnMut(Self::Item) -> B, + | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map` error[E0631]: type mismatch in closure arguments --> $DIR/closure-arg-type-mismatch.rs:4:14 @@ -13,6 +19,12 @@ LL | a.iter().map(|_: &(u16, u16)| 45); | ^^^ ------------------- found signature of `for<'r> fn(&'r (u16, u16)) -> _` | | | expected signature of `fn(&(u32, u32)) -> _` + | +note: required by a bound in `map` + --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL + | +LL | F: FnMut(Self::Item) -> B, + | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map` error[E0631]: type mismatch in closure arguments --> $DIR/closure-arg-type-mismatch.rs:5:14 @@ -21,6 +33,12 @@ LL | a.iter().map(|_: (u16, u16)| 45); | ^^^ ------------------ found signature of `fn((u16, u16)) -> _` | | | expected signature of `fn(&(u32, u32)) -> _` + | +note: required by a bound in `map` + --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL + | +LL | F: FnMut(Self::Item) -> B, + | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map` error[E0308]: mismatched types --> $DIR/closure-arg-type-mismatch.rs:10:5 diff --git a/src/test/ui/mismatched_types/issue-36053-2.stderr b/src/test/ui/mismatched_types/issue-36053-2.stderr index 67e8ee22836..a8bcdf5efe9 100644 --- a/src/test/ui/mismatched_types/issue-36053-2.stderr +++ b/src/test/ui/mismatched_types/issue-36053-2.stderr @@ -5,6 +5,12 @@ LL | once::<&str>("str").fuse().filter(|a: &str| true).count(); | ^^^^^^ -------------- found signature of `for<'r> fn(&'r str) -> _` | | | expected signature of `for<'r> fn(&'r &str) -> _` + | +note: required by a bound in `filter` + --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL + | +LL | P: FnMut(&Self::Item) -> bool, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `filter` error[E0599]: the method `count` exists for struct `Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:53]>`, but its trait bounds were not satisfied --> $DIR/issue-36053-2.rs:7:55 diff --git a/src/test/ui/not-clone-closure.stderr b/src/test/ui/not-clone-closure.stderr index a62c21f2ee9..d7546a5e398 100644 --- a/src/test/ui/not-clone-closure.stderr +++ b/src/test/ui/not-clone-closure.stderr @@ -11,6 +11,11 @@ LL | let hello = hello.clone(); | ^^^^^ within `[closure@$DIR/not-clone-closure.rs:7:17: 9:6]`, the trait `Clone` is not implemented for `S` | = note: required because it appears within the type `[closure@$DIR/not-clone-closure.rs:7:17: 9:6]` +note: required by `clone` + --> $SRC_DIR/core/src/clone.rs:LL:COL + | +LL | fn clone(&self) -> Self; + | ^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/regions/regions-bounded-method-type-parameters.stderr b/src/test/ui/regions/regions-bounded-method-type-parameters.stderr index 66b61b1349d..318e9d006a1 100644 --- a/src/test/ui/regions/regions-bounded-method-type-parameters.stderr +++ b/src/test/ui/regions/regions-bounded-method-type-parameters.stderr @@ -4,7 +4,11 @@ error[E0477]: the type `&'a isize` does not fulfill the required lifetime LL | Foo.some_method::<&'a isize>(); | ^^^^^^^^^^^ | - = note: type must satisfy the static lifetime +note: type must satisfy the static lifetime as required by this binding + --> $DIR/regions-bounded-method-type-parameters.rs:8:22 + | +LL | fn some_method<A:'static>(self) { } + | ^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/regions/regions-close-object-into-object-5.stderr b/src/test/ui/regions/regions-close-object-into-object-5.stderr index 83f8d20b9e1..512a7ab35fb 100644 --- a/src/test/ui/regions/regions-close-object-into-object-5.stderr +++ b/src/test/ui/regions/regions-close-object-into-object-5.stderr @@ -29,7 +29,13 @@ LL | fn f<'a, T, U>(v: Box<A<T> + 'static>) -> Box<X + 'static> { | - help: consider adding an explicit lifetime bound...: `T: 'static` LL | // oh dear! LL | Box::new(B(&*v)) as Box<dyn X> - | ^ ...so that the type `T` will meet its required lifetime bounds + | ^ ...so that the type `T` will meet its required lifetime bounds... + | +note: ...that is required by this bound + --> $DIR/regions-close-object-into-object-5.rs:9:17 + | +LL | struct B<'a, T: 'a>(&'a (A<T> + 'a)); + | ^^ error[E0310]: the parameter type `T` may not live long enough --> $DIR/regions-close-object-into-object-5.rs:17:14 diff --git a/src/test/ui/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr b/src/test/ui/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr index 785095c29ae..154a6a35a44 100644 --- a/src/test/ui/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr +++ b/src/test/ui/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr @@ -31,17 +31,6 @@ note: multiple `impl`s satisfying `i32: Add` found LL | impl const std::ops::Add for i32 { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: and another `impl` found in the `core` crate: `impl Add for i32;` -note: required by a bound in `Add` - --> $SRC_DIR/core/src/ops/arith.rs:LL:COL - | -LL | / pub trait Add<Rhs = Self> { -LL | | /// The resulting type after applying the `+` operator. -LL | | #[stable(feature = "rust1", since = "1.0.0")] -LL | | type Output; -... | -LL | | fn add(self, rhs: Rhs) -> Self::Output; -LL | | } - | |_^ required by this bound in `Add` error[E0283]: type annotations needed --> $DIR/const-and-non-const-impl.rs:14:6 @@ -57,17 +46,6 @@ LL | impl std::ops::Add for Int { ... LL | impl const std::ops::Add for Int { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: required by a bound in `Add` - --> $SRC_DIR/core/src/ops/arith.rs:LL:COL - | -LL | / pub trait Add<Rhs = Self> { -LL | | /// The resulting type after applying the `+` operator. -LL | | #[stable(feature = "rust1", since = "1.0.0")] -LL | | type Output; -... | -LL | | fn add(self, rhs: Rhs) -> Self::Output; -LL | | } - | |_^ required by this bound in `Add` error[E0283]: type annotations needed --> $DIR/const-and-non-const-impl.rs:22:12 @@ -83,17 +61,6 @@ LL | impl std::ops::Add for Int { ... LL | impl const std::ops::Add for Int { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: required by a bound in `Add` - --> $SRC_DIR/core/src/ops/arith.rs:LL:COL - | -LL | / pub trait Add<Rhs = Self> { -LL | | /// The resulting type after applying the `+` operator. -LL | | #[stable(feature = "rust1", since = "1.0.0")] -LL | | type Output; -... | -LL | | fn add(self, rhs: Rhs) -> Self::Output; -LL | | } - | |_^ required by this bound in `Add` error: aborting due to 5 previous errors diff --git a/src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr b/src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr index efe46d7e81d..04c21101e75 100644 --- a/src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr +++ b/src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr @@ -42,11 +42,11 @@ error[E0277]: the trait bound `NonTrivialDrop: A` is not satisfied LL | ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `A` is not implemented for `NonTrivialDrop` | -note: required by `ConstDropImplWithBounds` - --> $DIR/const-drop-fail.rs:27:1 +note: required by a bound in `ConstDropImplWithBounds` + --> $DIR/const-drop-fail.rs:27:35 | LL | struct ConstDropImplWithBounds<T: ~const A>(PhantomData<T>); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ required by this bound in `ConstDropImplWithBounds` error[E0277]: the trait bound `NonTrivialDrop: A` is not satisfied --> $DIR/const-drop-fail.rs:49:5 diff --git a/src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.stock.stderr b/src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.stock.stderr index efe46d7e81d..04c21101e75 100644 --- a/src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.stock.stderr +++ b/src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.stock.stderr @@ -42,11 +42,11 @@ error[E0277]: the trait bound `NonTrivialDrop: A` is not satisfied LL | ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `A` is not implemented for `NonTrivialDrop` | -note: required by `ConstDropImplWithBounds` - --> $DIR/const-drop-fail.rs:27:1 +note: required by a bound in `ConstDropImplWithBounds` + --> $DIR/const-drop-fail.rs:27:35 | LL | struct ConstDropImplWithBounds<T: ~const A>(PhantomData<T>); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^ required by this bound in `ConstDropImplWithBounds` error[E0277]: the trait bound `NonTrivialDrop: A` is not satisfied --> $DIR/const-drop-fail.rs:49:5 diff --git a/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause.stderr b/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause.stderr index fffb91f9870..08d91d7daf8 100644 --- a/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause.stderr +++ b/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause.stderr @@ -4,11 +4,11 @@ error[E0277]: the trait bound `T: Bar` is not satisfied LL | T::b(); | ^^^^ the trait `Bar` is not implemented for `T` | -note: required by `Foo::b` - --> $DIR/trait-where-clause.rs:8:5 +note: required by a bound in `Foo::b` + --> $DIR/trait-where-clause.rs:8:24 | LL | fn b() where Self: ~const Bar; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^ required by this bound in `Foo::b` help: consider further restricting this bound | LL | const fn test1<T: ~const Foo + Bar + Bar>() { @@ -20,11 +20,11 @@ error[E0277]: the trait bound `T: Bar` is not satisfied LL | T::c::<T>(); | ^^^^^^^^^ the trait `Bar` is not implemented for `T` | -note: required by `Foo::c` - --> $DIR/trait-where-clause.rs:9:5 +note: required by a bound in `Foo::c` + --> $DIR/trait-where-clause.rs:9:13 | LL | fn c<T: ~const Bar>(); - | ^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^ required by this bound in `Foo::c` help: consider further restricting this bound | LL | const fn test1<T: ~const Foo + Bar + Bar>() { @@ -36,11 +36,11 @@ error[E0277]: the trait bound `T: Bar` is not satisfied LL | T::b(); | ^^^^ the trait `Bar` is not implemented for `T` | -note: required by `Foo::b` - --> $DIR/trait-where-clause.rs:8:5 +note: required by a bound in `Foo::b` + --> $DIR/trait-where-clause.rs:8:24 | LL | fn b() where Self: ~const Bar; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^ required by this bound in `Foo::b` help: consider further restricting this bound | LL | fn test3<T: Foo + Bar>() { @@ -52,11 +52,11 @@ error[E0277]: the trait bound `T: Bar` is not satisfied LL | T::c::<T>(); | ^^^^^^^^^ the trait `Bar` is not implemented for `T` | -note: required by `Foo::c` - --> $DIR/trait-where-clause.rs:9:5 +note: required by a bound in `Foo::c` + --> $DIR/trait-where-clause.rs:9:13 | LL | fn c<T: ~const Bar>(); - | ^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^ required by this bound in `Foo::c` help: consider further restricting this bound | LL | fn test3<T: Foo + Bar>() { diff --git a/src/test/ui/specialization/issue-39448.stderr b/src/test/ui/specialization/issue-39448.stderr index c4fc44c737e..a8a4114e4dd 100644 --- a/src/test/ui/specialization/issue-39448.stderr +++ b/src/test/ui/specialization/issue-39448.stderr @@ -24,6 +24,11 @@ note: required because of the requirements on the impl of `ToA<T>` for `U` | LL | impl<T, U> ToA<U> for T | ^^^^^^ ^ +note: required by `ToA::to` + --> $DIR/issue-39448.rs:31:5 + | +LL | fn to(self) -> T; + | ^^^^^^^^^^^^^^^^^ error: aborting due to previous error; 1 warning emitted diff --git a/src/test/ui/str/str-idx.stderr b/src/test/ui/str/str-idx.stderr index 47bd6f6bfa7..9c3c3646139 100644 --- a/src/test/ui/str/str-idx.stderr +++ b/src/test/ui/str/str-idx.stderr @@ -20,6 +20,11 @@ LL | let _ = s.get(4); = help: the trait `SliceIndex<str>` is not implemented for `{integer}` = note: you can use `.chars().nth()` or `.bytes().nth()` for more information, see chapter 8 in The Book: <https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings> +note: required by a bound in `core::str::<impl str>::get` + --> $SRC_DIR/core/src/str/mod.rs:LL:COL + | +LL | pub fn get<I: SliceIndex<str>>(&self, i: I) -> Option<&I::Output> { + | ^^^^^^^^^^^^^^^ required by this bound in `core::str::<impl str>::get` error[E0277]: the type `str` cannot be indexed by `{integer}` --> $DIR/str-idx.rs:5:29 @@ -32,6 +37,11 @@ LL | let _ = s.get_unchecked(4); = help: the trait `SliceIndex<str>` is not implemented for `{integer}` = note: you can use `.chars().nth()` or `.bytes().nth()` for more information, see chapter 8 in The Book: <https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings> +note: required by a bound in `core::str::<impl str>::get_unchecked` + --> $SRC_DIR/core/src/str/mod.rs:LL:COL + | +LL | pub unsafe fn get_unchecked<I: SliceIndex<str>>(&self, i: I) -> &I::Output { + | ^^^^^^^^^^^^^^^ required by this bound in `core::str::<impl str>::get_unchecked` error[E0277]: the type `str` cannot be indexed by `char` --> $DIR/str-idx.rs:6:17 diff --git a/src/test/ui/str/str-mut-idx.stderr b/src/test/ui/str/str-mut-idx.stderr index ab647c75cf1..2559ee9eb49 100644 --- a/src/test/ui/str/str-mut-idx.stderr +++ b/src/test/ui/str/str-mut-idx.stderr @@ -44,6 +44,11 @@ LL | s.get_mut(1); = help: the trait `SliceIndex<str>` is not implemented for `{integer}` = note: you can use `.chars().nth()` or `.bytes().nth()` for more information, see chapter 8 in The Book: <https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings> +note: required by a bound in `core::str::<impl str>::get_mut` + --> $SRC_DIR/core/src/str/mod.rs:LL:COL + | +LL | pub fn get_mut<I: SliceIndex<str>>(&mut self, i: I) -> Option<&mut I::Output> { + | ^^^^^^^^^^^^^^^ required by this bound in `core::str::<impl str>::get_mut` error[E0277]: the type `str` cannot be indexed by `{integer}` --> $DIR/str-mut-idx.rs:11:25 @@ -56,6 +61,11 @@ LL | s.get_unchecked_mut(1); = help: the trait `SliceIndex<str>` is not implemented for `{integer}` = note: you can use `.chars().nth()` or `.bytes().nth()` for more information, see chapter 8 in The Book: <https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings> +note: required by a bound in `core::str::<impl str>::get_unchecked_mut` + --> $SRC_DIR/core/src/str/mod.rs:LL:COL + | +LL | pub unsafe fn get_unchecked_mut<I: SliceIndex<str>>(&mut self, i: I) -> &mut I::Output { + | ^^^^^^^^^^^^^^^ required by this bound in `core::str::<impl str>::get_unchecked_mut` error[E0277]: the type `str` cannot be indexed by `char` --> $DIR/str-mut-idx.rs:13:5 diff --git a/src/test/ui/structs/struct-path-alias-bounds.stderr b/src/test/ui/structs/struct-path-alias-bounds.stderr index e0a22c2df1a..7a80e7270ba 100644 --- a/src/test/ui/structs/struct-path-alias-bounds.stderr +++ b/src/test/ui/structs/struct-path-alias-bounds.stderr @@ -4,11 +4,11 @@ error[E0277]: the trait bound `NoClone: Clone` is not satisfied LL | let s = A { a: NoClone }; | ^ the trait `Clone` is not implemented for `NoClone` | -note: required by `S` - --> $DIR/struct-path-alias-bounds.rs:3:1 +note: required by a bound in `S` + --> $DIR/struct-path-alias-bounds.rs:3:13 | LL | struct S<T: Clone> { a: T } - | ^^^^^^^^^^^^^^^^^^ + | ^^^^^ required by this bound in `S` error: aborting due to previous error diff --git a/src/test/ui/substs-ppaux.normal.stderr b/src/test/ui/substs-ppaux.normal.stderr index 97caa833d2f..eabda55e08f 100644 --- a/src/test/ui/substs-ppaux.normal.stderr +++ b/src/test/ui/substs-ppaux.normal.stderr @@ -82,11 +82,11 @@ note: required because of the requirements on the impl of `Foo<'_, '_, u8>` for | LL | impl<'a,'b,T,S> Foo<'a, 'b, S> for T {} | ^^^^^^^^^^^^^^ ^ -note: required by a bound in `Foo::bar` - --> $DIR/substs-ppaux.rs:7:30 +note: required by `Foo::bar` + --> $DIR/substs-ppaux.rs:7:5 | LL | fn bar<'a, T>() where T: 'a {} - | ^^ required by this bound in `Foo::bar` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 5 previous errors diff --git a/src/test/ui/substs-ppaux.verbose.stderr b/src/test/ui/substs-ppaux.verbose.stderr index 5829073c265..cd0dfb9c6b4 100644 --- a/src/test/ui/substs-ppaux.verbose.stderr +++ b/src/test/ui/substs-ppaux.verbose.stderr @@ -82,11 +82,11 @@ note: required because of the requirements on the impl of `Foo<'_#0r, '_#1r, u8> | LL | impl<'a,'b,T,S> Foo<'a, 'b, S> for T {} | ^^^^^^^^^^^^^^ ^ -note: required by a bound in `Foo::bar` - --> $DIR/substs-ppaux.rs:7:30 +note: required by `Foo::bar` + --> $DIR/substs-ppaux.rs:7:5 | LL | fn bar<'a, T>() where T: 'a {} - | ^^ required by this bound in `Foo::bar` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 5 previous errors diff --git a/src/test/ui/suggestions/expected-boxed-future-isnt-pinned.stderr b/src/test/ui/suggestions/expected-boxed-future-isnt-pinned.stderr index aa3175dae2e..7ef4895249c 100644 --- a/src/test/ui/suggestions/expected-boxed-future-isnt-pinned.stderr +++ b/src/test/ui/suggestions/expected-boxed-future-isnt-pinned.stderr @@ -46,11 +46,11 @@ LL | Pin::new(x) | ^^^^^^^^ the trait `Unpin` is not implemented for `dyn Future<Output = i32> + Send` | = note: consider using `Box::pin` -note: required by `Pin::<P>::new` +note: required by a bound in `Pin::<P>::new` --> $SRC_DIR/core/src/pin.rs:LL:COL | -LL | pub const fn new(pointer: P) -> Pin<P> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | impl<P: Deref<Target: Unpin>> Pin<P> { + | ^^^^^ required by this bound in `Pin::<P>::new` error[E0277]: `dyn Future<Output = i32> + Send` cannot be unpinned --> $DIR/expected-boxed-future-isnt-pinned.rs:24:5 @@ -59,11 +59,11 @@ LL | Pin::new(Box::new(x)) | ^^^^^^^^ the trait `Unpin` is not implemented for `dyn Future<Output = i32> + Send` | = note: consider using `Box::pin` -note: required by `Pin::<P>::new` +note: required by a bound in `Pin::<P>::new` --> $SRC_DIR/core/src/pin.rs:LL:COL | -LL | pub const fn new(pointer: P) -> Pin<P> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | impl<P: Deref<Target: Unpin>> Pin<P> { + | ^^^^^ required by this bound in `Pin::<P>::new` error[E0308]: mismatched types --> $DIR/expected-boxed-future-isnt-pinned.rs:28:5 diff --git a/src/test/ui/suggestions/issue-62843.stderr b/src/test/ui/suggestions/issue-62843.stderr index 29ba39cbe10..bc1c69406d1 100644 --- a/src/test/ui/suggestions/issue-62843.stderr +++ b/src/test/ui/suggestions/issue-62843.stderr @@ -8,6 +8,11 @@ LL | println!("{:?}", line.find(pattern)); | = note: the trait bound `String: Pattern<'_>` is not satisfied = note: required because of the requirements on the impl of `Pattern<'_>` for `String` +note: required by a bound in `core::str::<impl str>::find` + --> $SRC_DIR/core/src/str/mod.rs:LL:COL + | +LL | pub fn find<'a, P: Pattern<'a>>(&'a self, pat: P) -> Option<usize> { + | ^^^^^^^^^^^ required by this bound in `core::str::<impl str>::find` help: consider borrowing here | LL | println!("{:?}", line.find(&pattern)); diff --git a/src/test/ui/suggestions/issue-71394-no-from-impl.stderr b/src/test/ui/suggestions/issue-71394-no-from-impl.stderr index 79724377713..bee29dbb079 100644 --- a/src/test/ui/suggestions/issue-71394-no-from-impl.stderr +++ b/src/test/ui/suggestions/issue-71394-no-from-impl.stderr @@ -8,6 +8,11 @@ LL | let _: &[i8] = data.into(); <[T; LANES] as From<Simd<T, LANES>>> <[bool; LANES] as From<Mask<T, LANES>>> = note: required because of the requirements on the impl of `Into<&[i8]>` for `&[u8]` +note: required by `into` + --> $SRC_DIR/core/src/convert/mod.rs:LL:COL + | +LL | fn into(self) -> T; + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/suggestions/issue-84973.stderr b/src/test/ui/suggestions/issue-84973.stderr index 16a28c73aa7..24c989ec3e8 100644 --- a/src/test/ui/suggestions/issue-84973.stderr +++ b/src/test/ui/suggestions/issue-84973.stderr @@ -6,11 +6,14 @@ LL | let o = Other::new(f); | | | required by a bound introduced by this call | -note: required by `Other::<'a, G>::new` - --> $DIR/issue-84973.rs:27:5 +note: required by a bound in `Other::<'a, G>::new` + --> $DIR/issue-84973.rs:25:8 | +LL | G: SomeTrait, + | ^^^^^^^^^ required by this bound in `Other::<'a, G>::new` +LL | { LL | pub fn new(g: G) -> Self { - | ^^^^^^^^^^^^^^^^^^^^^^^^ + | --- required by a bound in this help: consider borrowing here | LL | let o = Other::new(&f); diff --git a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.stderr b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.stderr index 0cf0074dc3d..adb928aa8a3 100644 --- a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.stderr +++ b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.stderr @@ -11,11 +11,16 @@ note: the parameter type `T` must be valid for the anonymous lifetime defined he | LL | fn func<T: Test>(foo: &Foo, t: T) { | ^^^ -note: ...so that the type `[closure@$DIR/missing-lifetimes-in-signature-2.rs:20:13: 23:6]` will meet its required lifetime bounds +note: ...so that the type `[closure@$DIR/missing-lifetimes-in-signature-2.rs:20:13: 23:6]` will meet its required lifetime bounds... --> $DIR/missing-lifetimes-in-signature-2.rs:20:9 | LL | foo.bar(move |_| { | ^^^ +note: ...that is required by this bound + --> $DIR/missing-lifetimes-in-signature-2.rs:11:12 + | +LL | F: 'a, + | ^^ error: aborting due to previous error diff --git a/src/test/ui/suggestions/mut-borrow-needed-by-trait.stderr b/src/test/ui/suggestions/mut-borrow-needed-by-trait.stderr index e6a22313900..d121932c842 100644 --- a/src/test/ui/suggestions/mut-borrow-needed-by-trait.stderr +++ b/src/test/ui/suggestions/mut-borrow-needed-by-trait.stderr @@ -7,11 +7,11 @@ LL | let fp = BufWriter::new(fp); | required by a bound introduced by this call | = note: `std::io::Write` is implemented for `&mut dyn std::io::Write`, but not for `&dyn std::io::Write` -note: required by `BufWriter::<W>::new` +note: required by a bound in `BufWriter::<W>::new` --> $SRC_DIR/std/src/io/buffered/bufwriter.rs:LL:COL | -LL | pub fn new(inner: W) -> BufWriter<W> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | impl<W: Write> BufWriter<W> { + | ^^^^^ required by this bound in `BufWriter::<W>::new` error[E0277]: the trait bound `&dyn std::io::Write: std::io::Write` is not satisfied --> $DIR/mut-borrow-needed-by-trait.rs:17:14 diff --git a/src/test/ui/suggestions/suggest-change-mut.stderr b/src/test/ui/suggestions/suggest-change-mut.stderr index 8dfab8dfa17..2fa69cd5a2c 100644 --- a/src/test/ui/suggestions/suggest-change-mut.stderr +++ b/src/test/ui/suggestions/suggest-change-mut.stderr @@ -6,11 +6,11 @@ LL | let mut stream_reader = BufReader::new(&stream); | | | required by a bound introduced by this call | -note: required by `BufReader::<R>::new` +note: required by a bound in `BufReader::<R>::new` --> $SRC_DIR/std/src/io/buffered/bufreader.rs:LL:COL | -LL | pub fn new(inner: R) -> BufReader<R> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | impl<R: Read> BufReader<R> { + | ^^^^ required by this bound in `BufReader::<R>::new` help: consider removing the leading `&`-reference | LL - let mut stream_reader = BufReader::new(&stream); diff --git a/src/test/ui/traits/bad-method-typaram-kind.stderr b/src/test/ui/traits/bad-method-typaram-kind.stderr index 1e9d151629f..8befa4c5f73 100644 --- a/src/test/ui/traits/bad-method-typaram-kind.stderr +++ b/src/test/ui/traits/bad-method-typaram-kind.stderr @@ -4,6 +4,11 @@ error[E0277]: `T` cannot be sent between threads safely LL | 1.bar::<T>(); | ^^^ `T` cannot be sent between threads safely | +note: required by a bound in `Bar::bar` + --> $DIR/bad-method-typaram-kind.rs:6:14 + | +LL | fn bar<T:Send>(&self); + | ^^^^ required by this bound in `Bar::bar` help: consider further restricting this bound | LL | fn foo<T:'static + std::marker::Send>() { diff --git a/src/test/ui/traits/bad-sized.stderr b/src/test/ui/traits/bad-sized.stderr index 5421e71509f..6f9113fff51 100644 --- a/src/test/ui/traits/bad-sized.stderr +++ b/src/test/ui/traits/bad-sized.stderr @@ -29,11 +29,11 @@ LL | let x: Vec<dyn Trait + Sized> = Vec::new(); | ^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `dyn Trait` -note: required by `Vec::<T>::new` +note: required by a bound in `Vec::<T>::new` --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL | -LL | pub const fn new() -> Self { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | impl<T> Vec<T> { + | ^ required by this bound in `Vec::<T>::new` error[E0277]: the size for values of type `dyn Trait` cannot be known at compilation time --> $DIR/bad-sized.rs:4:37 diff --git a/src/test/ui/traits/bound/on-structs-and-enums-locals.stderr b/src/test/ui/traits/bound/on-structs-and-enums-locals.stderr index cd33e18cfb6..c9068a27002 100644 --- a/src/test/ui/traits/bound/on-structs-and-enums-locals.stderr +++ b/src/test/ui/traits/bound/on-structs-and-enums-locals.stderr @@ -16,11 +16,11 @@ error[E0277]: the trait bound `{integer}: Trait` is not satisfied LL | let foo = Foo { | ^^^ the trait `Trait` is not implemented for `{integer}` | -note: required by `Foo` - --> $DIR/on-structs-and-enums-locals.rs:5:1 +note: required by a bound in `Foo` + --> $DIR/on-structs-and-enums-locals.rs:5:14 | LL | struct Foo<T:Trait> { - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^ required by this bound in `Foo` error: aborting due to 2 previous errors diff --git a/src/test/ui/traits/bound/on-structs-and-enums-xc1.stderr b/src/test/ui/traits/bound/on-structs-and-enums-xc1.stderr index 0f25c885688..f4cc64af94f 100644 --- a/src/test/ui/traits/bound/on-structs-and-enums-xc1.stderr +++ b/src/test/ui/traits/bound/on-structs-and-enums-xc1.stderr @@ -16,11 +16,11 @@ error[E0277]: the trait bound `{integer}: Trait` is not satisfied LL | let foo = Foo { | ^^^ the trait `Trait` is not implemented for `{integer}` | -note: required by `Foo` - --> $DIR/auxiliary/on_structs_and_enums_xc.rs:5:1 +note: required by a bound in `Foo` + --> $DIR/auxiliary/on_structs_and_enums_xc.rs:5:18 | LL | pub struct Foo<T:Trait> { - | ^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^ required by this bound in `Foo` error: aborting due to 2 previous errors diff --git a/src/test/ui/traits/inheritance/repeated-supertrait-ambig.stderr b/src/test/ui/traits/inheritance/repeated-supertrait-ambig.stderr index fa8799bf7d8..73f680182fb 100644 --- a/src/test/ui/traits/inheritance/repeated-supertrait-ambig.stderr +++ b/src/test/ui/traits/inheritance/repeated-supertrait-ambig.stderr @@ -3,6 +3,12 @@ error[E0277]: the trait bound `dyn CompareToInts: CompareTo<i32>` is not satisfi | LL | c.same_as(22) | ^^^^^^^ the trait `CompareTo<i32>` is not implemented for `dyn CompareToInts` + | +note: required by `CompareTo::same_as` + --> $DIR/repeated-supertrait-ambig.rs:9:5 + | +LL | fn same_as(&self, t: T) -> bool; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the trait bound `C: CompareTo<i32>` is not satisfied --> $DIR/repeated-supertrait-ambig.rs:30:7 @@ -10,6 +16,11 @@ error[E0277]: the trait bound `C: CompareTo<i32>` is not satisfied LL | c.same_as(22) | ^^^^^^^ the trait `CompareTo<i32>` is not implemented for `C` | +note: required by `CompareTo::same_as` + --> $DIR/repeated-supertrait-ambig.rs:9:5 + | +LL | fn same_as(&self, t: T) -> bool; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider further restricting this bound | LL | fn with_trait<C:CompareToInts + CompareTo<i32>>(c: &C) -> bool { @@ -52,6 +63,11 @@ LL | assert_eq!(22_i64.same_as(22), true); = help: the following implementations were found: <i64 as CompareTo<i64>> <i64 as CompareTo<u64>> +note: required by `CompareTo::same_as` + --> $DIR/repeated-supertrait-ambig.rs:9:5 + | +LL | fn same_as(&self, t: T) -> bool; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 5 previous errors diff --git a/src/test/ui/traits/issue-77982.stderr b/src/test/ui/traits/issue-77982.stderr index e868756504f..0d772c020cf 100644 --- a/src/test/ui/traits/issue-77982.stderr +++ b/src/test/ui/traits/issue-77982.stderr @@ -10,6 +10,15 @@ LL | opts.get(opt.as_ref()); - impl Borrow<str> for String; - impl<T> Borrow<T> for T where T: ?Sized; +note: required by a bound in `HashMap::<K, V, S>::get` + --> $SRC_DIR/std/src/collections/hash/map.rs:LL:COL + | +LL | K: Borrow<Q>, + | ^^^^^^^^^ required by this bound in `HashMap::<K, V, S>::get` +help: consider specifying the type argument in the function call + | +LL | opts.get::<Q>(opt.as_ref()); + | +++++ error[E0283]: type annotations needed --> $DIR/issue-77982.rs:8:18 @@ -25,6 +34,11 @@ LL | opts.get(opt.as_ref()); - impl AsRef<Path> for String; - impl AsRef<[u8]> for String; - impl AsRef<str> for String; +note: required by `as_ref` + --> $SRC_DIR/core/src/convert/mod.rs:LL:COL + | +LL | fn as_ref(&self) -> &T; + | ^^^^^^^^^^^^^^^^^^^^^^^ help: use the fully qualified path for the potential candidates | LL | opts.get(<String as AsRef<OsStr>>::as_ref(opt)); @@ -71,6 +85,11 @@ LL | impl Foo<'static, u32> for () {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ LL | impl<'a> Foo<'a, i16> for () {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +note: required by `Foo::foo` + --> $DIR/issue-77982.rs:18:5 + | +LL | fn foo(&self) -> Box<T> { + | ^^^^^^^^^^^^^^^^^^^^^^^ error[E0283]: type annotations needed for `Box<T>` --> $DIR/issue-77982.rs:40:19 @@ -87,6 +106,11 @@ LL | impl<'a> Bar<'static, u32> for &'a () {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ LL | impl<'a> Bar<'a, i16> for &'a () {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +note: required by `Bar::bar` + --> $DIR/issue-77982.rs:24:5 + | +LL | fn bar(&self) -> Box<T> { + | ^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 5 previous errors diff --git a/src/test/ui/traits/issue-85735.stderr b/src/test/ui/traits/issue-85735.stderr index 1f81fa72547..33b12ef09ec 100644 --- a/src/test/ui/traits/issue-85735.stderr +++ b/src/test/ui/traits/issue-85735.stderr @@ -5,15 +5,6 @@ LL | T: FnMut(&'a ()), | ^^^^^^^^^^^^^ cannot infer type for type parameter `T` | = note: cannot satisfy `T: FnMut<(&'a (),)>` -note: required by a bound in `FnMut` - --> $SRC_DIR/core/src/ops/function.rs:LL:COL - | -LL | / pub trait FnMut<Args>: FnOnce<Args> { -LL | | /// Performs the call operation. -LL | | #[unstable(feature = "fn_traits", issue = "29625")] -LL | | extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output; -LL | | } - | |_^ required by this bound in `FnMut` error: aborting due to previous error diff --git a/src/test/ui/traits/negative-impls/negated-auto-traits-error.stderr b/src/test/ui/traits/negative-impls/negated-auto-traits-error.stderr index 1ab130e0ab1..c5d4ccc2fcd 100644 --- a/src/test/ui/traits/negative-impls/negated-auto-traits-error.stderr +++ b/src/test/ui/traits/negative-impls/negated-auto-traits-error.stderr @@ -7,11 +7,11 @@ LL | Outer(TestType); | required by a bound introduced by this call | = help: the trait `Send` is not implemented for `dummy::TestType` -note: required by `Outer` - --> $DIR/negated-auto-traits-error.rs:10:1 +note: required by a bound in `Outer` + --> $DIR/negated-auto-traits-error.rs:10:17 | LL | struct Outer<T: Send>(T); - | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^ required by this bound in `Outer` error[E0277]: `dummy::TestType` cannot be sent between threads safely --> $DIR/negated-auto-traits-error.rs:23:5 diff --git a/src/test/ui/traits/test-2.stderr b/src/test/ui/traits/test-2.stderr index 5eec0124584..3e0dcda07f1 100644 --- a/src/test/ui/traits/test-2.stderr +++ b/src/test/ui/traits/test-2.stderr @@ -92,6 +92,11 @@ LL | impl bar for i32 { fn dup(&self) -> i32 { *self } fn blah<X>(&self) {} } | ^^^^^^^^^^^^^^^^ LL | impl bar for u32 { fn dup(&self) -> u32 { *self } fn blah<X>(&self) {} } | ^^^^^^^^^^^^^^^^ +note: required by `bar::dup` + --> $DIR/test-2.rs:4:13 + | +LL | trait bar { fn dup(&self) -> Self; fn blah<X>(&self); } + | ^^^^^^^^^^^^^^^^^^^^^^ error[E0283]: type annotations needed --> $DIR/test-2.rs:11:8 @@ -106,6 +111,11 @@ LL | impl bar for i32 { fn dup(&self) -> i32 { *self } fn blah<X>(&self) {} } | ^^^^^^^^^^^^^^^^ LL | impl bar for u32 { fn dup(&self) -> u32 { *self } fn blah<X>(&self) {} } | ^^^^^^^^^^^^^^^^ +note: required by `bar::blah` + --> $DIR/test-2.rs:4:36 + | +LL | trait bar { fn dup(&self) -> Self; fn blah<X>(&self); } + | ^^^^^^^^^^^^^^^^^^ error: aborting due to 7 previous errors diff --git a/src/test/ui/traits/vtable-res-trait-param.stderr b/src/test/ui/traits/vtable-res-trait-param.stderr index c5fff622b6b..2b3e3de9b1a 100644 --- a/src/test/ui/traits/vtable-res-trait-param.stderr +++ b/src/test/ui/traits/vtable-res-trait-param.stderr @@ -5,6 +5,12 @@ LL | b.gimme_an_a(y) | ---------- ^ the trait `TraitA` is not implemented for `{integer}` | | | required by a bound introduced by this call + | +note: required by a bound in `TraitB::gimme_an_a` + --> $DIR/vtable-res-trait-param.rs:6:21 + | +LL | fn gimme_an_a<A:TraitA>(&self, a: A) -> isize; + | ^^^^^^ required by this bound in `TraitB::gimme_an_a` error: aborting due to previous error diff --git a/src/test/ui/type/type-check/issue-40294.stderr b/src/test/ui/type/type-check/issue-40294.stderr index 9ca07eaba83..6d1e490bcf3 100644 --- a/src/test/ui/type/type-check/issue-40294.stderr +++ b/src/test/ui/type/type-check/issue-40294.stderr @@ -5,11 +5,6 @@ LL | where &'a T : Foo, | ^^^ cannot infer type for reference `&'a T` | = note: cannot satisfy `&'a T: Foo` -note: required by a bound in `Foo` - --> $DIR/issue-40294.rs:1:1 - | -LL | trait Foo: Sized { - | ^^^^^^^^^^^^^^^^ required by this bound in `Foo` error: aborting due to previous error diff --git a/src/test/ui/union/union-generic.mirunsafeck.stderr b/src/test/ui/union/union-generic.mirunsafeck.stderr index cd857781864..a4f0c400d73 100644 --- a/src/test/ui/union/union-generic.mirunsafeck.stderr +++ b/src/test/ui/union/union-generic.mirunsafeck.stderr @@ -4,11 +4,11 @@ error[E0277]: the trait bound `Rc<u32>: Copy` is not satisfied LL | let u = U { a: Rc::new(0u32) }; | ^ the trait `Copy` is not implemented for `Rc<u32>` | -note: required by `U` - --> $DIR/union-generic.rs:6:1 +note: required by a bound in `U` + --> $DIR/union-generic.rs:6:12 | LL | union U<T: Copy> { - | ^^^^^^^^^^^^^^^^ + | ^^^^ required by this bound in `U` error[E0277]: the trait bound `Rc<u32>: Copy` is not satisfied --> $DIR/union-generic.rs:13:13 @@ -16,11 +16,11 @@ error[E0277]: the trait bound `Rc<u32>: Copy` is not satisfied LL | let u = U::<Rc<u32>> { a: Default::default() }; | ^^^^^^^^^^^^ the trait `Copy` is not implemented for `Rc<u32>` | -note: required by `U` - --> $DIR/union-generic.rs:6:1 +note: required by a bound in `U` + --> $DIR/union-generic.rs:6:12 | LL | union U<T: Copy> { - | ^^^^^^^^^^^^^^^^ + | ^^^^ required by this bound in `U` error: aborting due to 2 previous errors diff --git a/src/test/ui/union/union-generic.thirunsafeck.stderr b/src/test/ui/union/union-generic.thirunsafeck.stderr index cd857781864..a4f0c400d73 100644 --- a/src/test/ui/union/union-generic.thirunsafeck.stderr +++ b/src/test/ui/union/union-generic.thirunsafeck.stderr @@ -4,11 +4,11 @@ error[E0277]: the trait bound `Rc<u32>: Copy` is not satisfied LL | let u = U { a: Rc::new(0u32) }; | ^ the trait `Copy` is not implemented for `Rc<u32>` | -note: required by `U` - --> $DIR/union-generic.rs:6:1 +note: required by a bound in `U` + --> $DIR/union-generic.rs:6:12 | LL | union U<T: Copy> { - | ^^^^^^^^^^^^^^^^ + | ^^^^ required by this bound in `U` error[E0277]: the trait bound `Rc<u32>: Copy` is not satisfied --> $DIR/union-generic.rs:13:13 @@ -16,11 +16,11 @@ error[E0277]: the trait bound `Rc<u32>: Copy` is not satisfied LL | let u = U::<Rc<u32>> { a: Default::default() }; | ^^^^^^^^^^^^ the trait `Copy` is not implemented for `Rc<u32>` | -note: required by `U` - --> $DIR/union-generic.rs:6:1 +note: required by a bound in `U` + --> $DIR/union-generic.rs:6:12 | LL | union U<T: Copy> { - | ^^^^^^^^^^^^^^^^ + | ^^^^ required by this bound in `U` error: aborting due to 2 previous errors diff --git a/src/test/ui/unsized/issue-71659.stderr b/src/test/ui/unsized/issue-71659.stderr index be2df8c85e1..d7b95f55769 100644 --- a/src/test/ui/unsized/issue-71659.stderr +++ b/src/test/ui/unsized/issue-71659.stderr @@ -3,6 +3,15 @@ error[E0277]: the trait bound `dyn Foo: CastTo<[i32]>` is not satisfied | LL | let x = x.cast::<[i32]>(); | ^^^^ the trait `CastTo<[i32]>` is not implemented for `dyn Foo` + | +note: required by a bound in `Cast::cast` + --> $DIR/issue-71659.rs:19:15 + | +LL | fn cast<T: ?Sized>(&self) -> &T + | ---- required by a bound in this +LL | where +LL | Self: CastTo<T>, + | ^^^^^^^^^ required by this bound in `Cast::cast` error: aborting due to previous error diff --git a/src/test/ui/wf/wf-foreign-fn-decl-ret.stderr b/src/test/ui/wf/wf-foreign-fn-decl-ret.stderr index 66bfdbc5962..b03023b5fd1 100644 --- a/src/test/ui/wf/wf-foreign-fn-decl-ret.stderr +++ b/src/test/ui/wf/wf-foreign-fn-decl-ret.stderr @@ -3,12 +3,6 @@ error[E0277]: the trait bound `(): Foo` is not satisfied | LL | pub fn lint_me() -> <() as Foo>::Assoc; | ^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `()` - | -note: required by a bound in `Foo` - --> $DIR/wf-foreign-fn-decl-ret.rs:6:1 - | -LL | pub trait Foo { - | ^^^^^^^^^^^^^ required by this bound in `Foo` error[E0277]: the trait bound `u32: Unsatisfied` is not satisfied --> $DIR/wf-foreign-fn-decl-ret.rs:14:32 diff --git a/src/test/ui/where-clauses/where-clause-method-substituion.stderr b/src/test/ui/where-clauses/where-clause-method-substituion.stderr index cb381d2d9fe..f431deee73f 100644 --- a/src/test/ui/where-clauses/where-clause-method-substituion.stderr +++ b/src/test/ui/where-clauses/where-clause-method-substituion.stderr @@ -3,6 +3,12 @@ error[E0277]: the trait bound `X: Foo<X>` is not satisfied | LL | 1.method::<X>(); | ^^^^^^ the trait `Foo<X>` is not implemented for `X` + | +note: required by a bound in `Bar::method` + --> $DIR/where-clause-method-substituion.rs:6:34 + | +LL | fn method<B>(&self) where A: Foo<B>; + | ^^^^^^ required by this bound in `Bar::method` error: aborting due to previous error diff --git a/src/test/ui/where-clauses/where-clauses-method-unsatisfied.stderr b/src/test/ui/where-clauses/where-clauses-method-unsatisfied.stderr index 3223dca3cdd..3a4cbb62d55 100644 --- a/src/test/ui/where-clauses/where-clauses-method-unsatisfied.stderr +++ b/src/test/ui/where-clauses/where-clauses-method-unsatisfied.stderr @@ -5,6 +5,12 @@ LL | x.equals(&x); | ------ ^^ the trait `Eq` is not implemented for `Bar` | | | required by a bound introduced by this call + | +note: required by a bound in `Foo::<T>::equals` + --> $DIR/where-clauses-method-unsatisfied.rs:11:52 + | +LL | fn equals(&self, u: &Foo<T>) -> bool where T : Eq { + | ^^ required by this bound in `Foo::<T>::equals` error: aborting due to previous error |
