diff options
Diffstat (limited to 'src')
207 files changed, 1783 insertions, 2593 deletions
diff --git a/src/test/incremental/hashes/trait_defs.rs b/src/test/incremental/hashes/trait_defs.rs index 9cbd110d68a..b72ec404f67 100644 --- a/src/test/incremental/hashes/trait_defs.rs +++ b/src/test/incremental/hashes/trait_defs.rs @@ -33,7 +33,7 @@ trait TraitVisibility { } #[cfg(not(any(cfail1,cfail4)))] #[rustc_clean(except="hir_owner", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(except="hir_owner,predicates_of", cfg="cfail5")] +#[rustc_clean(except="hir_owner", cfg="cfail5")] #[rustc_clean(cfg="cfail6")] pub trait TraitVisibility { } @@ -46,7 +46,7 @@ trait TraitUnsafety { } #[cfg(not(any(cfail1,cfail4)))] #[rustc_clean(except="hir_owner", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(except="hir_owner,predicates_of", cfg="cfail5")] +#[rustc_clean(except="hir_owner", cfg="cfail5")] #[rustc_clean(cfg="cfail6")] unsafe trait TraitUnsafety { } @@ -60,7 +60,7 @@ trait TraitAddMethod { #[cfg(not(any(cfail1,cfail4)))] #[rustc_clean(except="hir_owner,associated_item_def_ids", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] -#[rustc_clean(except="hir_owner,associated_item_def_ids,predicates_of", cfg="cfail5")] +#[rustc_clean(except="hir_owner,associated_item_def_ids", cfg="cfail5")] #[rustc_clean(cfg="cfail6")] pub trait TraitAddMethod { fn method(); diff --git a/src/test/ui/allocator/not-an-allocator.stderr b/src/test/ui/allocator/not-an-allocator.stderr index 628b48a45d7..e7a9ce94af4 100644 --- a/src/test/ui/allocator/not-an-allocator.stderr +++ b/src/test/ui/allocator/not-an-allocator.stderr @@ -6,11 +6,6 @@ LL | #[global_allocator] LL | static A: usize = 0; | ^^^^^^^^^^^^^^^^^^^^ the trait `GlobalAlloc` is not implemented for `usize` | -note: required by `std::alloc::GlobalAlloc::alloc` - --> $SRC_DIR/core/src/alloc/global.rs:LL:COL - | -LL | unsafe fn alloc(&self, layout: Layout) -> *mut u8; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the attribute macro `global_allocator` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `usize: GlobalAlloc` is not satisfied @@ -21,11 +16,6 @@ LL | #[global_allocator] LL | static A: usize = 0; | ^^^^^^^^^^^^^^^^^^^^ the trait `GlobalAlloc` is not implemented for `usize` | -note: required by `std::alloc::GlobalAlloc::dealloc` - --> $SRC_DIR/core/src/alloc/global.rs:LL:COL - | -LL | unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the attribute macro `global_allocator` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `usize: GlobalAlloc` is not satisfied @@ -36,11 +26,6 @@ LL | #[global_allocator] LL | static A: usize = 0; | ^^^^^^^^^^^^^^^^^^^^ the trait `GlobalAlloc` is not implemented for `usize` | -note: required by `std::alloc::GlobalAlloc::realloc` - --> $SRC_DIR/core/src/alloc/global.rs:LL:COL - | -LL | unsafe fn realloc(&self, ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8 { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the attribute macro `global_allocator` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `usize: GlobalAlloc` is not satisfied @@ -51,11 +36,6 @@ LL | #[global_allocator] LL | static A: usize = 0; | ^^^^^^^^^^^^^^^^^^^^ the trait `GlobalAlloc` is not implemented for `usize` | -note: required by `std::alloc::GlobalAlloc::alloc_zeroed` - --> $SRC_DIR/core/src/alloc/global.rs:LL:COL - | -LL | unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8 { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the attribute macro `global_allocator` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 4 previous errors diff --git a/src/test/ui/associated-consts/associated-const-array-len.stderr b/src/test/ui/associated-consts/associated-const-array-len.stderr index ff56d112c81..86c62e7b7f1 100644 --- a/src/test/ui/associated-consts/associated-const-array-len.stderr +++ b/src/test/ui/associated-consts/associated-const-array-len.stderr @@ -3,12 +3,6 @@ error[E0277]: the trait bound `i32: Foo` is not satisfied | LL | const X: [i32; <i32 as Foo>::ID] = [0, 1, 2]; | ^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `i32` - | -note: required by `Foo::ID` - --> $DIR/associated-const-array-len.rs:2:5 - | -LL | const ID: usize; - | ^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/associated-consts/issue-63496.stderr b/src/test/ui/associated-consts/issue-63496.stderr index cea56cd5946..db39fd762c3 100644 --- a/src/test/ui/associated-consts/issue-63496.stderr +++ b/src/test/ui/associated-consts/issue-63496.stderr @@ -9,11 +9,6 @@ LL | fn f() -> ([u8; A::C], [u8; A::C]); | = note: cannot satisfy `_: A` = note: associated constants cannot be accessed directly on a `trait`, they can only be accessed through a specific `impl` -note: required by `A::C` - --> $DIR/issue-63496.rs:2:5 - | -LL | const C: usize; - | ^^^^^^^^^^^^^^^ error[E0283]: type annotations needed --> $DIR/issue-63496.rs:4:33 @@ -26,11 +21,6 @@ LL | fn f() -> ([u8; A::C], [u8; A::C]); | = note: cannot satisfy `_: A` = note: associated constants cannot be accessed directly on a `trait`, they can only be accessed through a specific `impl` -note: required by `A::C` - --> $DIR/issue-63496.rs:2:5 - | -LL | const C: usize; - | ^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/associated-item/issue-48027.stderr b/src/test/ui/associated-item/issue-48027.stderr index 7b158f1d754..9ae25a8c222 100644 --- a/src/test/ui/associated-item/issue-48027.stderr +++ b/src/test/ui/associated-item/issue-48027.stderr @@ -9,11 +9,6 @@ LL | fn return_n(&self) -> [u8; Bar::X]; | = note: cannot satisfy `_: Bar` = note: associated constants cannot be accessed directly on a `trait`, they can only be accessed through a specific `impl` -note: required by `Bar::X` - --> $DIR/issue-48027.rs:2:5 - | -LL | const X: usize; - | ^^^^^^^^^^^^^^^ error[E0038]: the trait `Bar` cannot be made into an object --> $DIR/issue-48027.rs:6:6 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-bound-failure.stderr b/src/test/ui/associated-types/associated-types-bound-failure.stderr index e66c6b35ca1..3eda22796e0 100644 --- a/src/test/ui/associated-types/associated-types-bound-failure.stderr +++ b/src/test/ui/associated-types/associated-types-bound-failure.stderr @@ -6,11 +6,6 @@ LL | ToInt::to_int(&g.get()) | | | required by a bound introduced by this call | -note: required by `ToInt::to_int` - --> $DIR/associated-types-bound-failure.rs:6:5 - | -LL | fn to_int(&self) -> isize; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider further restricting the associated type | LL | where G : GetToInt, <G as GetToInt>::R: ToInt 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/associated-types/associated-types-unconstrained.stderr b/src/test/ui/associated-types/associated-types-unconstrained.stderr index 5f4b65bd131..60ec23cf655 100644 --- a/src/test/ui/associated-types/associated-types-unconstrained.stderr +++ b/src/test/ui/associated-types/associated-types-unconstrained.stderr @@ -5,11 +5,6 @@ LL | let x: isize = Foo::bar(); | ^^^^^^^^ cannot infer type | = note: cannot satisfy `_: Foo` -note: required by `Foo::bar` - --> $DIR/associated-types-unconstrained.rs:5:5 - | -LL | fn bar() -> isize; - | ^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/associated-types/issue-44153.stderr b/src/test/ui/associated-types/issue-44153.stderr index 7bf36d5e915..54f6556c083 100644 --- a/src/test/ui/associated-types/issue-44153.stderr +++ b/src/test/ui/associated-types/issue-44153.stderr @@ -9,11 +9,6 @@ note: required because of the requirements on the impl of `Visit` for `()` | LL | impl<'a> Visit for () where | ^^^^^ ^^ -note: required by `Visit::visit` - --> $DIR/issue-44153.rs:6:5 - | -LL | fn visit() {} - | ^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/substs-ppaux.normal.stderr b/src/test/ui/associated-types/substs-ppaux.normal.stderr index 97caa833d2f..085c56870b3 100644 --- a/src/test/ui/substs-ppaux.normal.stderr +++ b/src/test/ui/associated-types/substs-ppaux.normal.stderr @@ -82,11 +82,6 @@ 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 - | -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.rs b/src/test/ui/associated-types/substs-ppaux.rs index 66cd94d7a1b..66cd94d7a1b 100644 --- a/src/test/ui/substs-ppaux.rs +++ b/src/test/ui/associated-types/substs-ppaux.rs diff --git a/src/test/ui/substs-ppaux.verbose.stderr b/src/test/ui/associated-types/substs-ppaux.verbose.stderr index 5829073c265..b831f3b7a76 100644 --- a/src/test/ui/substs-ppaux.verbose.stderr +++ b/src/test/ui/associated-types/substs-ppaux.verbose.stderr @@ -82,11 +82,6 @@ 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 - | -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/async-await/issue-61076.rs b/src/test/ui/async-await/issue-61076.rs index a35baf1694c..a94136cfea1 100644 --- a/src/test/ui/async-await/issue-61076.rs +++ b/src/test/ui/async-await/issue-61076.rs @@ -42,12 +42,10 @@ async fn bar() -> Result<(), ()> { foo()?; //~ ERROR the `?` operator can only be applied to values that implement `Try` //~^ NOTE the `?` operator cannot be applied to type `impl Future<Output = Result<(), ()>>` //~| HELP the trait `Try` is not implemented for `impl Future<Output = Result<(), ()>>` - //~| NOTE required by `branch` //~| HELP consider `await`ing on the `Future` //~| NOTE in this expansion of desugaring of operator `?` //~| NOTE in this expansion of desugaring of operator `?` //~| NOTE in this expansion of desugaring of operator `?` - //~| NOTE in this expansion of desugaring of operator `?` Ok(()) } @@ -67,12 +65,10 @@ async fn baz() -> Result<(), ()> { t?; //~ ERROR the `?` operator can only be applied to values that implement `Try` //~^ NOTE the `?` operator cannot be applied to type `T` //~| HELP the trait `Try` is not implemented for `T` - //~| NOTE required by `branch` //~| HELP consider `await`ing on the `Future` //~| NOTE in this expansion of desugaring of operator `?` //~| NOTE in this expansion of desugaring of operator `?` //~| NOTE in this expansion of desugaring of operator `?` - //~| NOTE in this expansion of desugaring of operator `?` let _: i32 = tuple().0; //~ ERROR no field `0` diff --git a/src/test/ui/async-await/issue-61076.stderr b/src/test/ui/async-await/issue-61076.stderr index 9878ea2ae69..65c0bc695bf 100644 --- a/src/test/ui/async-await/issue-61076.stderr +++ b/src/test/ui/async-await/issue-61076.stderr @@ -5,35 +5,25 @@ LL | foo()?; | ^^^^^^ the `?` operator cannot be applied to type `impl Future<Output = Result<(), ()>>` | = help: the trait `Try` is not implemented for `impl Future<Output = Result<(), ()>>` -note: required by `branch` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn branch(self) -> ControlFlow<Self::Residual, Self::Output>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `await`ing on the `Future` | LL | foo().await?; | ++++++ error[E0277]: the `?` operator can only be applied to values that implement `Try` - --> $DIR/issue-61076.rs:67:5 + --> $DIR/issue-61076.rs:65:5 | LL | t?; | ^^ the `?` operator cannot be applied to type `T` | = help: the trait `Try` is not implemented for `T` -note: required by `branch` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn branch(self) -> ControlFlow<Self::Residual, Self::Output>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `await`ing on the `Future` | LL | t.await?; | ++++++ error[E0609]: no field `0` on type `impl Future<Output = Tuple>` - --> $DIR/issue-61076.rs:78:26 + --> $DIR/issue-61076.rs:74:26 | LL | let _: i32 = tuple().0; | ^ field not available in `impl Future`, but it is available in its `Output` @@ -44,7 +34,7 @@ LL | let _: i32 = tuple().await.0; | ++++++ error[E0609]: no field `a` on type `impl Future<Output = Struct>` - --> $DIR/issue-61076.rs:82:28 + --> $DIR/issue-61076.rs:78:28 | LL | let _: i32 = struct_().a; | ^ field not available in `impl Future`, but it is available in its `Output` @@ -55,7 +45,7 @@ LL | let _: i32 = struct_().await.a; | ++++++ error[E0599]: no method named `method` found for opaque type `impl Future<Output = Struct>` in the current scope - --> $DIR/issue-61076.rs:86:15 + --> $DIR/issue-61076.rs:82:15 | LL | struct_().method(); | ^^^^^^ method not found in `impl Future<Output = Struct>` @@ -66,13 +56,13 @@ LL | struct_().await.method(); | ++++++ error[E0308]: mismatched types - --> $DIR/issue-61076.rs:94:9 + --> $DIR/issue-61076.rs:90:9 | LL | Tuple(_) => {} | ^^^^^^^^ expected opaque type, found struct `Tuple` | note: while checking the return type of the `async fn` - --> $DIR/issue-61076.rs:58:21 + --> $DIR/issue-61076.rs:56:21 | LL | async fn tuple() -> Tuple { | ^^^^^ checked the `Output` of this `async fn`, expected opaque type diff --git a/src/test/ui/async-await/issue-70594.stderr b/src/test/ui/async-await/issue-70594.stderr index e20e2e8f6ba..eb24040404b 100644 --- a/src/test/ui/async-await/issue-70594.stderr +++ b/src/test/ui/async-await/issue-70594.stderr @@ -25,11 +25,6 @@ LL | [1; ().await]; | ^^^^^^^^ `()` is not a future | = help: the trait `Future` is not implemented for `()` -note: required by `poll` - --> $SRC_DIR/core/src/future/future.rs:LL:COL - | -LL | fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 4 previous errors diff --git a/src/test/ui/async-await/issue-84841.stderr b/src/test/ui/async-await/issue-84841.stderr index 7b6084c49a0..1e22373ba6e 100644 --- a/src/test/ui/async-await/issue-84841.stderr +++ b/src/test/ui/async-await/issue-84841.stderr @@ -5,11 +5,6 @@ LL | test()?; | ^^^^^^^ the `?` operator cannot be applied to type `impl Future<Output = ()>` | = help: the trait `Try` is not implemented for `impl Future<Output = ()>` -note: required by `branch` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn branch(self) -> ControlFlow<Self::Residual, Self::Output>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the `?` operator can only be used in an async function that returns `Result` or `Option` (or another type that implements `FromResidual`) --> $DIR/issue-84841.rs:9:11 @@ -25,11 +20,6 @@ LL | | } | |_- this function should return `Result` or `Option` to accept `?` | = help: the trait `FromResidual<_>` is not implemented for `()` -note: required by `from_residual` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn from_residual(residual: R) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/async-await/issues/issue-62009-1.stderr b/src/test/ui/async-await/issues/issue-62009-1.stderr index 946b8d19e69..e2ea72a1e61 100644 --- a/src/test/ui/async-await/issues/issue-62009-1.stderr +++ b/src/test/ui/async-await/issues/issue-62009-1.stderr @@ -34,11 +34,6 @@ LL | (|_| 2333).await; | ^^^^^^^^^^^^^^^^ `[closure@$DIR/issue-62009-1.rs:12:5: 12:15]` is not a future | = help: the trait `Future` is not implemented for `[closure@$DIR/issue-62009-1.rs:12:5: 12:15]` -note: required by `poll` - --> $SRC_DIR/core/src/future/future.rs:LL:COL - | -LL | fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 4 previous errors 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/async-await/try-on-option-in-async.stderr b/src/test/ui/async-await/try-on-option-in-async.stderr index e8bb4aca9a9..a55850d76c3 100644 --- a/src/test/ui/async-await/try-on-option-in-async.stderr +++ b/src/test/ui/async-await/try-on-option-in-async.stderr @@ -11,11 +11,6 @@ LL | | } | |_____- this function should return `Result` or `Option` to accept `?` | = help: the trait `FromResidual<Option<Infallible>>` is not implemented for `{integer}` -note: required by `from_residual` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn from_residual(residual: R) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the `?` operator can only be used in an async closure that returns `Result` or `Option` (or another type that implements `FromResidual`) --> $DIR/try-on-option-in-async.rs:17:10 @@ -30,11 +25,6 @@ LL | | }; | |_____- this function should return `Result` or `Option` to accept `?` | = help: the trait `FromResidual<Option<Infallible>>` is not implemented for `u32` -note: required by `from_residual` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn from_residual(residual: R) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the `?` operator can only be used in an async function that returns `Result` or `Option` (or another type that implements `FromResidual`) --> $DIR/try-on-option-in-async.rs:26:6 @@ -49,11 +39,6 @@ LL | | } | |_- this function should return `Result` or `Option` to accept `?` | = help: the trait `FromResidual<Option<Infallible>>` is not implemented for `u32` -note: required by `from_residual` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn from_residual(residual: R) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 3 previous errors diff --git a/src/test/ui/attributes/key-value-expansion.stderr b/src/test/ui/attributes/key-value-expansion.stderr index e59216fe902..878afb39214 100644 --- a/src/test/ui/attributes/key-value-expansion.stderr +++ b/src/test/ui/attributes/key-value-expansion.stderr @@ -16,15 +16,15 @@ LL | bug!(); = note: this error originates in the macro `bug` (in Nightly builds, run with -Z macro-backtrace for more info) error: unexpected token: `{ - let res = - ::alloc::fmt::format(::core::fmt::Arguments::new_v1(&[""], - &match (&"u8",) { - _args => - [::core::fmt::ArgumentV1::new(_args.0, - ::core::fmt::Display::fmt)], - })); - res -}.as_str()` + let res = + ::alloc::fmt::format(::core::fmt::Arguments::new_v1(&[""], + &match (&"u8",) { + _args => + [::core::fmt::ArgumentV1::new(_args.0, + ::core::fmt::Display::fmt)], + })); + res + }.as_str()` --> $DIR/key-value-expansion.rs:48:23 | LL | doc_comment! {format!("{coor}", coor = stringify!($t1)).as_str()} diff --git a/src/test/ui/borrowck/regions-bound-missing-bound-in-impl.stderr b/src/test/ui/borrowck/regions-bound-missing-bound-in-impl.stderr index 536fd43ef75..1e3b071ef92 100644 --- a/src/test/ui/borrowck/regions-bound-missing-bound-in-impl.stderr +++ b/src/test/ui/borrowck/regions-bound-missing-bound-in-impl.stderr @@ -64,13 +64,13 @@ LL | fn wrong_bound2(self, b: Inv, c: Inv, d: Inv) { | ^ lifetimes do not match method in trait error[E0276]: impl has stricter requirements than trait - --> $DIR/regions-bound-missing-bound-in-impl.rs:49:5 + --> $DIR/regions-bound-missing-bound-in-impl.rs:49:26 | LL | fn another_bound<'x: 'a>(self, x: Inv<'x>, y: Inv<'t>); | ------------------------------------------------------- definition of `another_bound` from trait ... LL | fn another_bound<'x: 't>(self, x: Inv<'x>, y: Inv<'t>) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `'x: 't` + | ^^ impl has extra requirement `'x: 't` error: aborting due to 6 previous errors 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/cmse-nonsecure/cmse-nonsecure-call/params-on-stack.stderr b/src/test/ui/cmse-nonsecure/cmse-nonsecure-call/params-on-stack.stderr index c9064184075..37230078781 100644 --- a/src/test/ui/cmse-nonsecure/cmse-nonsecure-call/params-on-stack.stderr +++ b/src/test/ui/cmse-nonsecure/cmse-nonsecure-call/params-on-stack.stderr @@ -1,5 +1,4 @@ error: <unknown>:0:0: in function test i32 (i32, i32, i32, i32, i32): call to non-secure function would require passing arguments on stack - error: aborting due to previous error diff --git a/src/test/ui/cmse-nonsecure/cmse-nonsecure-entry/params-on-stack.stderr b/src/test/ui/cmse-nonsecure/cmse-nonsecure-entry/params-on-stack.stderr index d9956acbe75..1054c266512 100644 --- a/src/test/ui/cmse-nonsecure/cmse-nonsecure-entry/params-on-stack.stderr +++ b/src/test/ui/cmse-nonsecure/cmse-nonsecure-entry/params-on-stack.stderr @@ -1,5 +1,4 @@ error: <unknown>:0:0: in function entry_function i32 (i32, i32, i32, i32, i32): secure entry function requires arguments on stack - 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/compare-method/proj-outlives-region.stderr b/src/test/ui/compare-method/proj-outlives-region.stderr index e5f5c5ed20d..797a8167931 100644 --- a/src/test/ui/compare-method/proj-outlives-region.stderr +++ b/src/test/ui/compare-method/proj-outlives-region.stderr @@ -1,11 +1,11 @@ error[E0276]: impl has stricter requirements than trait - --> $DIR/proj-outlives-region.rs:9:5 + --> $DIR/proj-outlives-region.rs:9:23 | LL | fn foo() where T: 'a; | --------------------- definition of `foo` from trait ... LL | fn foo() where U: 'a { } - | ^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `U: 'a` + | ^^ impl has extra requirement `U: 'a` error: aborting due to previous error diff --git a/src/test/ui/compare-method/region-extra-2.stderr b/src/test/ui/compare-method/region-extra-2.stderr index 420d99c15ec..f01d7f4710c 100644 --- a/src/test/ui/compare-method/region-extra-2.stderr +++ b/src/test/ui/compare-method/region-extra-2.stderr @@ -1,11 +1,11 @@ error[E0276]: impl has stricter requirements than trait - --> $DIR/region-extra-2.rs:9:5 + --> $DIR/region-extra-2.rs:9:53 | LL | fn renew<'b: 'a>(self) -> &'b mut [T]; | -------------------------------------- definition of `renew` from trait ... LL | fn renew<'b: 'a>(self) -> &'b mut [T] where 'a: 'b { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `'a: 'b` + | ^^ impl has extra requirement `'a: 'b` error: aborting due to previous error diff --git a/src/test/ui/compare-method/region-extra.stderr b/src/test/ui/compare-method/region-extra.stderr index 5a584c7d6ed..4a3af65e904 100644 --- a/src/test/ui/compare-method/region-extra.stderr +++ b/src/test/ui/compare-method/region-extra.stderr @@ -1,11 +1,11 @@ error[E0276]: impl has stricter requirements than trait - --> $DIR/region-extra.rs:9:5 + --> $DIR/region-extra.rs:9:24 | LL | fn foo(); | --------- definition of `foo` from trait ... LL | fn foo() where 'a: 'b { } - | ^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `'a: 'b` + | ^^ impl has extra requirement `'a: 'b` error: aborting due to previous error diff --git a/src/test/ui/compare-method/region-unrelated.stderr b/src/test/ui/compare-method/region-unrelated.stderr index fd3576ddcf1..f7ae6f94438 100644 --- a/src/test/ui/compare-method/region-unrelated.stderr +++ b/src/test/ui/compare-method/region-unrelated.stderr @@ -1,11 +1,11 @@ error[E0276]: impl has stricter requirements than trait - --> $DIR/region-unrelated.rs:9:5 + --> $DIR/region-unrelated.rs:9:23 | LL | fn foo() where T: 'a; | --------------------- definition of `foo` from trait ... LL | fn foo() where V: 'a { } - | ^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `V: 'a` + | ^^ impl has extra requirement `V: 'a` error: aborting due to previous error diff --git a/src/test/ui/compare-method/trait-bound-on-type-parameter.stderr b/src/test/ui/compare-method/trait-bound-on-type-parameter.stderr index 83a2ae60681..ce6885c1541 100644 --- a/src/test/ui/compare-method/trait-bound-on-type-parameter.stderr +++ b/src/test/ui/compare-method/trait-bound-on-type-parameter.stderr @@ -1,11 +1,11 @@ error[E0276]: impl has stricter requirements than trait - --> $DIR/trait-bound-on-type-parameter.rs:15:5 + --> $DIR/trait-bound-on-type-parameter.rs:15:13 | LL | fn b<C,D>(&self, x: C) -> C; | ---------------------------- definition of `b` from trait ... LL | fn b<F: Sync, G>(&self, _x: F) -> F { panic!() } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `F: Sync` + | ^^^^ impl has extra requirement `F: Sync` error: aborting due to previous error diff --git a/src/test/ui/compare-method/traits-misc-mismatch-1.stderr b/src/test/ui/compare-method/traits-misc-mismatch-1.stderr index da94fc65841..805c04536ca 100644 --- a/src/test/ui/compare-method/traits-misc-mismatch-1.stderr +++ b/src/test/ui/compare-method/traits-misc-mismatch-1.stderr @@ -1,65 +1,65 @@ error[E0276]: impl has stricter requirements than trait - --> $DIR/traits-misc-mismatch-1.rs:27:5 + --> $DIR/traits-misc-mismatch-1.rs:27:26 | LL | fn test_error1_fn<T: Eq>(&self); | -------------------------------- definition of `test_error1_fn` from trait ... LL | fn test_error1_fn<T: Ord>(&self) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: Ord` + | ^^^ impl has extra requirement `T: Ord` error[E0276]: impl has stricter requirements than trait - --> $DIR/traits-misc-mismatch-1.rs:31:5 + --> $DIR/traits-misc-mismatch-1.rs:31:31 | LL | fn test_error2_fn<T: Eq + Ord>(&self); | -------------------------------------- definition of `test_error2_fn` from trait ... LL | fn test_error2_fn<T: Eq + B>(&self) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: B` + | ^ impl has extra requirement `T: B` error[E0276]: impl has stricter requirements than trait - --> $DIR/traits-misc-mismatch-1.rs:35:5 + --> $DIR/traits-misc-mismatch-1.rs:35:26 | LL | fn test_error3_fn<T: Eq + Ord>(&self); | -------------------------------------- definition of `test_error3_fn` from trait ... LL | fn test_error3_fn<T: B + Eq>(&self) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: B` + | ^ impl has extra requirement `T: B` error[E0276]: impl has stricter requirements than trait - --> $DIR/traits-misc-mismatch-1.rs:45:5 + --> $DIR/traits-misc-mismatch-1.rs:45:26 | LL | fn test_error5_fn<T: A>(&self); | ------------------------------- definition of `test_error5_fn` from trait ... LL | fn test_error5_fn<T: B>(&self) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: B` + | ^ impl has extra requirement `T: B` error[E0276]: impl has stricter requirements than trait - --> $DIR/traits-misc-mismatch-1.rs:51:5 + --> $DIR/traits-misc-mismatch-1.rs:51:30 | LL | fn test_error7_fn<T: A>(&self); | ------------------------------- definition of `test_error7_fn` from trait ... LL | fn test_error7_fn<T: A + Eq>(&self) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: Eq` + | ^^ impl has extra requirement `T: Eq` error[E0276]: impl has stricter requirements than trait - --> $DIR/traits-misc-mismatch-1.rs:54:5 + --> $DIR/traits-misc-mismatch-1.rs:54:26 | LL | fn test_error8_fn<T: B>(&self); | ------------------------------- definition of `test_error8_fn` from trait ... LL | fn test_error8_fn<T: C>(&self) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: C` + | ^ impl has extra requirement `T: C` error[E0276]: impl has stricter requirements than trait - --> $DIR/traits-misc-mismatch-1.rs:67:5 + --> $DIR/traits-misc-mismatch-1.rs:67:18 | LL | fn method<G:Getter<isize>>(&self); | ---------------------------------- definition of `method` from trait ... LL | fn method<G: Getter<usize>>(&self) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `G: Getter<usize>` + | ^^^^^^^^^^^^^ impl has extra requirement `G: Getter<usize>` error: aborting due to 7 previous errors diff --git a/src/test/ui/compare-method/traits-misc-mismatch-2.stderr b/src/test/ui/compare-method/traits-misc-mismatch-2.stderr index acf94ad32b1..36bb764d40e 100644 --- a/src/test/ui/compare-method/traits-misc-mismatch-2.stderr +++ b/src/test/ui/compare-method/traits-misc-mismatch-2.stderr @@ -1,11 +1,11 @@ error[E0276]: impl has stricter requirements than trait - --> $DIR/traits-misc-mismatch-2.rs:13:5 + --> $DIR/traits-misc-mismatch-2.rs:13:18 | LL | fn zip<B, U: Iterator<U>>(self, other: U) -> ZipIterator<Self, U>; | ------------------------------------------------------------------ definition of `zip` from trait ... LL | fn zip<B, U: Iterator<B>>(self, other: U) -> ZipIterator<T, U> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `U: Iterator<B>` + | ^^^^^^^^^^^ impl has extra requirement `U: Iterator<B>` error: aborting due to previous error diff --git a/src/test/ui/const-generics/defaults/wfness.stderr b/src/test/ui/const-generics/defaults/wfness.stderr index 9826af8802a..2d400f9bbf5 100644 --- a/src/test/ui/const-generics/defaults/wfness.stderr +++ b/src/test/ui/const-generics/defaults/wfness.stderr @@ -12,11 +12,6 @@ LL | struct WhereClause<const N: u8 = 2> where (): Trait<N>; | = help: the following implementations were found: <() as Trait<3_u8>> -note: required by `WhereClause` - --> $DIR/wfness.rs:8:1 - | -LL | struct WhereClause<const N: u8 = 2> where (): Trait<N>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the trait bound `(): Trait<1_u8>` is not satisfied --> $DIR/wfness.rs:16:13 diff --git a/src/test/ui/const-generics/dont-evaluate-array-len-on-err-1.stderr b/src/test/ui/const-generics/dont-evaluate-array-len-on-err-1.stderr index 09986f623fc..68ce61bd4a3 100644 --- a/src/test/ui/const-generics/dont-evaluate-array-len-on-err-1.stderr +++ b/src/test/ui/const-generics/dont-evaluate-array-len-on-err-1.stderr @@ -3,12 +3,6 @@ error[E0277]: the trait bound `[Adt; _]: Foo` is not satisfied | LL | <[Adt; std::mem::size_of::<Self::Assoc>()] as Foo>::bar() | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `[Adt; _]` - | -note: required by `Foo::bar` - --> $DIR/dont-evaluate-array-len-on-err-1.rs:19:5 - | -LL | fn bar() {} - | ^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/const-generics/exhaustive-value.stderr b/src/test/ui/const-generics/exhaustive-value.stderr index 0c6aced4bc2..1a8f4abf52a 100644 --- a/src/test/ui/const-generics/exhaustive-value.stderr +++ b/src/test/ui/const-generics/exhaustive-value.stderr @@ -10,11 +10,6 @@ LL | <() as Foo<N>>::test() <() as Foo<101_u8>> <() as Foo<102_u8>> and 252 others -note: required by `Foo::test` - --> $DIR/exhaustive-value.rs:2:5 - | -LL | fn test() {} - | ^^^^^^^^^ 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/derive-assoc-type-not-impl.stderr b/src/test/ui/derives/derive-assoc-type-not-impl.stderr index 1080f947732..45a906a3947 100644 --- a/src/test/ui/derives/derive-assoc-type-not-impl.stderr +++ b/src/test/ui/derives/derive-assoc-type-not-impl.stderr @@ -13,12 +13,16 @@ LL | struct NotClone; LL | Bar::<NotClone> { x: 1 }.clone(); | ^^^^^ method cannot be called on `Bar<NotClone>` due to unsatisfied trait bounds | - = note: the following trait bounds were not satisfied: - `NotClone: Clone` - which is required by `Bar<NotClone>: Clone` +note: the following trait bounds were not satisfied because of the requirements of the implementation of `Clone` for `_`: + `NotClone: Clone` + --> $DIR/derive-assoc-type-not-impl.rs:6:10 + | +LL | #[derive(Clone)] + | ^^^^^ = help: items from traits can only be used if the trait is implemented and in scope = note: the following trait defines an item `clone`, perhaps you need to implement it: candidate #1: `Clone` + = note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider annotating `NotClone` with `#[derive(Clone)]` | LL | #[derive(Clone)] diff --git a/src/test/ui/derives/derives-span-Clone-enum-struct-variant.stderr b/src/test/ui/derives/derives-span-Clone-enum-struct-variant.stderr index c5bc50e407b..cc874576cb7 100644 --- a/src/test/ui/derives/derives-span-Clone-enum-struct-variant.stderr +++ b/src/test/ui/derives/derives-span-Clone-enum-struct-variant.stderr @@ -7,11 +7,6 @@ LL | #[derive(Clone)] LL | x: Error | ^^^^^^^^ the trait `Clone` is not implemented for `Error` | -note: required by `clone` - --> $SRC_DIR/core/src/clone.rs:LL:COL - | -LL | fn clone(&self) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the derive macro `Clone` (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-Clone-enum.stderr b/src/test/ui/derives/derives-span-Clone-enum.stderr index a6dc818eb6f..a4870635de8 100644 --- a/src/test/ui/derives/derives-span-Clone-enum.stderr +++ b/src/test/ui/derives/derives-span-Clone-enum.stderr @@ -7,11 +7,6 @@ LL | #[derive(Clone)] LL | Error | ^^^^^ the trait `Clone` is not implemented for `Error` | -note: required by `clone` - --> $SRC_DIR/core/src/clone.rs:LL:COL - | -LL | fn clone(&self) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the derive macro `Clone` (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-Clone-struct.stderr b/src/test/ui/derives/derives-span-Clone-struct.stderr index cf7b9ec276e..4507eeccc3a 100644 --- a/src/test/ui/derives/derives-span-Clone-struct.stderr +++ b/src/test/ui/derives/derives-span-Clone-struct.stderr @@ -7,11 +7,6 @@ LL | struct Struct { LL | x: Error | ^^^^^^^^ the trait `Clone` is not implemented for `Error` | -note: required by `clone` - --> $SRC_DIR/core/src/clone.rs:LL:COL - | -LL | fn clone(&self) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the derive macro `Clone` (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-Clone-tuple-struct.stderr b/src/test/ui/derives/derives-span-Clone-tuple-struct.stderr index 80733d62730..a79be7f574d 100644 --- a/src/test/ui/derives/derives-span-Clone-tuple-struct.stderr +++ b/src/test/ui/derives/derives-span-Clone-tuple-struct.stderr @@ -7,11 +7,6 @@ LL | struct Struct( LL | Error | ^^^^^ the trait `Clone` is not implemented for `Error` | -note: required by `clone` - --> $SRC_DIR/core/src/clone.rs:LL:COL - | -LL | fn clone(&self) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the derive macro `Clone` (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-Default-struct.stderr b/src/test/ui/derives/derives-span-Default-struct.stderr index c60b6ac456e..dd2cfaf89bb 100644 --- a/src/test/ui/derives/derives-span-Default-struct.stderr +++ b/src/test/ui/derives/derives-span-Default-struct.stderr @@ -7,11 +7,6 @@ LL | struct Struct { LL | x: Error | ^^^^^^^^ the trait `Default` is not implemented for `Error` | -note: required by `std::default::Default::default` - --> $SRC_DIR/core/src/default.rs:LL:COL - | -LL | fn default() -> Self; - | ^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the derive macro `Default` (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-Default-tuple-struct.stderr b/src/test/ui/derives/derives-span-Default-tuple-struct.stderr index ed342f539da..0674d635d3d 100644 --- a/src/test/ui/derives/derives-span-Default-tuple-struct.stderr +++ b/src/test/ui/derives/derives-span-Default-tuple-struct.stderr @@ -7,11 +7,6 @@ LL | struct Struct( LL | Error | ^^^^^ the trait `Default` is not implemented for `Error` | -note: required by `std::default::Default::default` - --> $SRC_DIR/core/src/default.rs:LL:COL - | -LL | fn default() -> Self; - | ^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the derive macro `Default` (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-struct-variant.stderr b/src/test/ui/derives/derives-span-Hash-enum-struct-variant.stderr index 47c7f1c2c33..7f24be959f0 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,6 @@ LL | #[derive(Hash)] LL | x: Error | ^^^^^^^^ the trait `Hash` is not implemented for `Error` | -note: required by a bound in `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..ae2921a16b3 100644 --- a/src/test/ui/derives/derives-span-Hash-enum.stderr +++ b/src/test/ui/derives/derives-span-Hash-enum.stderr @@ -7,11 +7,6 @@ LL | #[derive(Hash)] LL | Error | ^^^^^ the trait `Hash` is not implemented for `Error` | -note: required by a bound in `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..37b3af702a0 100644 --- a/src/test/ui/derives/derives-span-Hash-struct.stderr +++ b/src/test/ui/derives/derives-span-Hash-struct.stderr @@ -7,11 +7,6 @@ LL | struct Struct { LL | x: Error | ^^^^^^^^ the trait `Hash` is not implemented for `Error` | -note: required by a bound in `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..18624667d25 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,6 @@ LL | struct Struct( LL | Error | ^^^^^ the trait `Hash` is not implemented for `Error` | -note: required by a bound in `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-Ord-enum-struct-variant.stderr b/src/test/ui/derives/derives-span-Ord-enum-struct-variant.stderr index 1e1cd715e64..b52c5a0d6a5 100644 --- a/src/test/ui/derives/derives-span-Ord-enum-struct-variant.stderr +++ b/src/test/ui/derives/derives-span-Ord-enum-struct-variant.stderr @@ -7,11 +7,6 @@ LL | #[derive(Ord,Eq,PartialOrd,PartialEq)] LL | x: Error | ^^^^^^^^ the trait `Ord` is not implemented for `Error` | -note: required by `std::cmp::Ord::cmp` - --> $SRC_DIR/core/src/cmp.rs:LL:COL - | -LL | fn cmp(&self, other: &Self) -> Ordering; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the derive macro `Ord` (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-Ord-enum.stderr b/src/test/ui/derives/derives-span-Ord-enum.stderr index 43abe9a9547..2ea0496ea0d 100644 --- a/src/test/ui/derives/derives-span-Ord-enum.stderr +++ b/src/test/ui/derives/derives-span-Ord-enum.stderr @@ -7,11 +7,6 @@ LL | #[derive(Ord,Eq,PartialOrd,PartialEq)] LL | Error | ^^^^^ the trait `Ord` is not implemented for `Error` | -note: required by `std::cmp::Ord::cmp` - --> $SRC_DIR/core/src/cmp.rs:LL:COL - | -LL | fn cmp(&self, other: &Self) -> Ordering; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the derive macro `Ord` (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-Ord-struct.stderr b/src/test/ui/derives/derives-span-Ord-struct.stderr index 44f6bab08c1..52cf0cf8cd7 100644 --- a/src/test/ui/derives/derives-span-Ord-struct.stderr +++ b/src/test/ui/derives/derives-span-Ord-struct.stderr @@ -7,11 +7,6 @@ LL | struct Struct { LL | x: Error | ^^^^^^^^ the trait `Ord` is not implemented for `Error` | -note: required by `std::cmp::Ord::cmp` - --> $SRC_DIR/core/src/cmp.rs:LL:COL - | -LL | fn cmp(&self, other: &Self) -> Ordering; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the derive macro `Ord` (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-Ord-tuple-struct.stderr b/src/test/ui/derives/derives-span-Ord-tuple-struct.stderr index e604018245a..ecdf8d8cb59 100644 --- a/src/test/ui/derives/derives-span-Ord-tuple-struct.stderr +++ b/src/test/ui/derives/derives-span-Ord-tuple-struct.stderr @@ -7,11 +7,6 @@ LL | struct Struct( LL | Error | ^^^^^ the trait `Ord` is not implemented for `Error` | -note: required by `std::cmp::Ord::cmp` - --> $SRC_DIR/core/src/cmp.rs:LL:COL - | -LL | fn cmp(&self, other: &Self) -> Ordering; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the derive macro `Ord` (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-PartialOrd-enum-struct-variant.stderr b/src/test/ui/derives/derives-span-PartialOrd-enum-struct-variant.stderr index 9a716048e26..fc8eb1ebfd3 100644 --- a/src/test/ui/derives/derives-span-PartialOrd-enum-struct-variant.stderr +++ b/src/test/ui/derives/derives-span-PartialOrd-enum-struct-variant.stderr @@ -8,11 +8,6 @@ LL | x: Error | ^^^^^^^^ no implementation for `Error < Error` and `Error > Error` | = help: the trait `PartialOrd` is not implemented for `Error` -note: required by `std::cmp::PartialOrd::partial_cmp` - --> $SRC_DIR/core/src/cmp.rs:LL:COL - | -LL | fn partial_cmp(&self, other: &Rhs) -> Option<Ordering>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the derive macro `PartialOrd` (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-PartialOrd-enum.stderr b/src/test/ui/derives/derives-span-PartialOrd-enum.stderr index c726d33eab0..38053495a05 100644 --- a/src/test/ui/derives/derives-span-PartialOrd-enum.stderr +++ b/src/test/ui/derives/derives-span-PartialOrd-enum.stderr @@ -8,11 +8,6 @@ LL | Error | ^^^^^ no implementation for `Error < Error` and `Error > Error` | = help: the trait `PartialOrd` is not implemented for `Error` -note: required by `std::cmp::PartialOrd::partial_cmp` - --> $SRC_DIR/core/src/cmp.rs:LL:COL - | -LL | fn partial_cmp(&self, other: &Rhs) -> Option<Ordering>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the derive macro `PartialOrd` (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-PartialOrd-struct.stderr b/src/test/ui/derives/derives-span-PartialOrd-struct.stderr index a56c163ca78..1c07b98f983 100644 --- a/src/test/ui/derives/derives-span-PartialOrd-struct.stderr +++ b/src/test/ui/derives/derives-span-PartialOrd-struct.stderr @@ -8,11 +8,6 @@ LL | x: Error | ^^^^^^^^ no implementation for `Error < Error` and `Error > Error` | = help: the trait `PartialOrd` is not implemented for `Error` -note: required by `std::cmp::PartialOrd::partial_cmp` - --> $SRC_DIR/core/src/cmp.rs:LL:COL - | -LL | fn partial_cmp(&self, other: &Rhs) -> Option<Ordering>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the derive macro `PartialOrd` (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-PartialOrd-tuple-struct.stderr b/src/test/ui/derives/derives-span-PartialOrd-tuple-struct.stderr index 7a0a52e5824..bf01252b07b 100644 --- a/src/test/ui/derives/derives-span-PartialOrd-tuple-struct.stderr +++ b/src/test/ui/derives/derives-span-PartialOrd-tuple-struct.stderr @@ -8,11 +8,6 @@ LL | Error | ^^^^^ no implementation for `Error < Error` and `Error > Error` | = help: the trait `PartialOrd` is not implemented for `Error` -note: required by `std::cmp::PartialOrd::partial_cmp` - --> $SRC_DIR/core/src/cmp.rs:LL:COL - | -LL | fn partial_cmp(&self, other: &Rhs) -> Option<Ordering>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/derives/deriving-no-inner-impl-error-message.stderr b/src/test/ui/derives/deriving-no-inner-impl-error-message.stderr index e322db97fab..d64b4509b26 100644 --- a/src/test/ui/derives/deriving-no-inner-impl-error-message.stderr +++ b/src/test/ui/derives/deriving-no-inner-impl-error-message.stderr @@ -47,11 +47,6 @@ LL | struct C { LL | x: NoCloneOrEq | ^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `NoCloneOrEq` | -note: required by `clone` - --> $SRC_DIR/core/src/clone.rs:LL:COL - | -LL | fn clone(&self) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 3 previous errors diff --git a/src/test/ui/did_you_mean/issue-39802-show-5-trait-impls.stderr b/src/test/ui/did_you_mean/issue-39802-show-5-trait-impls.stderr index c7458916c53..5381a717dc3 100644 --- a/src/test/ui/did_you_mean/issue-39802-show-5-trait-impls.stderr +++ b/src/test/ui/did_you_mean/issue-39802-show-5-trait-impls.stderr @@ -12,11 +12,6 @@ LL | Foo::<i32>::bar(&1i8); <i8 as Foo<u32>> <i8 as Foo<u64>> <i8 as Foo<u8>> -note: required by `Foo::bar` - --> $DIR/issue-39802-show-5-trait-impls.rs:2:5 - | -LL | fn bar(&self){} - | ^^^^^^^^^^^^^ error[E0277]: the trait bound `u8: Foo<i32>` is not satisfied --> $DIR/issue-39802-show-5-trait-impls.rs:25:21 @@ -31,11 +26,6 @@ LL | Foo::<i32>::bar(&1u8); <u8 as Foo<u16>> <u8 as Foo<u32>> <u8 as Foo<u64>> -note: required by `Foo::bar` - --> $DIR/issue-39802-show-5-trait-impls.rs:2:5 - | -LL | fn bar(&self){} - | ^^^^^^^^^^^^^ error[E0277]: the trait bound `bool: Foo<i32>` is not satisfied --> $DIR/issue-39802-show-5-trait-impls.rs:26:21 @@ -51,11 +41,6 @@ LL | Foo::<i32>::bar(&true); <bool as Foo<u16>> <bool as Foo<u32>> and 2 others -note: required by `Foo::bar` - --> $DIR/issue-39802-show-5-trait-impls.rs:2:5 - | -LL | fn bar(&self){} - | ^^^^^^^^^^^^^ error: aborting due to 3 previous errors 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/E0276.stderr b/src/test/ui/error-codes/E0276.stderr index 8857e1646ee..1013f041bbe 100644 --- a/src/test/ui/error-codes/E0276.stderr +++ b/src/test/ui/error-codes/E0276.stderr @@ -1,11 +1,11 @@ error[E0276]: impl has stricter requirements than trait - --> $DIR/E0276.rs:6:5 + --> $DIR/E0276.rs:6:30 | LL | fn foo<T>(x: T); | ---------------- definition of `foo` from trait ... LL | fn foo<T>(x: T) where T: Copy {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: Copy` + | ^^^^ impl has extra requirement `T: Copy` 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..7dcfe96b35c 100644 --- a/src/test/ui/error-codes/E0283.stderr +++ b/src/test/ui/error-codes/E0283.stderr @@ -5,11 +5,6 @@ LL | let cont: u32 = Generator::create(); | ^^^^^^^^^^^^^^^^^ cannot infer type | = note: cannot satisfy `_: Generator` -note: required by `Generator::create` - --> $DIR/E0283.rs:2:5 - | -LL | fn create() -> u32; - | ^^^^^^^^^^^^^^^^^^^ error[E0283]: type annotations needed --> $DIR/E0283.rs:35:24 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/fmt/ifmt-unimpl.stderr b/src/test/ui/fmt/ifmt-unimpl.stderr index 0a68c24b606..bee165437cb 100644 --- a/src/test/ui/fmt/ifmt-unimpl.stderr +++ b/src/test/ui/fmt/ifmt-unimpl.stderr @@ -5,11 +5,6 @@ LL | format!("{:X}", "3"); | ^^^ the trait `UpperHex` is not implemented for `str` | = note: required because of the requirements on the impl of `UpperHex` for `&str` -note: required by `std::fmt::UpperHex::fmt` - --> $SRC_DIR/core/src/fmt/mod.rs:LL:COL - | -LL | fn fmt(&self, f: &mut Formatter<'_>) -> Result; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the macro `$crate::__export::format_args` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/for/for-c-in-str.rs b/src/test/ui/for/for-c-in-str.rs index 97a4ea53af5..86a1c1a34e9 100644 --- a/src/test/ui/for/for-c-in-str.rs +++ b/src/test/ui/for/for-c-in-str.rs @@ -6,8 +6,6 @@ fn main() { //~| NOTE `&str` is not an iterator //~| HELP the trait `Iterator` is not implemented for `&str` //~| NOTE required because of the requirements on the impl of `IntoIterator` for `&str` - //~| NOTE required by `into_iter` - //~| NOTE in this expansion of desugaring of `for` loop //~| NOTE in this expansion of desugaring of `for` loop //~| NOTE in this expansion of desugaring of `for` loop //~| NOTE in this expansion of desugaring of `for` loop diff --git a/src/test/ui/for/for-c-in-str.stderr b/src/test/ui/for/for-c-in-str.stderr index 7eac8c9c5a8..07ddc8ea78f 100644 --- a/src/test/ui/for/for-c-in-str.stderr +++ b/src/test/ui/for/for-c-in-str.stderr @@ -6,11 +6,6 @@ LL | for c in "asdf" { | = help: the trait `Iterator` is not implemented for `&str` = note: required because of the requirements on the impl of `IntoIterator` for `&str` -note: required by `into_iter` - --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/for/for-loop-bogosity.stderr b/src/test/ui/for/for-loop-bogosity.stderr index 288243325c4..0bdd75b3555 100644 --- a/src/test/ui/for/for-loop-bogosity.stderr +++ b/src/test/ui/for/for-loop-bogosity.stderr @@ -6,11 +6,6 @@ LL | for x in bogus { | = help: the trait `Iterator` is not implemented for `MyStruct` = note: required because of the requirements on the impl of `IntoIterator` for `MyStruct` -note: required by `into_iter` - --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/generator/yield-outside-generator-issue-78653.stderr b/src/test/ui/generator/yield-outside-generator-issue-78653.stderr index dff743bc35b..ee1afbe5b58 100644 --- a/src/test/ui/generator/yield-outside-generator-issue-78653.stderr +++ b/src/test/ui/generator/yield-outside-generator-issue-78653.stderr @@ -13,11 +13,6 @@ LL | yield || for i in 0 { } = help: the trait `Iterator` is not implemented for `{integer}` = note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end` = note: required because of the requirements on the impl of `IntoIterator` for `{integer}` -note: required by `into_iter` - --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/generic-associated-types/impl_bounds.stderr b/src/test/ui/generic-associated-types/impl_bounds.stderr index f47b5f81e25..1c8a1f09af5 100644 --- a/src/test/ui/generic-associated-types/impl_bounds.stderr +++ b/src/test/ui/generic-associated-types/impl_bounds.stderr @@ -59,10 +59,10 @@ LL | impl<T: std::marker::Copy> Foo for Fooy<T> { | +++++++++++++++++++ error[E0277]: the trait bound `T: Copy` is not satisfied - --> $DIR/impl_bounds.rs:22:5 + --> $DIR/impl_bounds.rs:22:24 | LL | fn d() where Self: Copy {} - | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `T` + | ^^^^ the trait `Copy` is not implemented for `T` | note: required because of the requirements on the impl of `Copy` for `Fooy<T>` --> $DIR/impl_bounds.rs:11:10 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/generic-associated-types/method-unsatified-assoc-type-predicate.rs b/src/test/ui/generic-associated-types/method-unsatified-assoc-type-predicate.rs index 6db249221b8..8b6f7c41a7c 100644 --- a/src/test/ui/generic-associated-types/method-unsatified-assoc-type-predicate.rs +++ b/src/test/ui/generic-associated-types/method-unsatified-assoc-type-predicate.rs @@ -12,6 +12,7 @@ trait M { } impl<T: X<Y<i32> = i32>> M for T {} +//~^ NOTE the following trait bounds were not satisfied struct S; //~^ NOTE method `f` not found for this @@ -26,7 +27,6 @@ fn f(a: S) { a.f(); //~^ ERROR the method `f` exists for struct `S`, but its trait bounds were not satisfied //~| NOTE method cannot be called on `S` due to unsatisfied trait bounds - //~| NOTE the following trait bounds were not satisfied: } fn main() {} diff --git a/src/test/ui/generic-associated-types/method-unsatified-assoc-type-predicate.stderr b/src/test/ui/generic-associated-types/method-unsatified-assoc-type-predicate.stderr index 8af9fbed872..3eeb9540e73 100644 --- a/src/test/ui/generic-associated-types/method-unsatified-assoc-type-predicate.stderr +++ b/src/test/ui/generic-associated-types/method-unsatified-assoc-type-predicate.stderr @@ -1,5 +1,5 @@ error[E0599]: the method `f` exists for struct `S`, but its trait bounds were not satisfied - --> $DIR/method-unsatified-assoc-type-predicate.rs:26:7 + --> $DIR/method-unsatified-assoc-type-predicate.rs:27:7 | LL | struct S; | --------- @@ -11,9 +11,12 @@ LL | struct S; LL | a.f(); | ^ method cannot be called on `S` due to unsatisfied trait bounds | - = note: the following trait bounds were not satisfied: - `<S as X>::Y<i32> = i32` - which is required by `S: M` +note: the following trait bounds were not satisfied because of the requirements of the implementation of `M` for `_`: + `<S as X>::Y<i32> = i32` + --> $DIR/method-unsatified-assoc-type-predicate.rs:14:26 + | +LL | impl<T: X<Y<i32> = i32>> M for T {} + | ^ ^ error: aborting due to previous error diff --git a/src/test/ui/hrtb/issue-30786.migrate.stderr b/src/test/ui/hrtb/issue-30786.migrate.stderr index a769872d83a..a497c6257da 100644 --- a/src/test/ui/hrtb/issue-30786.migrate.stderr +++ b/src/test/ui/hrtb/issue-30786.migrate.stderr @@ -10,13 +10,14 @@ LL | pub struct Map<S, F> { LL | let filter = map.filterx(|x: &_| true); | ^^^^^^^ method cannot be called on `Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>` due to unsatisfied trait bounds | - = note: the following trait bounds were not satisfied: - `&'a mut Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>: Stream` - which is required by `Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>: StreamExt` - `&'a mut &Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>: Stream` - which is required by `&Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>: StreamExt` - `&'a mut &mut Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>: Stream` - which is required by `&mut Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>: StreamExt` +note: the following trait bounds were not satisfied because of the requirements of the implementation of `StreamExt` for `_`: + `&'a mut Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>: Stream` + `&'a mut &Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>: Stream` + `&'a mut &mut Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>: Stream` + --> $DIR/issue-30786.rs:106:9 + | +LL | impl<T> StreamExt for T where for<'a> &'a mut T: Stream {} + | ^^^^^^^^^ ^ error[E0599]: the method `countx` exists for struct `Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>`, but its trait bounds were not satisfied --> $DIR/issue-30786.rs:141:24 @@ -30,13 +31,14 @@ LL | pub struct Filter<S, F> { LL | let count = filter.countx(); | ^^^^^^ method cannot be called on `Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>` due to unsatisfied trait bounds | - = note: the following trait bounds were not satisfied: - `&'a mut Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>: Stream` - which is required by `Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>: StreamExt` - `&'a mut &Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>: Stream` - which is required by `&Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>: StreamExt` - `&'a mut &mut Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>: Stream` - which is required by `&mut Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>: StreamExt` +note: the following trait bounds were not satisfied because of the requirements of the implementation of `StreamExt` for `_`: + `&'a mut Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>: Stream` + `&'a mut &Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>: Stream` + `&'a mut &mut Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>: Stream` + --> $DIR/issue-30786.rs:106:9 + | +LL | impl<T> StreamExt for T where for<'a> &'a mut T: Stream {} + | ^^^^^^^^^ ^ error: aborting due to 2 previous errors diff --git a/src/test/ui/hrtb/issue-30786.nll.stderr b/src/test/ui/hrtb/issue-30786.nll.stderr index a769872d83a..a497c6257da 100644 --- a/src/test/ui/hrtb/issue-30786.nll.stderr +++ b/src/test/ui/hrtb/issue-30786.nll.stderr @@ -10,13 +10,14 @@ LL | pub struct Map<S, F> { LL | let filter = map.filterx(|x: &_| true); | ^^^^^^^ method cannot be called on `Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>` due to unsatisfied trait bounds | - = note: the following trait bounds were not satisfied: - `&'a mut Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>: Stream` - which is required by `Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>: StreamExt` - `&'a mut &Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>: Stream` - which is required by `&Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>: StreamExt` - `&'a mut &mut Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>: Stream` - which is required by `&mut Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>: StreamExt` +note: the following trait bounds were not satisfied because of the requirements of the implementation of `StreamExt` for `_`: + `&'a mut Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>: Stream` + `&'a mut &Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>: Stream` + `&'a mut &mut Map<Repeat, [closure@$DIR/issue-30786.rs:127:27: 127:36]>: Stream` + --> $DIR/issue-30786.rs:106:9 + | +LL | impl<T> StreamExt for T where for<'a> &'a mut T: Stream {} + | ^^^^^^^^^ ^ error[E0599]: the method `countx` exists for struct `Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>`, but its trait bounds were not satisfied --> $DIR/issue-30786.rs:141:24 @@ -30,13 +31,14 @@ LL | pub struct Filter<S, F> { LL | let count = filter.countx(); | ^^^^^^ method cannot be called on `Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>` due to unsatisfied trait bounds | - = note: the following trait bounds were not satisfied: - `&'a mut Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>: Stream` - which is required by `Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>: StreamExt` - `&'a mut &Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>: Stream` - which is required by `&Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>: StreamExt` - `&'a mut &mut Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>: Stream` - which is required by `&mut Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>: StreamExt` +note: the following trait bounds were not satisfied because of the requirements of the implementation of `StreamExt` for `_`: + `&'a mut Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>: Stream` + `&'a mut &Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>: Stream` + `&'a mut &mut Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:140:30: 140:42]>: Stream` + --> $DIR/issue-30786.rs:106:9 + | +LL | impl<T> StreamExt for T where for<'a> &'a mut T: Stream {} + | ^^^^^^^^^ ^ error: aborting due to 2 previous errors 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/impl-trait/issue-55872-1.stderr b/src/test/ui/impl-trait/issue-55872-1.stderr index e772445a56c..2d1142fd0c5 100644 --- a/src/test/ui/impl-trait/issue-55872-1.stderr +++ b/src/test/ui/impl-trait/issue-55872-1.stderr @@ -1,11 +1,11 @@ error[E0276]: impl has stricter requirements than trait - --> $DIR/issue-55872-1.rs:12:5 + --> $DIR/issue-55872-1.rs:12:15 | LL | fn foo<T>() -> Self::E; | ----------------------- definition of `foo` from trait ... LL | fn foo<T: Default>() -> Self::E { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: Default` + | ^^^^^^^ impl has extra requirement `T: Default` error[E0277]: the trait bound `S: Copy` is not satisfied in `(S, T)` --> $DIR/issue-55872-1.rs:12:29 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-14853.stderr b/src/test/ui/issues/issue-14853.stderr index 6fc10550492..2adcf55eca9 100644 --- a/src/test/ui/issues/issue-14853.stderr +++ b/src/test/ui/issues/issue-14853.stderr @@ -1,11 +1,11 @@ error[E0276]: impl has stricter requirements than trait - --> $DIR/issue-14853.rs:12:5 + --> $DIR/issue-14853.rs:12:15 | LL | fn yay<T: Debug>(_: Option<Self>, thing: &[T]); | ----------------------------------------------- definition of `yay` from trait ... LL | fn yay<T: Str>(_:Option<X>, thing: &[T]) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: Str` + | ^^^ impl has extra requirement `T: Str` 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-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-18937.rs b/src/test/ui/issues/issue-18937.rs index ab4c9c736d8..af85e5b2b02 100644 --- a/src/test/ui/issues/issue-18937.rs +++ b/src/test/ui/issues/issue-18937.rs @@ -16,8 +16,8 @@ trait A<'a> { } impl<'a> A<'a> for B { - fn foo<F>(&mut self, f: F) //~ ERROR impl has stricter - where F: fmt::Debug + 'static, + fn foo<F>(&mut self, f: F) + where F: fmt::Debug + 'static, //~ ERROR impl has stricter { self.list.push(Box::new(f)); } diff --git a/src/test/ui/issues/issue-18937.stderr b/src/test/ui/issues/issue-18937.stderr index ac302caecc3..5e2ba0ef4fc 100644 --- a/src/test/ui/issues/issue-18937.stderr +++ b/src/test/ui/issues/issue-18937.stderr @@ -1,17 +1,13 @@ error[E0276]: impl has stricter requirements than trait - --> $DIR/issue-18937.rs:19:5 + --> $DIR/issue-18937.rs:20:31 | LL | / fn foo<F>(&mut self, f: F) LL | | where F: fmt::Debug + 'a, LL | | Self: Sized; | |__________________________- definition of `foo` from trait ... -LL | / fn foo<F>(&mut self, f: F) -LL | | where F: fmt::Debug + 'static, -LL | | { -LL | | self.list.push(Box::new(f)); -LL | | } - | |_____^ impl has extra requirement `F: 'static` +LL | where F: fmt::Debug + 'static, + | ^^^^^^^ impl has extra requirement `F: 'static` 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-20605.stderr b/src/test/ui/issues/issue-20605.stderr index 5a67aead75a..41eefe3f8e9 100644 --- a/src/test/ui/issues/issue-20605.stderr +++ b/src/test/ui/issues/issue-20605.stderr @@ -6,11 +6,6 @@ LL | for item in *things { *item = 0 } | = note: the trait bound `dyn Iterator<Item = &'a mut u8>: IntoIterator` is not satisfied = note: required because of the requirements on the impl of `IntoIterator` for `dyn Iterator<Item = &'a mut u8>` -note: required by `into_iter` - --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider mutably borrowing here | LL | for item in &mut *things { *item = 0 } diff --git a/src/test/ui/issues/issue-21160.stderr b/src/test/ui/issues/issue-21160.stderr index 92742b50619..300c1272ef6 100644 --- a/src/test/ui/issues/issue-21160.stderr +++ b/src/test/ui/issues/issue-21160.stderr @@ -6,11 +6,6 @@ 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` - --> $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-28098.stderr b/src/test/ui/issues/issue-28098.stderr index 6a74f4ed489..3beb9929244 100644 --- a/src/test/ui/issues/issue-28098.stderr +++ b/src/test/ui/issues/issue-28098.stderr @@ -7,11 +7,6 @@ LL | let _ = Iterator::next(&mut ()); | required by a bound introduced by this call | = help: the trait `Iterator` is not implemented for `()` -note: required by `std::iter::Iterator::next` - --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | fn next(&mut self) -> Option<Self::Item>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: `bool` is not an iterator --> $DIR/issue-28098.rs:6:14 @@ -21,11 +16,6 @@ LL | for _ in false {} | = help: the trait `Iterator` is not implemented for `bool` = note: required because of the requirements on the impl of `IntoIterator` for `bool` -note: required by `into_iter` - --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: `()` is not an iterator --> $DIR/issue-28098.rs:9:28 @@ -36,11 +26,6 @@ LL | let _ = Iterator::next(&mut ()); | required by a bound introduced by this call | = help: the trait `Iterator` is not implemented for `()` -note: required by `std::iter::Iterator::next` - --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | fn next(&mut self) -> Option<Self::Item>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: `()` is not an iterator --> $DIR/issue-28098.rs:2:13 @@ -59,11 +44,6 @@ LL | let _ = Iterator::next(&mut ()); | required by a bound introduced by this call | = help: the trait `Iterator` is not implemented for `()` -note: required by `std::iter::Iterator::next` - --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | fn next(&mut self) -> Option<Self::Item>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: `()` is not an iterator --> $DIR/issue-28098.rs:22:28 @@ -74,11 +54,6 @@ LL | let _ = Iterator::next(&mut ()); | required by a bound introduced by this call | = help: the trait `Iterator` is not implemented for `()` -note: required by `std::iter::Iterator::next` - --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | fn next(&mut self) -> Option<Self::Item>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: `bool` is not an iterator --> $DIR/issue-28098.rs:25:14 @@ -88,11 +63,6 @@ LL | for _ in false {} | = help: the trait `Iterator` is not implemented for `bool` = note: required because of the requirements on the impl of `IntoIterator` for `bool` -note: required by `into_iter` - --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: `()` is not an iterator --> $DIR/issue-28098.rs:18:13 diff --git a/src/test/ui/issues/issue-29147.stderr b/src/test/ui/issues/issue-29147.stderr index 3b011f58b25..5570e887edc 100644 --- a/src/test/ui/issues/issue-29147.stderr +++ b/src/test/ui/issues/issue-29147.stderr @@ -11,11 +11,6 @@ LL | impl Foo for S5<u32> { fn xxx(&self) {} } | ^^^^^^^^^^^^^^^^^^^^ LL | impl Foo for S5<u64> { fn xxx(&self) {} } | ^^^^^^^^^^^^^^^^^^^^ -note: required by `Foo::xxx` - --> $DIR/issue-29147.rs:10:13 - | -LL | trait Foo { fn xxx(&self); } - | ^^^^^^^^^^^^^^ 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-32709.stderr b/src/test/ui/issues/issue-32709.stderr index bc7eb0688ee..b4c3f148e32 100644 --- a/src/test/ui/issues/issue-32709.stderr +++ b/src/test/ui/issues/issue-32709.stderr @@ -8,11 +8,6 @@ LL | Err(5)?; | = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait = note: required because of the requirements on the impl of `FromResidual<Result<Infallible, {integer}>>` for `Result<i32, ()>` -note: required by `from_residual` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn from_residual(residual: R) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/issues/issue-33941.stderr b/src/test/ui/issues/issue-33941.stderr index d588214f507..e7263148205 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 @@ -17,11 +22,6 @@ LL | for _ in HashMap::new().iter().cloned() {} found tuple `(&_, &_)` = note: required because of the requirements on the impl of `Iterator` for `Cloned<std::collections::hash_map::Iter<'_, _, _>>` = note: required because of the requirements on the impl of `IntoIterator` for `Cloned<std::collections::hash_map::Iter<'_, _, _>>` -note: required by `into_iter` - --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0271]: type mismatch resolving `<std::collections::hash_map::Iter<'_, _, _> as Iterator>::Item == &_` --> $DIR/issue-33941.rs:4:14 @@ -32,11 +32,6 @@ LL | for _ in HashMap::new().iter().cloned() {} = note: expected reference `&_` found tuple `(&_, &_)` = note: required because of the requirements on the impl of `Iterator` for `Cloned<std::collections::hash_map::Iter<'_, _, _>>` -note: required by `std::iter::Iterator::next` - --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL - | -LL | fn next(&mut self) -> Option<Self::Item>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 3 previous errors diff --git a/src/test/ui/issues/issue-34229.stderr b/src/test/ui/issues/issue-34229.stderr index fba75de8cc0..71e02f2fd86 100644 --- a/src/test/ui/issues/issue-34229.stderr +++ b/src/test/ui/issues/issue-34229.stderr @@ -7,11 +7,6 @@ LL | #[derive(PartialEq, PartialOrd)] struct Nope(Comparable); | in this derive macro expansion | = help: the trait `PartialOrd` is not implemented for `Comparable` -note: required by `std::cmp::PartialOrd::partial_cmp` - --> $SRC_DIR/core/src/cmp.rs:LL:COL - | -LL | fn partial_cmp(&self, other: &Rhs) -> Option<Ordering>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the derive macro `PartialOrd` (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-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-39970.stderr b/src/test/ui/issues/issue-39970.stderr index f609e47e818..ffcac1f4705 100644 --- a/src/test/ui/issues/issue-39970.stderr +++ b/src/test/ui/issues/issue-39970.stderr @@ -9,11 +9,6 @@ note: required because of the requirements on the impl of `Visit` for `()` | LL | impl Visit for () where | ^^^^^ ^^ -note: required by `Visit::visit` - --> $DIR/issue-39970.rs:6:5 - | -LL | fn visit() {} - | ^^^^^^^^^^ error: aborting due to previous error 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..efe2ef504a2 100644 --- a/src/test/ui/issues/issue-54954.stderr +++ b/src/test/ui/issues/issue-54954.stderr @@ -11,11 +11,6 @@ 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 - | -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-58022.stderr b/src/test/ui/issues/issue-58022.stderr index a1715bd99e0..0128b70e216 100644 --- a/src/test/ui/issues/issue-58022.stderr +++ b/src/test/ui/issues/issue-58022.stderr @@ -15,11 +15,6 @@ LL | fn new(slice: &[u8; Foo::SIZE]) -> Self; | = note: cannot satisfy `_: Foo` = note: associated constants cannot be accessed directly on a `trait`, they can only be accessed through a specific `impl` -note: required by `Foo::SIZE` - --> $DIR/issue-58022.rs:2:5 - | -LL | const SIZE: usize; - | ^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-66353.stderr b/src/test/ui/issues/issue-66353.stderr index 282e236d3d0..3356180974f 100644 --- a/src/test/ui/issues/issue-66353.stderr +++ b/src/test/ui/issues/issue-66353.stderr @@ -11,12 +11,6 @@ LL | _Func::< <() as _A>::AssocT >::func(()); | ----------------------------------- ^^ the trait `_Func<_>` is not implemented for `()` | | | required by a bound introduced by this call - | -note: required by `_Func::func` - --> $DIR/issue-66353.rs:4:5 - | -LL | fn func(_: Self); - | ^^^^^^^^^^^^^^^^^ 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-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..629ccea2577 100644 --- a/src/test/ui/issues/issue-72690.stderr +++ b/src/test/ui/issues/issue-72690.stderr @@ -7,11 +7,6 @@ LL | String::from("x".as_ref()); = note: multiple `impl`s satisfying `String: From<&_>` found in the `alloc` crate: - impl<> From<&String> for String; - impl<> From<&str> for String; -note: required by `from` - --> $SRC_DIR/core/src/convert/mod.rs:LL:COL - | -LL | fn from(_: T) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^ error[E0283]: type annotations needed --> $DIR/issue-72690.rs:7:22 @@ -43,11 +38,6 @@ LL | |x| String::from("x".as_ref()); = note: multiple `impl`s satisfying `String: From<&_>` found in the `alloc` crate: - impl<> From<&String> for String; - impl<> From<&str> for String; -note: required by `from` - --> $SRC_DIR/core/src/convert/mod.rs:LL:COL - | -LL | fn from(_: T) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^ error[E0283]: type annotations needed --> $DIR/issue-72690.rs:12:26 @@ -87,11 +77,6 @@ LL | String::from("x".as_ref()); = note: multiple `impl`s satisfying `String: From<&_>` found in the `alloc` crate: - impl<> From<&String> for String; - impl<> From<&str> for String; -note: required by `from` - --> $SRC_DIR/core/src/convert/mod.rs:LL:COL - | -LL | fn from(_: T) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^ error[E0283]: type annotations needed --> $DIR/issue-72690.rs:22:22 @@ -117,11 +102,6 @@ LL | String::from("x".as_ref()); = note: multiple `impl`s satisfying `String: From<&_>` found in the `alloc` crate: - impl<> From<&String> for String; - impl<> From<&str> for String; -note: required by `from` - --> $SRC_DIR/core/src/convert/mod.rs:LL:COL - | -LL | fn from(_: T) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^ error[E0283]: type annotations needed --> $DIR/issue-72690.rs:29:22 @@ -147,11 +127,6 @@ LL | String::from("x".as_ref()); = note: multiple `impl`s satisfying `String: From<&_>` found in the `alloc` crate: - impl<> From<&String> for String; - impl<> From<&str> for String; -note: required by `from` - --> $SRC_DIR/core/src/convert/mod.rs:LL:COL - | -LL | fn from(_: T) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^ error[E0283]: type annotations needed --> $DIR/issue-72690.rs:38:22 @@ -177,11 +152,6 @@ LL | String::from("x".as_ref()); = note: multiple `impl`s satisfying `String: From<&_>` found in the `alloc` crate: - impl<> From<&String> for String; - impl<> From<&str> for String; -note: required by `from` - --> $SRC_DIR/core/src/convert/mod.rs:LL:COL - | -LL | fn from(_: T) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^ error[E0283]: type annotations needed --> $DIR/issue-72690.rs:47:22 @@ -207,11 +177,6 @@ LL | String::from("x".as_ref()); = note: multiple `impl`s satisfying `String: From<&_>` found in the `alloc` crate: - impl<> From<&String> for String; - impl<> From<&str> for String; -note: required by `from` - --> $SRC_DIR/core/src/convert/mod.rs:LL:COL - | -LL | fn from(_: T) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^ error[E0283]: type annotations needed --> $DIR/issue-72690.rs:54:22 @@ -237,11 +202,6 @@ LL | String::from("x".as_ref()); = note: multiple `impl`s satisfying `String: From<&_>` found in the `alloc` crate: - impl<> From<&String> for String; - impl<> From<&str> for String; -note: required by `from` - --> $SRC_DIR/core/src/convert/mod.rs:LL:COL - | -LL | fn from(_: T) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^ error[E0283]: type annotations needed --> $DIR/issue-72690.rs:63:22 diff --git a/src/test/ui/iterators/integral.stderr b/src/test/ui/iterators/integral.stderr index 60b2cbfdf45..5e2744bab95 100644 --- a/src/test/ui/iterators/integral.stderr +++ b/src/test/ui/iterators/integral.stderr @@ -7,11 +7,6 @@ LL | for _ in 42 {} = help: the trait `Iterator` is not implemented for `{integer}` = note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end` = note: required because of the requirements on the impl of `IntoIterator` for `{integer}` -note: required by `into_iter` - --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: `u8` is not an iterator --> $DIR/integral.rs:4:14 @@ -22,11 +17,6 @@ LL | for _ in 42 as u8 {} = help: the trait `Iterator` is not implemented for `u8` = note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end` = note: required because of the requirements on the impl of `IntoIterator` for `u8` -note: required by `into_iter` - --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: `i8` is not an iterator --> $DIR/integral.rs:6:14 @@ -37,11 +27,6 @@ LL | for _ in 42 as i8 {} = help: the trait `Iterator` is not implemented for `i8` = note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end` = note: required because of the requirements on the impl of `IntoIterator` for `i8` -note: required by `into_iter` - --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: `u16` is not an iterator --> $DIR/integral.rs:8:14 @@ -52,11 +37,6 @@ LL | for _ in 42 as u16 {} = help: the trait `Iterator` is not implemented for `u16` = note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end` = note: required because of the requirements on the impl of `IntoIterator` for `u16` -note: required by `into_iter` - --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: `i16` is not an iterator --> $DIR/integral.rs:10:14 @@ -67,11 +47,6 @@ LL | for _ in 42 as i16 {} = help: the trait `Iterator` is not implemented for `i16` = note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end` = note: required because of the requirements on the impl of `IntoIterator` for `i16` -note: required by `into_iter` - --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: `u32` is not an iterator --> $DIR/integral.rs:12:14 @@ -82,11 +57,6 @@ LL | for _ in 42 as u32 {} = help: the trait `Iterator` is not implemented for `u32` = note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end` = note: required because of the requirements on the impl of `IntoIterator` for `u32` -note: required by `into_iter` - --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: `i32` is not an iterator --> $DIR/integral.rs:14:14 @@ -97,11 +67,6 @@ LL | for _ in 42 as i32 {} = help: the trait `Iterator` is not implemented for `i32` = note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end` = note: required because of the requirements on the impl of `IntoIterator` for `i32` -note: required by `into_iter` - --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: `u64` is not an iterator --> $DIR/integral.rs:16:14 @@ -112,11 +77,6 @@ LL | for _ in 42 as u64 {} = help: the trait `Iterator` is not implemented for `u64` = note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end` = note: required because of the requirements on the impl of `IntoIterator` for `u64` -note: required by `into_iter` - --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: `i64` is not an iterator --> $DIR/integral.rs:18:14 @@ -127,11 +87,6 @@ LL | for _ in 42 as i64 {} = help: the trait `Iterator` is not implemented for `i64` = note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end` = note: required because of the requirements on the impl of `IntoIterator` for `i64` -note: required by `into_iter` - --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: `usize` is not an iterator --> $DIR/integral.rs:20:14 @@ -142,11 +97,6 @@ LL | for _ in 42 as usize {} = help: the trait `Iterator` is not implemented for `usize` = note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end` = note: required because of the requirements on the impl of `IntoIterator` for `usize` -note: required by `into_iter` - --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: `isize` is not an iterator --> $DIR/integral.rs:22:14 @@ -157,11 +107,6 @@ LL | for _ in 42 as isize {} = help: the trait `Iterator` is not implemented for `isize` = note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end` = note: required because of the requirements on the impl of `IntoIterator` for `isize` -note: required by `into_iter` - --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: `{float}` is not an iterator --> $DIR/integral.rs:24:14 @@ -171,11 +116,6 @@ LL | for _ in 42.0 {} | = help: the trait `Iterator` is not implemented for `{float}` = note: required because of the requirements on the impl of `IntoIterator` for `{float}` -note: required by `into_iter` - --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 12 previous errors diff --git a/src/test/ui/iterators/ranges.stderr b/src/test/ui/iterators/ranges.stderr index fdc33862c0a..440a8960a4c 100644 --- a/src/test/ui/iterators/ranges.stderr +++ b/src/test/ui/iterators/ranges.stderr @@ -7,11 +7,6 @@ LL | for _ in ..10 {} = help: the trait `Iterator` is not implemented for `RangeTo<{integer}>` = note: `..end` is a `RangeTo`, which cannot be iterated on; you might have meant to have a bounded `Range`: `0..end` = note: required because of the requirements on the impl of `IntoIterator` for `RangeTo<{integer}>` -note: required by `into_iter` - --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: `RangeToInclusive<{integer}>` is not an iterator --> $DIR/ranges.rs:4:14 @@ -22,11 +17,6 @@ LL | for _ in ..=10 {} = help: the trait `Iterator` is not implemented for `RangeToInclusive<{integer}>` = note: `..=end` is a `RangeToInclusive`, which cannot be iterated on; you might have meant to have a bounded `RangeInclusive`: `0..=end` = note: required because of the requirements on the impl of `IntoIterator` for `RangeToInclusive<{integer}>` -note: required by `into_iter` - --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/iterators/string.stderr b/src/test/ui/iterators/string.stderr index f7089be2772..d9c40fe1ba6 100644 --- a/src/test/ui/iterators/string.stderr +++ b/src/test/ui/iterators/string.stderr @@ -6,11 +6,6 @@ LL | for _ in "".to_owned() {} | = help: the trait `Iterator` is not implemented for `String` = note: required because of the requirements on the impl of `IntoIterator` for `String` -note: required by `into_iter` - --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: `&str` is not an iterator --> $DIR/string.rs:4:14 @@ -20,11 +15,6 @@ LL | for _ in "" {} | = help: the trait `Iterator` is not implemented for `&str` = note: required because of the requirements on the impl of `IntoIterator` for `&str` -note: required by `into_iter` - --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/layout/debug.stderr b/src/test/ui/layout/debug.stderr index 1a371c6b170..418f780d62c 100644 --- a/src/test/ui/layout/debug.stderr +++ b/src/test/ui/layout/debug.stderr @@ -1,345 +1,345 @@ error: layout_of(E) = Layout { - fields: Arbitrary { - offsets: [ - Size { - raw: 0, - }, - ], - memory_index: [ - 0, - ], - }, - variants: Multiple { - tag: Scalar { - value: Int( - I32, - false, - ), - valid_range: 0..=0, - }, - tag_encoding: Direct, - tag_field: 0, - variants: [ - Layout { - fields: Arbitrary { - offsets: [], - memory_index: [], - }, - variants: Single { - index: 0, - }, - abi: Aggregate { - sized: true, - }, - largest_niche: None, - align: AbiAndPrefAlign { - abi: Align { - pow2: 0, - }, - pref: $PREF_ALIGN, - }, - size: Size { - raw: 4, - }, - }, - Layout { - fields: Arbitrary { - offsets: [ - Size { - raw: 4, - }, - Size { - raw: 4, - }, - Size { - raw: 8, - }, - ], - memory_index: [ - 0, - 1, - 2, - ], - }, - variants: Single { - index: 1, - }, - abi: Uninhabited, - largest_niche: None, - align: AbiAndPrefAlign { - abi: Align { - pow2: 2, - }, - pref: $PREF_ALIGN, - }, - size: Size { - raw: 12, - }, - }, - ], - }, - abi: Aggregate { - sized: true, - }, - largest_niche: Some( - Niche { - offset: Size { - raw: 0, - }, - scalar: Scalar { - value: Int( - I32, - false, - ), - valid_range: 0..=0, - }, - }, - ), - align: AbiAndPrefAlign { - abi: Align { - pow2: 2, - }, - pref: $PREF_ALIGN, - }, - size: Size { - raw: 12, - }, -} + fields: Arbitrary { + offsets: [ + Size { + raw: 0, + }, + ], + memory_index: [ + 0, + ], + }, + variants: Multiple { + tag: Scalar { + value: Int( + I32, + false, + ), + valid_range: 0..=0, + }, + tag_encoding: Direct, + tag_field: 0, + variants: [ + Layout { + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + variants: Single { + index: 0, + }, + abi: Aggregate { + sized: true, + }, + largest_niche: None, + align: AbiAndPrefAlign { + abi: Align { + pow2: 0, + }, + pref: $PREF_ALIGN, + }, + size: Size { + raw: 4, + }, + }, + Layout { + fields: Arbitrary { + offsets: [ + Size { + raw: 4, + }, + Size { + raw: 4, + }, + Size { + raw: 8, + }, + ], + memory_index: [ + 0, + 1, + 2, + ], + }, + variants: Single { + index: 1, + }, + abi: Uninhabited, + largest_niche: None, + align: AbiAndPrefAlign { + abi: Align { + pow2: 2, + }, + pref: $PREF_ALIGN, + }, + size: Size { + raw: 12, + }, + }, + ], + }, + abi: Aggregate { + sized: true, + }, + largest_niche: Some( + Niche { + offset: Size { + raw: 0, + }, + scalar: Scalar { + value: Int( + I32, + false, + ), + valid_range: 0..=0, + }, + }, + ), + align: AbiAndPrefAlign { + abi: Align { + pow2: 2, + }, + pref: $PREF_ALIGN, + }, + size: Size { + raw: 12, + }, + } --> $DIR/debug.rs:6:1 | LL | enum E { Foo, Bar(!, i32, i32) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: layout_of(S) = Layout { - fields: Arbitrary { - offsets: [ - Size { - raw: 0, - }, - Size { - raw: 0, - }, - Size { - raw: 4, - }, - ], - memory_index: [ - 1, - 0, - 2, - ], - }, - variants: Single { - index: 0, - }, - abi: ScalarPair( - Scalar { - value: Int( - I32, - true, - ), - valid_range: 0..=4294967295, - }, - Scalar { - value: Int( - I32, - true, - ), - valid_range: 0..=4294967295, - }, - ), - largest_niche: None, - align: AbiAndPrefAlign { - abi: Align { - pow2: 2, - }, - pref: $PREF_ALIGN, - }, - size: Size { - raw: 8, - }, -} + fields: Arbitrary { + offsets: [ + Size { + raw: 0, + }, + Size { + raw: 0, + }, + Size { + raw: 4, + }, + ], + memory_index: [ + 1, + 0, + 2, + ], + }, + variants: Single { + index: 0, + }, + abi: ScalarPair( + Scalar { + value: Int( + I32, + true, + ), + valid_range: 0..=4294967295, + }, + Scalar { + value: Int( + I32, + true, + ), + valid_range: 0..=4294967295, + }, + ), + largest_niche: None, + align: AbiAndPrefAlign { + abi: Align { + pow2: 2, + }, + pref: $PREF_ALIGN, + }, + size: Size { + raw: 8, + }, + } --> $DIR/debug.rs:9:1 | LL | struct S { f1: i32, f2: (), f3: i32 } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: layout_of(U) = Layout { - fields: Union( - 2, - ), - variants: Single { - index: 0, - }, - abi: Aggregate { - sized: true, - }, - largest_niche: None, - align: AbiAndPrefAlign { - abi: Align { - pow2: 2, - }, - pref: $PREF_ALIGN, - }, - size: Size { - raw: 8, - }, -} + fields: Union( + 2, + ), + variants: Single { + index: 0, + }, + abi: Aggregate { + sized: true, + }, + largest_niche: None, + align: AbiAndPrefAlign { + abi: Align { + pow2: 2, + }, + pref: $PREF_ALIGN, + }, + size: Size { + raw: 8, + }, + } --> $DIR/debug.rs:12:1 | LL | union U { f1: (i32, i32), f3: i32 } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: layout_of(std::result::Result<i32, i32>) = Layout { - fields: Arbitrary { - offsets: [ - Size { - raw: 0, - }, - ], - memory_index: [ - 0, - ], - }, - variants: Multiple { - tag: Scalar { - value: Int( - I32, - false, - ), - valid_range: 0..=1, - }, - tag_encoding: Direct, - tag_field: 0, - variants: [ - Layout { - fields: Arbitrary { - offsets: [ - Size { - raw: 4, - }, - ], - memory_index: [ - 0, - ], - }, - variants: Single { - index: 0, - }, - abi: Aggregate { - sized: true, - }, - largest_niche: None, - align: AbiAndPrefAlign { - abi: Align { - pow2: 2, - }, - pref: $PREF_ALIGN, - }, - size: Size { - raw: 8, - }, - }, - Layout { - fields: Arbitrary { - offsets: [ - Size { - raw: 4, - }, - ], - memory_index: [ - 0, - ], - }, - variants: Single { - index: 1, - }, - abi: Aggregate { - sized: true, - }, - largest_niche: None, - align: AbiAndPrefAlign { - abi: Align { - pow2: 2, - }, - pref: $PREF_ALIGN, - }, - size: Size { - raw: 8, - }, - }, - ], - }, - abi: ScalarPair( - Scalar { - value: Int( - I32, - false, - ), - valid_range: 0..=1, - }, - Scalar { - value: Int( - I32, - true, - ), - valid_range: 0..=4294967295, - }, - ), - largest_niche: Some( - Niche { - offset: Size { - raw: 0, - }, - scalar: Scalar { - value: Int( - I32, - false, - ), - valid_range: 0..=1, - }, - }, - ), - align: AbiAndPrefAlign { - abi: Align { - pow2: 2, - }, - pref: $PREF_ALIGN, - }, - size: Size { - raw: 8, - }, -} + fields: Arbitrary { + offsets: [ + Size { + raw: 0, + }, + ], + memory_index: [ + 0, + ], + }, + variants: Multiple { + tag: Scalar { + value: Int( + I32, + false, + ), + valid_range: 0..=1, + }, + tag_encoding: Direct, + tag_field: 0, + variants: [ + Layout { + fields: Arbitrary { + offsets: [ + Size { + raw: 4, + }, + ], + memory_index: [ + 0, + ], + }, + variants: Single { + index: 0, + }, + abi: Aggregate { + sized: true, + }, + largest_niche: None, + align: AbiAndPrefAlign { + abi: Align { + pow2: 2, + }, + pref: $PREF_ALIGN, + }, + size: Size { + raw: 8, + }, + }, + Layout { + fields: Arbitrary { + offsets: [ + Size { + raw: 4, + }, + ], + memory_index: [ + 0, + ], + }, + variants: Single { + index: 1, + }, + abi: Aggregate { + sized: true, + }, + largest_niche: None, + align: AbiAndPrefAlign { + abi: Align { + pow2: 2, + }, + pref: $PREF_ALIGN, + }, + size: Size { + raw: 8, + }, + }, + ], + }, + abi: ScalarPair( + Scalar { + value: Int( + I32, + false, + ), + valid_range: 0..=1, + }, + Scalar { + value: Int( + I32, + true, + ), + valid_range: 0..=4294967295, + }, + ), + largest_niche: Some( + Niche { + offset: Size { + raw: 0, + }, + scalar: Scalar { + value: Int( + I32, + false, + ), + valid_range: 0..=1, + }, + }, + ), + align: AbiAndPrefAlign { + abi: Align { + pow2: 2, + }, + pref: $PREF_ALIGN, + }, + size: Size { + raw: 8, + }, + } --> $DIR/debug.rs:15:1 | LL | type Test = Result<i32, i32>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: layout_of(i32) = Layout { - fields: Primitive, - variants: Single { - index: 0, - }, - abi: Scalar( - Scalar { - value: Int( - I32, - true, - ), - valid_range: 0..=4294967295, - }, - ), - largest_niche: None, - align: AbiAndPrefAlign { - abi: Align { - pow2: 2, - }, - pref: $PREF_ALIGN, - }, - size: Size { - raw: 4, - }, -} + fields: Primitive, + variants: Single { + index: 0, + }, + abi: Scalar( + Scalar { + value: Int( + I32, + true, + ), + valid_range: 0..=4294967295, + }, + ), + largest_niche: None, + align: AbiAndPrefAlign { + abi: Align { + pow2: 2, + }, + pref: $PREF_ALIGN, + }, + size: Size { + raw: 4, + }, + } --> $DIR/debug.rs:18:1 | LL | type T = impl std::fmt::Debug; diff --git a/src/test/ui/layout/hexagon-enum.stderr b/src/test/ui/layout/hexagon-enum.stderr index d4676a5afb2..39b23cb4b57 100644 --- a/src/test/ui/layout/hexagon-enum.stderr +++ b/src/test/ui/layout/hexagon-enum.stderr @@ -1,438 +1,438 @@ error: layout_of(A) = Layout { - fields: Arbitrary { - offsets: [ - Size { - raw: 0, - }, - ], - memory_index: [ - 0, - ], - }, - variants: Multiple { - tag: Scalar { - value: Int( - I8, - false, - ), - valid_range: 0..=0, - }, - tag_encoding: Direct, - tag_field: 0, - variants: [ - Layout { - fields: Arbitrary { - offsets: [], - memory_index: [], - }, - variants: Single { - index: 0, - }, - abi: Aggregate { - sized: true, - }, - largest_niche: None, - align: AbiAndPrefAlign { - abi: Align { - pow2: 0, - }, - pref: Align { - pow2: 0, - }, - }, - size: Size { - raw: 1, - }, - }, - ], - }, - abi: Scalar( - Scalar { - value: Int( - I8, - false, - ), - valid_range: 0..=0, - }, - ), - largest_niche: Some( - Niche { - offset: Size { - raw: 0, - }, - scalar: Scalar { - value: Int( - I8, - false, - ), - valid_range: 0..=0, - }, - }, - ), - align: AbiAndPrefAlign { - abi: Align { - pow2: 0, - }, - pref: Align { - pow2: 0, - }, - }, - size: Size { - raw: 1, - }, -} + fields: Arbitrary { + offsets: [ + Size { + raw: 0, + }, + ], + memory_index: [ + 0, + ], + }, + variants: Multiple { + tag: Scalar { + value: Int( + I8, + false, + ), + valid_range: 0..=0, + }, + tag_encoding: Direct, + tag_field: 0, + variants: [ + Layout { + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + variants: Single { + index: 0, + }, + abi: Aggregate { + sized: true, + }, + largest_niche: None, + align: AbiAndPrefAlign { + abi: Align { + pow2: 0, + }, + pref: Align { + pow2: 0, + }, + }, + size: Size { + raw: 1, + }, + }, + ], + }, + abi: Scalar( + Scalar { + value: Int( + I8, + false, + ), + valid_range: 0..=0, + }, + ), + largest_niche: Some( + Niche { + offset: Size { + raw: 0, + }, + scalar: Scalar { + value: Int( + I8, + false, + ), + valid_range: 0..=0, + }, + }, + ), + align: AbiAndPrefAlign { + abi: Align { + pow2: 0, + }, + pref: Align { + pow2: 0, + }, + }, + size: Size { + raw: 1, + }, + } --> $DIR/hexagon-enum.rs:16:1 | LL | enum A { Apple } | ^^^^^^^^^^^^^^^^ error: layout_of(B) = Layout { - fields: Arbitrary { - offsets: [ - Size { - raw: 0, - }, - ], - memory_index: [ - 0, - ], - }, - variants: Multiple { - tag: Scalar { - value: Int( - I8, - false, - ), - valid_range: 255..=255, - }, - tag_encoding: Direct, - tag_field: 0, - variants: [ - Layout { - fields: Arbitrary { - offsets: [], - memory_index: [], - }, - variants: Single { - index: 0, - }, - abi: Aggregate { - sized: true, - }, - largest_niche: None, - align: AbiAndPrefAlign { - abi: Align { - pow2: 0, - }, - pref: Align { - pow2: 0, - }, - }, - size: Size { - raw: 1, - }, - }, - ], - }, - abi: Scalar( - Scalar { - value: Int( - I8, - false, - ), - valid_range: 255..=255, - }, - ), - largest_niche: Some( - Niche { - offset: Size { - raw: 0, - }, - scalar: Scalar { - value: Int( - I8, - false, - ), - valid_range: 255..=255, - }, - }, - ), - align: AbiAndPrefAlign { - abi: Align { - pow2: 0, - }, - pref: Align { - pow2: 0, - }, - }, - size: Size { - raw: 1, - }, -} + fields: Arbitrary { + offsets: [ + Size { + raw: 0, + }, + ], + memory_index: [ + 0, + ], + }, + variants: Multiple { + tag: Scalar { + value: Int( + I8, + false, + ), + valid_range: 255..=255, + }, + tag_encoding: Direct, + tag_field: 0, + variants: [ + Layout { + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + variants: Single { + index: 0, + }, + abi: Aggregate { + sized: true, + }, + largest_niche: None, + align: AbiAndPrefAlign { + abi: Align { + pow2: 0, + }, + pref: Align { + pow2: 0, + }, + }, + size: Size { + raw: 1, + }, + }, + ], + }, + abi: Scalar( + Scalar { + value: Int( + I8, + false, + ), + valid_range: 255..=255, + }, + ), + largest_niche: Some( + Niche { + offset: Size { + raw: 0, + }, + scalar: Scalar { + value: Int( + I8, + false, + ), + valid_range: 255..=255, + }, + }, + ), + align: AbiAndPrefAlign { + abi: Align { + pow2: 0, + }, + pref: Align { + pow2: 0, + }, + }, + size: Size { + raw: 1, + }, + } --> $DIR/hexagon-enum.rs:20:1 | LL | enum B { Banana = 255, } | ^^^^^^^^^^^^^^^^^^^^^^^^ error: layout_of(C) = Layout { - fields: Arbitrary { - offsets: [ - Size { - raw: 0, - }, - ], - memory_index: [ - 0, - ], - }, - variants: Multiple { - tag: Scalar { - value: Int( - I16, - false, - ), - valid_range: 256..=256, - }, - tag_encoding: Direct, - tag_field: 0, - variants: [ - Layout { - fields: Arbitrary { - offsets: [], - memory_index: [], - }, - variants: Single { - index: 0, - }, - abi: Aggregate { - sized: true, - }, - largest_niche: None, - align: AbiAndPrefAlign { - abi: Align { - pow2: 1, - }, - pref: Align { - pow2: 1, - }, - }, - size: Size { - raw: 2, - }, - }, - ], - }, - abi: Scalar( - Scalar { - value: Int( - I16, - false, - ), - valid_range: 256..=256, - }, - ), - largest_niche: Some( - Niche { - offset: Size { - raw: 0, - }, - scalar: Scalar { - value: Int( - I16, - false, - ), - valid_range: 256..=256, - }, - }, - ), - align: AbiAndPrefAlign { - abi: Align { - pow2: 1, - }, - pref: Align { - pow2: 1, - }, - }, - size: Size { - raw: 2, - }, -} + fields: Arbitrary { + offsets: [ + Size { + raw: 0, + }, + ], + memory_index: [ + 0, + ], + }, + variants: Multiple { + tag: Scalar { + value: Int( + I16, + false, + ), + valid_range: 256..=256, + }, + tag_encoding: Direct, + tag_field: 0, + variants: [ + Layout { + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + variants: Single { + index: 0, + }, + abi: Aggregate { + sized: true, + }, + largest_niche: None, + align: AbiAndPrefAlign { + abi: Align { + pow2: 1, + }, + pref: Align { + pow2: 1, + }, + }, + size: Size { + raw: 2, + }, + }, + ], + }, + abi: Scalar( + Scalar { + value: Int( + I16, + false, + ), + valid_range: 256..=256, + }, + ), + largest_niche: Some( + Niche { + offset: Size { + raw: 0, + }, + scalar: Scalar { + value: Int( + I16, + false, + ), + valid_range: 256..=256, + }, + }, + ), + align: AbiAndPrefAlign { + abi: Align { + pow2: 1, + }, + pref: Align { + pow2: 1, + }, + }, + size: Size { + raw: 2, + }, + } --> $DIR/hexagon-enum.rs:24:1 | LL | enum C { Chaenomeles = 256, } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: layout_of(P) = Layout { - fields: Arbitrary { - offsets: [ - Size { - raw: 0, - }, - ], - memory_index: [ - 0, - ], - }, - variants: Multiple { - tag: Scalar { - value: Int( - I32, - false, - ), - valid_range: 268435456..=268435456, - }, - tag_encoding: Direct, - tag_field: 0, - variants: [ - Layout { - fields: Arbitrary { - offsets: [], - memory_index: [], - }, - variants: Single { - index: 0, - }, - abi: Aggregate { - sized: true, - }, - largest_niche: None, - align: AbiAndPrefAlign { - abi: Align { - pow2: 2, - }, - pref: Align { - pow2: 2, - }, - }, - size: Size { - raw: 4, - }, - }, - ], - }, - abi: Scalar( - Scalar { - value: Int( - I32, - false, - ), - valid_range: 268435456..=268435456, - }, - ), - largest_niche: Some( - Niche { - offset: Size { - raw: 0, - }, - scalar: Scalar { - value: Int( - I32, - false, - ), - valid_range: 268435456..=268435456, - }, - }, - ), - align: AbiAndPrefAlign { - abi: Align { - pow2: 2, - }, - pref: Align { - pow2: 2, - }, - }, - size: Size { - raw: 4, - }, -} + fields: Arbitrary { + offsets: [ + Size { + raw: 0, + }, + ], + memory_index: [ + 0, + ], + }, + variants: Multiple { + tag: Scalar { + value: Int( + I32, + false, + ), + valid_range: 268435456..=268435456, + }, + tag_encoding: Direct, + tag_field: 0, + variants: [ + Layout { + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + variants: Single { + index: 0, + }, + abi: Aggregate { + sized: true, + }, + largest_niche: None, + align: AbiAndPrefAlign { + abi: Align { + pow2: 2, + }, + pref: Align { + pow2: 2, + }, + }, + size: Size { + raw: 4, + }, + }, + ], + }, + abi: Scalar( + Scalar { + value: Int( + I32, + false, + ), + valid_range: 268435456..=268435456, + }, + ), + largest_niche: Some( + Niche { + offset: Size { + raw: 0, + }, + scalar: Scalar { + value: Int( + I32, + false, + ), + valid_range: 268435456..=268435456, + }, + }, + ), + align: AbiAndPrefAlign { + abi: Align { + pow2: 2, + }, + pref: Align { + pow2: 2, + }, + }, + size: Size { + raw: 4, + }, + } --> $DIR/hexagon-enum.rs:28:1 | LL | enum P { Peach = 0x1000_0000isize, } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: layout_of(T) = Layout { - fields: Arbitrary { - offsets: [ - Size { - raw: 0, - }, - ], - memory_index: [ - 0, - ], - }, - variants: Multiple { - tag: Scalar { - value: Int( - I32, - true, - ), - valid_range: 2164260864..=2164260864, - }, - tag_encoding: Direct, - tag_field: 0, - variants: [ - Layout { - fields: Arbitrary { - offsets: [], - memory_index: [], - }, - variants: Single { - index: 0, - }, - abi: Aggregate { - sized: true, - }, - largest_niche: None, - align: AbiAndPrefAlign { - abi: Align { - pow2: 2, - }, - pref: Align { - pow2: 2, - }, - }, - size: Size { - raw: 4, - }, - }, - ], - }, - abi: Scalar( - Scalar { - value: Int( - I32, - true, - ), - valid_range: 2164260864..=2164260864, - }, - ), - largest_niche: Some( - Niche { - offset: Size { - raw: 0, - }, - scalar: Scalar { - value: Int( - I32, - true, - ), - valid_range: 2164260864..=2164260864, - }, - }, - ), - align: AbiAndPrefAlign { - abi: Align { - pow2: 2, - }, - pref: Align { - pow2: 2, - }, - }, - size: Size { - raw: 4, - }, -} + fields: Arbitrary { + offsets: [ + Size { + raw: 0, + }, + ], + memory_index: [ + 0, + ], + }, + variants: Multiple { + tag: Scalar { + value: Int( + I32, + true, + ), + valid_range: 2164260864..=2164260864, + }, + tag_encoding: Direct, + tag_field: 0, + variants: [ + Layout { + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + variants: Single { + index: 0, + }, + abi: Aggregate { + sized: true, + }, + largest_niche: None, + align: AbiAndPrefAlign { + abi: Align { + pow2: 2, + }, + pref: Align { + pow2: 2, + }, + }, + size: Size { + raw: 4, + }, + }, + ], + }, + abi: Scalar( + Scalar { + value: Int( + I32, + true, + ), + valid_range: 2164260864..=2164260864, + }, + ), + largest_niche: Some( + Niche { + offset: Size { + raw: 0, + }, + scalar: Scalar { + value: Int( + I32, + true, + ), + valid_range: 2164260864..=2164260864, + }, + }, + ), + align: AbiAndPrefAlign { + abi: Align { + pow2: 2, + }, + pref: Align { + pow2: 2, + }, + }, + size: Size { + raw: 4, + }, + } --> $DIR/hexagon-enum.rs:34:1 | LL | enum T { Tangerine = TANGERINE as isize } diff --git a/src/test/ui/layout/thumb-enum.stderr b/src/test/ui/layout/thumb-enum.stderr index 898a61b904d..144ab02792e 100644 --- a/src/test/ui/layout/thumb-enum.stderr +++ b/src/test/ui/layout/thumb-enum.stderr @@ -1,438 +1,438 @@ error: layout_of(A) = Layout { - fields: Arbitrary { - offsets: [ - Size { - raw: 0, - }, - ], - memory_index: [ - 0, - ], - }, - variants: Multiple { - tag: Scalar { - value: Int( - I8, - false, - ), - valid_range: 0..=0, - }, - tag_encoding: Direct, - tag_field: 0, - variants: [ - Layout { - fields: Arbitrary { - offsets: [], - memory_index: [], - }, - variants: Single { - index: 0, - }, - abi: Aggregate { - sized: true, - }, - largest_niche: None, - align: AbiAndPrefAlign { - abi: Align { - pow2: 0, - }, - pref: Align { - pow2: 2, - }, - }, - size: Size { - raw: 1, - }, - }, - ], - }, - abi: Scalar( - Scalar { - value: Int( - I8, - false, - ), - valid_range: 0..=0, - }, - ), - largest_niche: Some( - Niche { - offset: Size { - raw: 0, - }, - scalar: Scalar { - value: Int( - I8, - false, - ), - valid_range: 0..=0, - }, - }, - ), - align: AbiAndPrefAlign { - abi: Align { - pow2: 0, - }, - pref: Align { - pow2: 2, - }, - }, - size: Size { - raw: 1, - }, -} + fields: Arbitrary { + offsets: [ + Size { + raw: 0, + }, + ], + memory_index: [ + 0, + ], + }, + variants: Multiple { + tag: Scalar { + value: Int( + I8, + false, + ), + valid_range: 0..=0, + }, + tag_encoding: Direct, + tag_field: 0, + variants: [ + Layout { + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + variants: Single { + index: 0, + }, + abi: Aggregate { + sized: true, + }, + largest_niche: None, + align: AbiAndPrefAlign { + abi: Align { + pow2: 0, + }, + pref: Align { + pow2: 2, + }, + }, + size: Size { + raw: 1, + }, + }, + ], + }, + abi: Scalar( + Scalar { + value: Int( + I8, + false, + ), + valid_range: 0..=0, + }, + ), + largest_niche: Some( + Niche { + offset: Size { + raw: 0, + }, + scalar: Scalar { + value: Int( + I8, + false, + ), + valid_range: 0..=0, + }, + }, + ), + align: AbiAndPrefAlign { + abi: Align { + pow2: 0, + }, + pref: Align { + pow2: 2, + }, + }, + size: Size { + raw: 1, + }, + } --> $DIR/thumb-enum.rs:16:1 | LL | enum A { Apple } | ^^^^^^^^^^^^^^^^ error: layout_of(B) = Layout { - fields: Arbitrary { - offsets: [ - Size { - raw: 0, - }, - ], - memory_index: [ - 0, - ], - }, - variants: Multiple { - tag: Scalar { - value: Int( - I8, - false, - ), - valid_range: 255..=255, - }, - tag_encoding: Direct, - tag_field: 0, - variants: [ - Layout { - fields: Arbitrary { - offsets: [], - memory_index: [], - }, - variants: Single { - index: 0, - }, - abi: Aggregate { - sized: true, - }, - largest_niche: None, - align: AbiAndPrefAlign { - abi: Align { - pow2: 0, - }, - pref: Align { - pow2: 2, - }, - }, - size: Size { - raw: 1, - }, - }, - ], - }, - abi: Scalar( - Scalar { - value: Int( - I8, - false, - ), - valid_range: 255..=255, - }, - ), - largest_niche: Some( - Niche { - offset: Size { - raw: 0, - }, - scalar: Scalar { - value: Int( - I8, - false, - ), - valid_range: 255..=255, - }, - }, - ), - align: AbiAndPrefAlign { - abi: Align { - pow2: 0, - }, - pref: Align { - pow2: 2, - }, - }, - size: Size { - raw: 1, - }, -} + fields: Arbitrary { + offsets: [ + Size { + raw: 0, + }, + ], + memory_index: [ + 0, + ], + }, + variants: Multiple { + tag: Scalar { + value: Int( + I8, + false, + ), + valid_range: 255..=255, + }, + tag_encoding: Direct, + tag_field: 0, + variants: [ + Layout { + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + variants: Single { + index: 0, + }, + abi: Aggregate { + sized: true, + }, + largest_niche: None, + align: AbiAndPrefAlign { + abi: Align { + pow2: 0, + }, + pref: Align { + pow2: 2, + }, + }, + size: Size { + raw: 1, + }, + }, + ], + }, + abi: Scalar( + Scalar { + value: Int( + I8, + false, + ), + valid_range: 255..=255, + }, + ), + largest_niche: Some( + Niche { + offset: Size { + raw: 0, + }, + scalar: Scalar { + value: Int( + I8, + false, + ), + valid_range: 255..=255, + }, + }, + ), + align: AbiAndPrefAlign { + abi: Align { + pow2: 0, + }, + pref: Align { + pow2: 2, + }, + }, + size: Size { + raw: 1, + }, + } --> $DIR/thumb-enum.rs:20:1 | LL | enum B { Banana = 255, } | ^^^^^^^^^^^^^^^^^^^^^^^^ error: layout_of(C) = Layout { - fields: Arbitrary { - offsets: [ - Size { - raw: 0, - }, - ], - memory_index: [ - 0, - ], - }, - variants: Multiple { - tag: Scalar { - value: Int( - I16, - false, - ), - valid_range: 256..=256, - }, - tag_encoding: Direct, - tag_field: 0, - variants: [ - Layout { - fields: Arbitrary { - offsets: [], - memory_index: [], - }, - variants: Single { - index: 0, - }, - abi: Aggregate { - sized: true, - }, - largest_niche: None, - align: AbiAndPrefAlign { - abi: Align { - pow2: 1, - }, - pref: Align { - pow2: 2, - }, - }, - size: Size { - raw: 2, - }, - }, - ], - }, - abi: Scalar( - Scalar { - value: Int( - I16, - false, - ), - valid_range: 256..=256, - }, - ), - largest_niche: Some( - Niche { - offset: Size { - raw: 0, - }, - scalar: Scalar { - value: Int( - I16, - false, - ), - valid_range: 256..=256, - }, - }, - ), - align: AbiAndPrefAlign { - abi: Align { - pow2: 1, - }, - pref: Align { - pow2: 2, - }, - }, - size: Size { - raw: 2, - }, -} + fields: Arbitrary { + offsets: [ + Size { + raw: 0, + }, + ], + memory_index: [ + 0, + ], + }, + variants: Multiple { + tag: Scalar { + value: Int( + I16, + false, + ), + valid_range: 256..=256, + }, + tag_encoding: Direct, + tag_field: 0, + variants: [ + Layout { + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + variants: Single { + index: 0, + }, + abi: Aggregate { + sized: true, + }, + largest_niche: None, + align: AbiAndPrefAlign { + abi: Align { + pow2: 1, + }, + pref: Align { + pow2: 2, + }, + }, + size: Size { + raw: 2, + }, + }, + ], + }, + abi: Scalar( + Scalar { + value: Int( + I16, + false, + ), + valid_range: 256..=256, + }, + ), + largest_niche: Some( + Niche { + offset: Size { + raw: 0, + }, + scalar: Scalar { + value: Int( + I16, + false, + ), + valid_range: 256..=256, + }, + }, + ), + align: AbiAndPrefAlign { + abi: Align { + pow2: 1, + }, + pref: Align { + pow2: 2, + }, + }, + size: Size { + raw: 2, + }, + } --> $DIR/thumb-enum.rs:24:1 | LL | enum C { Chaenomeles = 256, } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: layout_of(P) = Layout { - fields: Arbitrary { - offsets: [ - Size { - raw: 0, - }, - ], - memory_index: [ - 0, - ], - }, - variants: Multiple { - tag: Scalar { - value: Int( - I32, - false, - ), - valid_range: 268435456..=268435456, - }, - tag_encoding: Direct, - tag_field: 0, - variants: [ - Layout { - fields: Arbitrary { - offsets: [], - memory_index: [], - }, - variants: Single { - index: 0, - }, - abi: Aggregate { - sized: true, - }, - largest_niche: None, - align: AbiAndPrefAlign { - abi: Align { - pow2: 2, - }, - pref: Align { - pow2: 2, - }, - }, - size: Size { - raw: 4, - }, - }, - ], - }, - abi: Scalar( - Scalar { - value: Int( - I32, - false, - ), - valid_range: 268435456..=268435456, - }, - ), - largest_niche: Some( - Niche { - offset: Size { - raw: 0, - }, - scalar: Scalar { - value: Int( - I32, - false, - ), - valid_range: 268435456..=268435456, - }, - }, - ), - align: AbiAndPrefAlign { - abi: Align { - pow2: 2, - }, - pref: Align { - pow2: 2, - }, - }, - size: Size { - raw: 4, - }, -} + fields: Arbitrary { + offsets: [ + Size { + raw: 0, + }, + ], + memory_index: [ + 0, + ], + }, + variants: Multiple { + tag: Scalar { + value: Int( + I32, + false, + ), + valid_range: 268435456..=268435456, + }, + tag_encoding: Direct, + tag_field: 0, + variants: [ + Layout { + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + variants: Single { + index: 0, + }, + abi: Aggregate { + sized: true, + }, + largest_niche: None, + align: AbiAndPrefAlign { + abi: Align { + pow2: 2, + }, + pref: Align { + pow2: 2, + }, + }, + size: Size { + raw: 4, + }, + }, + ], + }, + abi: Scalar( + Scalar { + value: Int( + I32, + false, + ), + valid_range: 268435456..=268435456, + }, + ), + largest_niche: Some( + Niche { + offset: Size { + raw: 0, + }, + scalar: Scalar { + value: Int( + I32, + false, + ), + valid_range: 268435456..=268435456, + }, + }, + ), + align: AbiAndPrefAlign { + abi: Align { + pow2: 2, + }, + pref: Align { + pow2: 2, + }, + }, + size: Size { + raw: 4, + }, + } --> $DIR/thumb-enum.rs:28:1 | LL | enum P { Peach = 0x1000_0000isize, } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: layout_of(T) = Layout { - fields: Arbitrary { - offsets: [ - Size { - raw: 0, - }, - ], - memory_index: [ - 0, - ], - }, - variants: Multiple { - tag: Scalar { - value: Int( - I32, - true, - ), - valid_range: 2164260864..=2164260864, - }, - tag_encoding: Direct, - tag_field: 0, - variants: [ - Layout { - fields: Arbitrary { - offsets: [], - memory_index: [], - }, - variants: Single { - index: 0, - }, - abi: Aggregate { - sized: true, - }, - largest_niche: None, - align: AbiAndPrefAlign { - abi: Align { - pow2: 2, - }, - pref: Align { - pow2: 2, - }, - }, - size: Size { - raw: 4, - }, - }, - ], - }, - abi: Scalar( - Scalar { - value: Int( - I32, - true, - ), - valid_range: 2164260864..=2164260864, - }, - ), - largest_niche: Some( - Niche { - offset: Size { - raw: 0, - }, - scalar: Scalar { - value: Int( - I32, - true, - ), - valid_range: 2164260864..=2164260864, - }, - }, - ), - align: AbiAndPrefAlign { - abi: Align { - pow2: 2, - }, - pref: Align { - pow2: 2, - }, - }, - size: Size { - raw: 4, - }, -} + fields: Arbitrary { + offsets: [ + Size { + raw: 0, + }, + ], + memory_index: [ + 0, + ], + }, + variants: Multiple { + tag: Scalar { + value: Int( + I32, + true, + ), + valid_range: 2164260864..=2164260864, + }, + tag_encoding: Direct, + tag_field: 0, + variants: [ + Layout { + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + variants: Single { + index: 0, + }, + abi: Aggregate { + sized: true, + }, + largest_niche: None, + align: AbiAndPrefAlign { + abi: Align { + pow2: 2, + }, + pref: Align { + pow2: 2, + }, + }, + size: Size { + raw: 4, + }, + }, + ], + }, + abi: Scalar( + Scalar { + value: Int( + I32, + true, + ), + valid_range: 2164260864..=2164260864, + }, + ), + largest_niche: Some( + Niche { + offset: Size { + raw: 0, + }, + scalar: Scalar { + value: Int( + I32, + true, + ), + valid_range: 2164260864..=2164260864, + }, + }, + ), + align: AbiAndPrefAlign { + abi: Align { + pow2: 2, + }, + pref: Align { + pow2: 2, + }, + }, + size: Size { + raw: 4, + }, + } --> $DIR/thumb-enum.rs:34:1 | LL | enum T { Tangerine = TANGERINE as isize } 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/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.nll.stderr b/src/test/ui/mismatched_types/closure-arg-type-mismatch.nll.stderr index 6ed91b20ab8..1f46229cb5a 100644 --- a/src/test/ui/mismatched_types/closure-arg-type-mismatch.nll.stderr +++ b/src/test/ui/mismatched_types/closure-arg-type-mismatch.nll.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: aborting due to 3 previous errors 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/issues/auxiliary/issue-69725.rs b/src/test/ui/missing-trait-bounds/auxiliary/issue-69725.rs index 13606e498ef..13606e498ef 100644 --- a/src/test/ui/issues/auxiliary/issue-69725.rs +++ b/src/test/ui/missing-trait-bounds/auxiliary/issue-69725.rs diff --git a/src/test/ui/missing-trait-bounds/issue-35677.fixed b/src/test/ui/missing-trait-bounds/issue-35677.fixed new file mode 100644 index 00000000000..08174d8d8d5 --- /dev/null +++ b/src/test/ui/missing-trait-bounds/issue-35677.fixed @@ -0,0 +1,11 @@ +// run-rustfix +#![allow(dead_code)] +use std::collections::HashSet; +use std::hash::Hash; + +fn is_subset<T>(this: &HashSet<T>, other: &HashSet<T>) -> bool where T: Eq, T: Hash { + this.is_subset(other) + //~^ ERROR the method +} + +fn main() {} diff --git a/src/test/ui/issues/issue-35677.rs b/src/test/ui/missing-trait-bounds/issue-35677.rs index 15d13979062..2cb394386b8 100644 --- a/src/test/ui/issues/issue-35677.rs +++ b/src/test/ui/missing-trait-bounds/issue-35677.rs @@ -1,4 +1,7 @@ +// run-rustfix +#![allow(dead_code)] use std::collections::HashSet; +use std::hash::Hash; fn is_subset<T>(this: &HashSet<T>, other: &HashSet<T>) -> bool { this.is_subset(other) diff --git a/src/test/ui/issues/issue-35677.stderr b/src/test/ui/missing-trait-bounds/issue-35677.stderr index ab59e5d1acf..a2201b946a6 100644 --- a/src/test/ui/issues/issue-35677.stderr +++ b/src/test/ui/missing-trait-bounds/issue-35677.stderr @@ -1,5 +1,5 @@ error[E0599]: the method `is_subset` exists for reference `&HashSet<T>`, but its trait bounds were not satisfied - --> $DIR/issue-35677.rs:4:10 + --> $DIR/issue-35677.rs:7:10 | LL | this.is_subset(other) | ^^^^^^^^^ method cannot be called on `&HashSet<T>` due to unsatisfied trait bounds @@ -7,6 +7,10 @@ LL | this.is_subset(other) = note: the following trait bounds were not satisfied: `T: Eq` `T: Hash` +help: consider restricting the type parameters to satisfy the trait bounds + | +LL | fn is_subset<T>(this: &HashSet<T>, other: &HashSet<T>) -> bool where T: Eq, T: Hash { + | ++++++++++++++++++++ error: aborting due to previous error diff --git a/src/test/ui/missing-trait-bounds/issue-69725.fixed b/src/test/ui/missing-trait-bounds/issue-69725.fixed new file mode 100644 index 00000000000..d57badcfd8c --- /dev/null +++ b/src/test/ui/missing-trait-bounds/issue-69725.fixed @@ -0,0 +1,13 @@ +// run-rustfix +// aux-build:issue-69725.rs +#![allow(dead_code)] + +extern crate issue_69725; +use issue_69725::Struct; + +fn crash<A>() where A: Clone { + let _ = Struct::<A>::new().clone(); + //~^ ERROR: the method +} + +fn main() {} diff --git a/src/test/ui/issues/issue-69725.rs b/src/test/ui/missing-trait-bounds/issue-69725.rs index 7c77293945e..9c88969c5cf 100644 --- a/src/test/ui/issues/issue-69725.rs +++ b/src/test/ui/missing-trait-bounds/issue-69725.rs @@ -1,4 +1,6 @@ +// run-rustfix // aux-build:issue-69725.rs +#![allow(dead_code)] extern crate issue_69725; use issue_69725::Struct; diff --git a/src/test/ui/issues/issue-69725.stderr b/src/test/ui/missing-trait-bounds/issue-69725.stderr index b1ba89f6cbe..6395bca300c 100644 --- a/src/test/ui/issues/issue-69725.stderr +++ b/src/test/ui/missing-trait-bounds/issue-69725.stderr @@ -1,5 +1,5 @@ error[E0599]: the method `clone` exists for struct `Struct<A>`, but its trait bounds were not satisfied - --> $DIR/issue-69725.rs:7:32 + --> $DIR/issue-69725.rs:9:32 | LL | let _ = Struct::<A>::new().clone(); | ^^^^^ method cannot be called on `Struct<A>` due to unsatisfied trait bounds @@ -12,6 +12,10 @@ LL | pub struct Struct<A>(A); = note: the following trait bounds were not satisfied: `A: Clone` which is required by `Struct<A>: Clone` +help: consider restricting the type parameter to satisfy the trait bound + | +LL | fn crash<A>() where A: Clone { + | ++++++++++++++ error: aborting due to previous error diff --git a/src/test/ui/suggestions/missing-trait-bound-for-op.fixed b/src/test/ui/missing-trait-bounds/missing-trait-bound-for-op.fixed index 6b24375e415..6b24375e415 100644 --- a/src/test/ui/suggestions/missing-trait-bound-for-op.fixed +++ b/src/test/ui/missing-trait-bounds/missing-trait-bound-for-op.fixed diff --git a/src/test/ui/suggestions/missing-trait-bound-for-op.rs b/src/test/ui/missing-trait-bounds/missing-trait-bound-for-op.rs index df47be070c9..df47be070c9 100644 --- a/src/test/ui/suggestions/missing-trait-bound-for-op.rs +++ b/src/test/ui/missing-trait-bounds/missing-trait-bound-for-op.rs diff --git a/src/test/ui/suggestions/missing-trait-bound-for-op.stderr b/src/test/ui/missing-trait-bounds/missing-trait-bound-for-op.stderr index cde07550125..cde07550125 100644 --- a/src/test/ui/suggestions/missing-trait-bound-for-op.stderr +++ b/src/test/ui/missing-trait-bounds/missing-trait-bound-for-op.stderr diff --git a/src/test/ui/suggestions/missing-trait-bounds-for-method-call.rs b/src/test/ui/missing-trait-bounds/missing-trait-bounds-for-method-call.rs index afd47f71c2c..afd47f71c2c 100644 --- a/src/test/ui/suggestions/missing-trait-bounds-for-method-call.rs +++ b/src/test/ui/missing-trait-bounds/missing-trait-bounds-for-method-call.rs diff --git a/src/test/ui/suggestions/missing-trait-bounds-for-method-call.stderr b/src/test/ui/missing-trait-bounds/missing-trait-bounds-for-method-call.stderr index 2f0fd692a44..2f0fd692a44 100644 --- a/src/test/ui/suggestions/missing-trait-bounds-for-method-call.stderr +++ b/src/test/ui/missing-trait-bounds/missing-trait-bounds-for-method-call.stderr diff --git a/src/test/ui/never_type/never-value-fallback-issue-66757.nofallback.stderr b/src/test/ui/never_type/never-value-fallback-issue-66757.nofallback.stderr index 614cdff1f80..a14253e384a 100644 --- a/src/test/ui/never_type/never-value-fallback-issue-66757.nofallback.stderr +++ b/src/test/ui/never_type/never-value-fallback-issue-66757.nofallback.stderr @@ -6,11 +6,6 @@ LL | <E as From<_>>::from(never); | = help: the following implementations were found: <E as From<!>> -note: required by `from` - --> $SRC_DIR/core/src/convert/mod.rs:LL:COL - | -LL | fn from(_: T) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/on-unimplemented/multiple-impls.stderr b/src/test/ui/on-unimplemented/multiple-impls.stderr index a3658f22426..76aa128e242 100644 --- a/src/test/ui/on-unimplemented/multiple-impls.stderr +++ b/src/test/ui/on-unimplemented/multiple-impls.stderr @@ -7,11 +7,6 @@ LL | Index::index(&[] as &[i32], 2u32); | required by a bound introduced by this call | = help: the trait `Index<u32>` is not implemented for `[i32]` -note: required by `Index::index` - --> $DIR/multiple-impls.rs:12:5 - | -LL | fn index(&self, index: Idx) -> &Self::Output; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the trait bound `[i32]: Index<Foo<u32>>` is not satisfied --> $DIR/multiple-impls.rs:36:18 @@ -22,11 +17,6 @@ LL | Index::index(&[] as &[i32], Foo(2u32)); | required by a bound introduced by this call | = help: the trait `Index<Foo<u32>>` is not implemented for `[i32]` -note: required by `Index::index` - --> $DIR/multiple-impls.rs:12:5 - | -LL | fn index(&self, index: Idx) -> &Self::Output; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the trait bound `[i32]: Index<Bar<u32>>` is not satisfied --> $DIR/multiple-impls.rs:39:18 @@ -37,11 +27,6 @@ LL | Index::index(&[] as &[i32], Bar(2u32)); | required by a bound introduced by this call | = help: the trait `Index<Bar<u32>>` is not implemented for `[i32]` -note: required by `Index::index` - --> $DIR/multiple-impls.rs:12:5 - | -LL | fn index(&self, index: Idx) -> &Self::Output; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the trait bound `[i32]: Index<u32>` is not satisfied --> $DIR/multiple-impls.rs:33:5 diff --git a/src/test/ui/on-unimplemented/on-impl.stderr b/src/test/ui/on-unimplemented/on-impl.stderr index 18eca06ba69..940763fae51 100644 --- a/src/test/ui/on-unimplemented/on-impl.stderr +++ b/src/test/ui/on-unimplemented/on-impl.stderr @@ -7,11 +7,6 @@ LL | Index::<u32>::index(&[1, 2, 3] as &[i32], 2u32); | required by a bound introduced by this call | = help: the trait `Index<u32>` is not implemented for `[i32]` -note: required by `Index::index` - --> $DIR/on-impl.rs:9:5 - | -LL | fn index(&self, index: Idx) -> &Self::Output; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the trait bound `[i32]: Index<u32>` is not satisfied --> $DIR/on-impl.rs:22:5 diff --git a/src/test/ui/parser/struct-literal-in-for.stderr b/src/test/ui/parser/struct-literal-in-for.stderr index feabd8f5813..4b191710c39 100644 --- a/src/test/ui/parser/struct-literal-in-for.stderr +++ b/src/test/ui/parser/struct-literal-in-for.stderr @@ -25,11 +25,6 @@ LL | | }.hi() { | = help: the trait `Iterator` is not implemented for `bool` = note: required because of the requirements on the impl of `IntoIterator` for `bool` -note: required by `into_iter` - --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/range/range-1.stderr b/src/test/ui/range/range-1.stderr index ff494d7d4b8..2ce4e1553d2 100644 --- a/src/test/ui/range/range-1.stderr +++ b/src/test/ui/range/range-1.stderr @@ -12,11 +12,6 @@ LL | for i in false..true {} | = note: required because of the requirements on the impl of `Iterator` for `std::ops::Range<bool>` = note: required because of the requirements on the impl of `IntoIterator` for `std::ops::Range<bool>` -note: required by `into_iter` - --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the size for values of type `[{integer}]` cannot be known at compilation time --> $DIR/range-1.rs:14:17 diff --git a/src/test/ui/range/range_traits-1.stderr b/src/test/ui/range/range_traits-1.stderr index 34c59fcb318..617afc99530 100644 --- a/src/test/ui/range/range_traits-1.stderr +++ b/src/test/ui/range/range_traits-1.stderr @@ -8,11 +8,6 @@ LL | a: Range<usize>, | ^^^^^^^^^^^^^^^ no implementation for `std::ops::Range<usize> < std::ops::Range<usize>` and `std::ops::Range<usize> > std::ops::Range<usize>` | = help: the trait `PartialOrd` is not implemented for `std::ops::Range<usize>` -note: required by `std::cmp::PartialOrd::partial_cmp` - --> $SRC_DIR/core/src/cmp.rs:LL:COL - | -LL | fn partial_cmp(&self, other: &Rhs) -> Option<Ordering>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `std::ops::RangeTo<usize>` with `std::ops::RangeTo<usize>` @@ -25,11 +20,6 @@ LL | b: RangeTo<usize>, | ^^^^^^^^^^^^^^^^^ no implementation for `std::ops::RangeTo<usize> < std::ops::RangeTo<usize>` and `std::ops::RangeTo<usize> > std::ops::RangeTo<usize>` | = help: the trait `PartialOrd` is not implemented for `std::ops::RangeTo<usize>` -note: required by `std::cmp::PartialOrd::partial_cmp` - --> $SRC_DIR/core/src/cmp.rs:LL:COL - | -LL | fn partial_cmp(&self, other: &Rhs) -> Option<Ordering>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `std::ops::RangeFrom<usize>` with `std::ops::RangeFrom<usize>` @@ -42,11 +32,6 @@ LL | c: RangeFrom<usize>, | ^^^^^^^^^^^^^^^^^^^ no implementation for `std::ops::RangeFrom<usize> < std::ops::RangeFrom<usize>` and `std::ops::RangeFrom<usize> > std::ops::RangeFrom<usize>` | = help: the trait `PartialOrd` is not implemented for `std::ops::RangeFrom<usize>` -note: required by `std::cmp::PartialOrd::partial_cmp` - --> $SRC_DIR/core/src/cmp.rs:LL:COL - | -LL | fn partial_cmp(&self, other: &Rhs) -> Option<Ordering>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `std::ops::RangeFull` with `std::ops::RangeFull` @@ -59,11 +44,6 @@ LL | d: RangeFull, | ^^^^^^^^^^^^ no implementation for `std::ops::RangeFull < std::ops::RangeFull` and `std::ops::RangeFull > std::ops::RangeFull` | = help: the trait `PartialOrd` is not implemented for `std::ops::RangeFull` -note: required by `std::cmp::PartialOrd::partial_cmp` - --> $SRC_DIR/core/src/cmp.rs:LL:COL - | -LL | fn partial_cmp(&self, other: &Rhs) -> Option<Ordering>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `std::ops::RangeInclusive<usize>` with `std::ops::RangeInclusive<usize>` @@ -76,11 +56,6 @@ LL | e: RangeInclusive<usize>, | ^^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `std::ops::RangeInclusive<usize> < std::ops::RangeInclusive<usize>` and `std::ops::RangeInclusive<usize> > std::ops::RangeInclusive<usize>` | = help: the trait `PartialOrd` is not implemented for `std::ops::RangeInclusive<usize>` -note: required by `std::cmp::PartialOrd::partial_cmp` - --> $SRC_DIR/core/src/cmp.rs:LL:COL - | -LL | fn partial_cmp(&self, other: &Rhs) -> Option<Ordering>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `std::ops::RangeToInclusive<usize>` with `std::ops::RangeToInclusive<usize>` @@ -93,11 +68,6 @@ LL | f: RangeToInclusive<usize>, | ^^^^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `std::ops::RangeToInclusive<usize> < std::ops::RangeToInclusive<usize>` and `std::ops::RangeToInclusive<usize> > std::ops::RangeToInclusive<usize>` | = help: the trait `PartialOrd` is not implemented for `std::ops::RangeToInclusive<usize>` -note: required by `std::cmp::PartialOrd::partial_cmp` - --> $SRC_DIR/core/src/cmp.rs:LL:COL - | -LL | fn partial_cmp(&self, other: &Rhs) -> Option<Ordering>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `std::ops::Range<usize>: Ord` is not satisfied @@ -109,11 +79,6 @@ LL | struct AllTheRanges { LL | a: Range<usize>, | ^^^^^^^^^^^^^^^ the trait `Ord` is not implemented for `std::ops::Range<usize>` | -note: required by `std::cmp::Ord::cmp` - --> $SRC_DIR/core/src/cmp.rs:LL:COL - | -LL | fn cmp(&self, other: &Self) -> Ordering; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the derive macro `Ord` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `std::ops::RangeTo<usize>: Ord` is not satisfied @@ -125,11 +90,6 @@ LL | #[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)] LL | b: RangeTo<usize>, | ^^^^^^^^^^^^^^^^^ the trait `Ord` is not implemented for `std::ops::RangeTo<usize>` | -note: required by `std::cmp::Ord::cmp` - --> $SRC_DIR/core/src/cmp.rs:LL:COL - | -LL | fn cmp(&self, other: &Self) -> Ordering; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the derive macro `Ord` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `std::ops::RangeFrom<usize>: Ord` is not satisfied @@ -141,11 +101,6 @@ LL | #[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)] LL | c: RangeFrom<usize>, | ^^^^^^^^^^^^^^^^^^^ the trait `Ord` is not implemented for `std::ops::RangeFrom<usize>` | -note: required by `std::cmp::Ord::cmp` - --> $SRC_DIR/core/src/cmp.rs:LL:COL - | -LL | fn cmp(&self, other: &Self) -> Ordering; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the derive macro `Ord` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `std::ops::RangeFull: Ord` is not satisfied @@ -157,11 +112,6 @@ LL | #[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)] LL | d: RangeFull, | ^^^^^^^^^^^^ the trait `Ord` is not implemented for `std::ops::RangeFull` | -note: required by `std::cmp::Ord::cmp` - --> $SRC_DIR/core/src/cmp.rs:LL:COL - | -LL | fn cmp(&self, other: &Self) -> Ordering; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the derive macro `Ord` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `std::ops::RangeInclusive<usize>: Ord` is not satisfied @@ -173,11 +123,6 @@ LL | #[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)] LL | e: RangeInclusive<usize>, | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Ord` is not implemented for `std::ops::RangeInclusive<usize>` | -note: required by `std::cmp::Ord::cmp` - --> $SRC_DIR/core/src/cmp.rs:LL:COL - | -LL | fn cmp(&self, other: &Self) -> Ordering; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the derive macro `Ord` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `std::ops::RangeToInclusive<usize>: Ord` is not satisfied @@ -189,11 +134,6 @@ LL | #[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)] LL | f: RangeToInclusive<usize>, | ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Ord` is not implemented for `std::ops::RangeToInclusive<usize>` | -note: required by `std::cmp::Ord::cmp` - --> $SRC_DIR/core/src/cmp.rs:LL:COL - | -LL | fn cmp(&self, other: &Self) -> Ordering; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the derive macro `Ord` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 12 previous errors 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-2497-if-let-chains/disallowed-positions.stderr b/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr index 513b473c4de..3fc5cb1b079 100644 --- a/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr +++ b/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr @@ -544,11 +544,6 @@ LL | if (let 0 = 0)? {} | ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool` | = help: the trait `Try` is not implemented for `bool` -note: required by `branch` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn branch(self) -> ControlFlow<Self::Residual, Self::Output>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`) --> $DIR/disallowed-positions.rs:44:19 @@ -566,11 +561,6 @@ LL | | } | |_- this function should return `Result` or `Option` to accept `?` | = help: the trait `FromResidual<_>` is not implemented for `()` -note: required by `from_residual` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn from_residual(residual: R) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:54:8 @@ -710,11 +700,6 @@ LL | if let 0 = 0? {} | ^^ the `?` operator cannot be applied to type `{integer}` | = help: the trait `Try` is not implemented for `{integer}` -note: required by `branch` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn branch(self) -> ControlFlow<Self::Residual, Self::Output>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:94:11 @@ -747,11 +732,6 @@ LL | while (let 0 = 0)? {} | ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool` | = help: the trait `Try` is not implemented for `bool` -note: required by `branch` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn branch(self) -> ControlFlow<Self::Residual, Self::Output>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`) --> $DIR/disallowed-positions.rs:108:22 @@ -769,11 +749,6 @@ LL | | } | |_- this function should return `Result` or `Option` to accept `?` | = help: the trait `FromResidual<_>` is not implemented for `()` -note: required by `from_residual` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn from_residual(residual: R) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:118:11 @@ -913,11 +888,6 @@ LL | while let 0 = 0? {} | ^^ the `?` operator cannot be applied to type `{integer}` | = help: the trait `Try` is not implemented for `{integer}` -note: required by `branch` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn branch(self) -> ControlFlow<Self::Residual, Self::Output>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0614]: type `bool` cannot be dereferenced --> $DIR/disallowed-positions.rs:171:5 @@ -938,11 +908,6 @@ LL | (let 0 = 0)?; | ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool` | = help: the trait `Try` is not implemented for `bool` -note: required by `branch` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn branch(self) -> ControlFlow<Self::Residual, Self::Output>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`) --> $DIR/disallowed-positions.rs:181:16 @@ -960,11 +925,6 @@ LL | | } | |_- this function should return `Result` or `Option` to accept `?` | = help: the trait `FromResidual<_>` is not implemented for `()` -note: required by `from_residual` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn from_residual(residual: R) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:196:10 @@ -993,11 +953,6 @@ LL | let 0 = 0?; | ^^ the `?` operator cannot be applied to type `{integer}` | = help: the trait `Try` is not implemented for `{integer}` -note: required by `branch` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn branch(self) -> ControlFlow<Self::Residual, Self::Output>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 103 previous errors; 1 warning emitted 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/span/issue-29595.stderr b/src/test/ui/span/issue-29595.stderr index 24dfdf8ebc2..92445e40731 100644 --- a/src/test/ui/span/issue-29595.stderr +++ b/src/test/ui/span/issue-29595.stderr @@ -3,12 +3,6 @@ error[E0277]: the trait bound `u8: Tr` is not satisfied | LL | let a: u8 = Tr::C; | ^^^^^ the trait `Tr` is not implemented for `u8` - | -note: required by `Tr::C` - --> $DIR/issue-29595.rs:2:5 - | -LL | const C: Self; - | ^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/specialization/defaultimpl/specialization-trait-not-implemented.stderr b/src/test/ui/specialization/defaultimpl/specialization-trait-not-implemented.stderr index ce981bc0098..81e2a9a1ffc 100644 --- a/src/test/ui/specialization/defaultimpl/specialization-trait-not-implemented.stderr +++ b/src/test/ui/specialization/defaultimpl/specialization-trait-not-implemented.stderr @@ -20,8 +20,12 @@ LL | struct MyStruct; LL | println!("{}", MyStruct.foo_one()); | ^^^^^^^ method cannot be called on `MyStruct` due to unsatisfied trait bounds | - = note: the following trait bounds were not satisfied: - `MyStruct: Foo` +note: the following trait bounds were not satisfied because of the requirements of the implementation of `Foo` for `_`: + `MyStruct: Foo` + --> $DIR/specialization-trait-not-implemented.rs:14:17 + | +LL | default impl<T> Foo for T { + | ^^^ ^ note: the following trait must be implemented --> $DIR/specialization-trait-not-implemented.rs:7:1 | 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/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-72766.stderr b/src/test/ui/suggestions/issue-72766.stderr index cb47d589bee..f257bb9b0e8 100644 --- a/src/test/ui/suggestions/issue-72766.stderr +++ b/src/test/ui/suggestions/issue-72766.stderr @@ -5,11 +5,6 @@ LL | SadGirl {}.call()?; | ^^^^^^^^^^^^^^^^^^ the `?` operator cannot be applied to type `impl Future<Output = Result<(), ()>>` | = help: the trait `Try` is not implemented for `impl Future<Output = Result<(), ()>>` -note: required by `branch` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn branch(self) -> ControlFlow<Self::Residual, Self::Output>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `await`ing on the `Future` | LL | SadGirl {}.call().await?; 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/slice-issue-87994.stderr b/src/test/ui/suggestions/slice-issue-87994.stderr index 0275fd475d8..fd2a44f9a82 100644 --- a/src/test/ui/suggestions/slice-issue-87994.stderr +++ b/src/test/ui/suggestions/slice-issue-87994.stderr @@ -6,11 +6,6 @@ LL | for _ in v[1..] { | = note: the trait bound `[i32]: IntoIterator` is not satisfied = note: required because of the requirements on the impl of `IntoIterator` for `[i32]` -note: required by `into_iter` - --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider borrowing here | LL | for _ in &v[1..] { @@ -26,11 +21,6 @@ LL | for _ in v[1..] { | = note: the trait bound `[i32]: IntoIterator` is not satisfied = note: required because of the requirements on the impl of `IntoIterator` for `[i32]` -note: required by `into_iter` - --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider borrowing here | LL | for _ in &v[1..] { @@ -46,11 +36,6 @@ LL | for i2 in v2[1..] { | = note: the trait bound `[K]: IntoIterator` is not satisfied = note: required because of the requirements on the impl of `IntoIterator` for `[K]` -note: required by `into_iter` - --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider borrowing here | LL | for i2 in &v2[1..] { @@ -66,11 +51,6 @@ LL | for i2 in v2[1..] { | = note: the trait bound `[K]: IntoIterator` is not satisfied = note: required because of the requirements on the impl of `IntoIterator` for `[K]` -note: required by `into_iter` - --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider borrowing here | LL | for i2 in &v2[1..] { 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/suggestions/suggest-remove-refs-1.stderr b/src/test/ui/suggestions/suggest-remove-refs-1.stderr index a5c01484d42..1083b2f9713 100644 --- a/src/test/ui/suggestions/suggest-remove-refs-1.stderr +++ b/src/test/ui/suggestions/suggest-remove-refs-1.stderr @@ -9,11 +9,6 @@ LL | for (i, _) in &v.iter().enumerate() { | = help: the trait `Iterator` is not implemented for `&Enumerate<std::slice::Iter<'_, {integer}>>` = note: required because of the requirements on the impl of `IntoIterator` for `&Enumerate<std::slice::Iter<'_, {integer}>>` -note: required by `into_iter` - --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/suggestions/suggest-remove-refs-2.stderr b/src/test/ui/suggestions/suggest-remove-refs-2.stderr index b128590f9d0..197b19a1bff 100644 --- a/src/test/ui/suggestions/suggest-remove-refs-2.stderr +++ b/src/test/ui/suggestions/suggest-remove-refs-2.stderr @@ -9,11 +9,6 @@ LL | for (i, _) in & & & & &v.iter().enumerate() { | = help: the trait `Iterator` is not implemented for `&&&&&Enumerate<std::slice::Iter<'_, {integer}>>` = note: required because of the requirements on the impl of `IntoIterator` for `&&&&&Enumerate<std::slice::Iter<'_, {integer}>>` -note: required by `into_iter` - --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/suggestions/suggest-remove-refs-3.stderr b/src/test/ui/suggestions/suggest-remove-refs-3.stderr index 1c32a33e371..bb0cceac1db 100644 --- a/src/test/ui/suggestions/suggest-remove-refs-3.stderr +++ b/src/test/ui/suggestions/suggest-remove-refs-3.stderr @@ -13,11 +13,6 @@ LL | | .enumerate() { | = help: the trait `Iterator` is not implemented for `&&&&&Enumerate<std::slice::Iter<'_, {integer}>>` = note: required because of the requirements on the impl of `IntoIterator` for `&&&&&Enumerate<std::slice::Iter<'_, {integer}>>` -note: required by `into_iter` - --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL - | -LL | fn into_iter(self) -> Self::IntoIter; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error 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..2bff84363e9 100644 --- a/src/test/ui/traits/inheritance/repeated-supertrait-ambig.stderr +++ b/src/test/ui/traits/inheritance/repeated-supertrait-ambig.stderr @@ -20,12 +20,6 @@ error[E0277]: the trait bound `dyn CompareToInts: CompareTo<i32>` is not satisfi | LL | <dyn CompareToInts>::same_as(c, 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:38:5 @@ -33,11 +27,6 @@ error[E0277]: the trait bound `C: CompareTo<i32>` is not satisfied LL | CompareTo::same_as(c, 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_ufcs2<C:CompareToInts + CompareTo<i32>>(c: &C) -> bool { diff --git a/src/test/ui/traits/issue-71136.stderr b/src/test/ui/traits/issue-71136.stderr index d1e8affd065..45b1e1095c7 100644 --- a/src/test/ui/traits/issue-71136.stderr +++ b/src/test/ui/traits/issue-71136.stderr @@ -8,11 +8,6 @@ LL | the_foos: Vec<Foo>, | ^^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `Foo` | = note: required because of the requirements on the impl of `Clone` for `Vec<Foo>` -note: required by `clone` - --> $SRC_DIR/core/src/clone.rs:LL:COL - | -LL | fn clone(&self) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/traits/issue-77982.stderr b/src/test/ui/traits/issue-77982.stderr index e868756504f..3c4a5d95c13 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 @@ -50,11 +59,6 @@ LL | let ips: Vec<_> = (0..100_000).map(|_| u32::from(0u32.into())).collect( - impl From<bool> for u32; - impl From<char> for u32; and 3 more -note: required by `from` - --> $SRC_DIR/core/src/convert/mod.rs:LL:COL - | -LL | fn from(_: T) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^ error[E0283]: type annotations needed for `Box<T>` --> $DIR/issue-77982.rs:36:16 diff --git a/src/test/ui/traits/issue-79458.stderr b/src/test/ui/traits/issue-79458.stderr index 2f5b4ad0e62..3e83db142e0 100644 --- a/src/test/ui/traits/issue-79458.stderr +++ b/src/test/ui/traits/issue-79458.stderr @@ -10,11 +10,6 @@ LL | bar: &'a mut T = help: the following implementations were found: <&T as Clone> = note: `Clone` is implemented for `&T`, but not for `&mut T` -note: required by `clone` - --> $SRC_DIR/core/src/clone.rs:LL:COL - | -LL | fn clone(&self) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error 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/reservation-impl/no-use.stderr b/src/test/ui/traits/reservation-impl/no-use.stderr index e7d1ee616b3..3d5bf3448bd 100644 --- a/src/test/ui/traits/reservation-impl/no-use.stderr +++ b/src/test/ui/traits/reservation-impl/no-use.stderr @@ -8,11 +8,6 @@ LL | <() as MyTrait>::foo(&()); | = help: the following implementations were found: <() as MyTrait> -note: required by `MyTrait::foo` - --> $DIR/no-use.rs:5:17 - | -LL | trait MyTrait { fn foo(&self); } - | ^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/traits/static-method-generic-inference.stderr b/src/test/ui/traits/static-method-generic-inference.stderr index c8c804a9013..1a0bcf00a67 100644 --- a/src/test/ui/traits/static-method-generic-inference.stderr +++ b/src/test/ui/traits/static-method-generic-inference.stderr @@ -5,11 +5,6 @@ LL | let _f: base::Foo = base::HasNew::new(); | ^^^^^^^^^^^^^^^^^ cannot infer type | = note: cannot satisfy `_: HasNew<Foo>` -note: required by `HasNew::new` - --> $DIR/static-method-generic-inference.rs:8:9 - | -LL | fn new() -> T; - | ^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/traits/suggest-where-clause.stderr b/src/test/ui/traits/suggest-where-clause.stderr index d955cb06a1d..e2cdd368888 100644 --- a/src/test/ui/traits/suggest-where-clause.stderr +++ b/src/test/ui/traits/suggest-where-clause.stderr @@ -49,11 +49,6 @@ error[E0277]: the trait bound `u64: From<T>` is not satisfied LL | <u64 as From<T>>::from; | ^^^^^^^^^^^^^^^^^^^^^^ the trait `From<T>` is not implemented for `u64` | -note: required by `from` - --> $SRC_DIR/core/src/convert/mod.rs:LL:COL - | -LL | fn from(_: T) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^ help: consider introducing a `where` bound, but there might be an alternative better way to express this requirement | LL | fn check<T: Iterator, U: ?Sized>() where u64: From<T> { @@ -65,11 +60,6 @@ error[E0277]: the trait bound `u64: From<<T as Iterator>::Item>` is not satisfie LL | <u64 as From<<T as Iterator>::Item>>::from; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `From<<T as Iterator>::Item>` is not implemented for `u64` | -note: required by `from` - --> $SRC_DIR/core/src/convert/mod.rs:LL:COL - | -LL | fn from(_: T) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^ help: consider introducing a `where` bound, but there might be an alternative better way to express this requirement | LL | fn check<T: Iterator, U: ?Sized>() where u64: From<<T as Iterator>::Item> { @@ -80,12 +70,6 @@ error[E0277]: the trait bound `Misc<_>: From<T>` is not satisfied | LL | <Misc<_> as From<T>>::from; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `From<T>` is not implemented for `Misc<_>` - | -note: required by `from` - --> $SRC_DIR/core/src/convert/mod.rs:LL:COL - | -LL | fn from(_: T) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the size for values of type `[T]` cannot be known at compilation time --> $DIR/suggest-where-clause.rs:28:20 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/traits/vtable/vtable-diamond.stderr b/src/test/ui/traits/vtable/vtable-diamond.stderr index f2b64fac3b7..f71bed84d56 100644 --- a/src/test/ui/traits/vtable/vtable-diamond.stderr +++ b/src/test/ui/traits/vtable/vtable-diamond.stderr @@ -1,13 +1,13 @@ error: vtable entries for `<S as D>`: [ - MetadataDropInPlace, - MetadataSize, - MetadataAlign, - Method(<S as A>::foo_a), - Method(<S as B>::foo_b), - Method(<S as C>::foo_c), - TraitVPtr(<S as C>), - Method(<S as D>::foo_d), -] + MetadataDropInPlace, + MetadataSize, + MetadataAlign, + Method(<S as A>::foo_a), + Method(<S as B>::foo_b), + Method(<S as C>::foo_c), + TraitVPtr(<S as C>), + Method(<S as D>::foo_d), + ] --> $DIR/vtable-diamond.rs:21:1 | LL | / trait D: B + C { @@ -17,12 +17,12 @@ LL | | } | |_^ error: vtable entries for `<S as C>`: [ - MetadataDropInPlace, - MetadataSize, - MetadataAlign, - Method(<S as A>::foo_a), - Method(<S as C>::foo_c), -] + MetadataDropInPlace, + MetadataSize, + MetadataAlign, + Method(<S as A>::foo_a), + Method(<S as C>::foo_c), + ] --> $DIR/vtable-diamond.rs:15:1 | LL | / trait C: A { diff --git a/src/test/ui/traits/vtable/vtable-multi-level.stderr b/src/test/ui/traits/vtable/vtable-multi-level.stderr index 742b88ea8a9..915fd701b03 100644 --- a/src/test/ui/traits/vtable/vtable-multi-level.stderr +++ b/src/test/ui/traits/vtable/vtable-multi-level.stderr @@ -1,34 +1,34 @@ error: vtable entries for `<S as O>`: [ - MetadataDropInPlace, - MetadataSize, - MetadataAlign, - Method(<S as A>::foo_a), - Method(<S as B>::foo_b), - TraitVPtr(<S as B>), - Method(<S as C>::foo_c), - Method(<S as D>::foo_d), - TraitVPtr(<S as D>), - Method(<S as E>::foo_e), - TraitVPtr(<S as E>), - Method(<S as F>::foo_f), - TraitVPtr(<S as F>), - Method(<S as G>::foo_g), - Method(<S as H>::foo_h), - TraitVPtr(<S as H>), - Method(<S as I>::foo_i), - TraitVPtr(<S as I>), - Method(<S as J>::foo_j), - TraitVPtr(<S as J>), - Method(<S as K>::foo_k), - TraitVPtr(<S as K>), - Method(<S as L>::foo_l), - TraitVPtr(<S as L>), - Method(<S as M>::foo_m), - TraitVPtr(<S as M>), - Method(<S as N>::foo_n), - TraitVPtr(<S as N>), - Method(<S as O>::foo_o), -] + MetadataDropInPlace, + MetadataSize, + MetadataAlign, + Method(<S as A>::foo_a), + Method(<S as B>::foo_b), + TraitVPtr(<S as B>), + Method(<S as C>::foo_c), + Method(<S as D>::foo_d), + TraitVPtr(<S as D>), + Method(<S as E>::foo_e), + TraitVPtr(<S as E>), + Method(<S as F>::foo_f), + TraitVPtr(<S as F>), + Method(<S as G>::foo_g), + Method(<S as H>::foo_h), + TraitVPtr(<S as H>), + Method(<S as I>::foo_i), + TraitVPtr(<S as I>), + Method(<S as J>::foo_j), + TraitVPtr(<S as J>), + Method(<S as K>::foo_k), + TraitVPtr(<S as K>), + Method(<S as L>::foo_l), + TraitVPtr(<S as L>), + Method(<S as M>::foo_m), + TraitVPtr(<S as M>), + Method(<S as N>::foo_n), + TraitVPtr(<S as N>), + Method(<S as O>::foo_o), + ] --> $DIR/vtable-multi-level.rs:95:1 | LL | / trait O: G + N { @@ -38,11 +38,11 @@ LL | | } | |_^ error: vtable entries for `<S as B>`: [ - MetadataDropInPlace, - MetadataSize, - MetadataAlign, - Method(<S as B>::foo_b), -] + MetadataDropInPlace, + MetadataSize, + MetadataAlign, + Method(<S as B>::foo_b), + ] --> $DIR/vtable-multi-level.rs:19:1 | LL | / trait B { @@ -52,11 +52,11 @@ LL | | } | |_^ error: vtable entries for `<S as D>`: [ - MetadataDropInPlace, - MetadataSize, - MetadataAlign, - Method(<S as D>::foo_d), -] + MetadataDropInPlace, + MetadataSize, + MetadataAlign, + Method(<S as D>::foo_d), + ] --> $DIR/vtable-multi-level.rs:30:1 | LL | / trait D { @@ -66,11 +66,11 @@ LL | | } | |_^ error: vtable entries for `<S as E>`: [ - MetadataDropInPlace, - MetadataSize, - MetadataAlign, - Method(<S as E>::foo_e), -] + MetadataDropInPlace, + MetadataSize, + MetadataAlign, + Method(<S as E>::foo_e), + ] --> $DIR/vtable-multi-level.rs:36:1 | LL | / trait E { @@ -80,14 +80,14 @@ LL | | } | |_^ error: vtable entries for `<S as F>`: [ - MetadataDropInPlace, - MetadataSize, - MetadataAlign, - Method(<S as D>::foo_d), - Method(<S as E>::foo_e), - TraitVPtr(<S as E>), - Method(<S as F>::foo_f), -] + MetadataDropInPlace, + MetadataSize, + MetadataAlign, + Method(<S as D>::foo_d), + Method(<S as E>::foo_e), + TraitVPtr(<S as E>), + Method(<S as F>::foo_f), + ] --> $DIR/vtable-multi-level.rs:42:1 | LL | / trait F: D + E { @@ -97,11 +97,11 @@ LL | | } | |_^ error: vtable entries for `<S as H>`: [ - MetadataDropInPlace, - MetadataSize, - MetadataAlign, - Method(<S as H>::foo_h), -] + MetadataDropInPlace, + MetadataSize, + MetadataAlign, + Method(<S as H>::foo_h), + ] --> $DIR/vtable-multi-level.rs:53:1 | LL | / trait H { @@ -111,11 +111,11 @@ LL | | } | |_^ error: vtable entries for `<S as I>`: [ - MetadataDropInPlace, - MetadataSize, - MetadataAlign, - Method(<S as I>::foo_i), -] + MetadataDropInPlace, + MetadataSize, + MetadataAlign, + Method(<S as I>::foo_i), + ] --> $DIR/vtable-multi-level.rs:59:1 | LL | / trait I { @@ -125,14 +125,14 @@ LL | | } | |_^ error: vtable entries for `<S as J>`: [ - MetadataDropInPlace, - MetadataSize, - MetadataAlign, - Method(<S as H>::foo_h), - Method(<S as I>::foo_i), - TraitVPtr(<S as I>), - Method(<S as J>::foo_j), -] + MetadataDropInPlace, + MetadataSize, + MetadataAlign, + Method(<S as H>::foo_h), + Method(<S as I>::foo_i), + TraitVPtr(<S as I>), + Method(<S as J>::foo_j), + ] --> $DIR/vtable-multi-level.rs:65:1 | LL | / trait J: H + I { @@ -142,11 +142,11 @@ LL | | } | |_^ error: vtable entries for `<S as K>`: [ - MetadataDropInPlace, - MetadataSize, - MetadataAlign, - Method(<S as K>::foo_k), -] + MetadataDropInPlace, + MetadataSize, + MetadataAlign, + Method(<S as K>::foo_k), + ] --> $DIR/vtable-multi-level.rs:71:1 | LL | / trait K { @@ -156,11 +156,11 @@ LL | | } | |_^ error: vtable entries for `<S as L>`: [ - MetadataDropInPlace, - MetadataSize, - MetadataAlign, - Method(<S as L>::foo_l), -] + MetadataDropInPlace, + MetadataSize, + MetadataAlign, + Method(<S as L>::foo_l), + ] --> $DIR/vtable-multi-level.rs:77:1 | LL | / trait L { @@ -170,14 +170,14 @@ LL | | } | |_^ error: vtable entries for `<S as M>`: [ - MetadataDropInPlace, - MetadataSize, - MetadataAlign, - Method(<S as K>::foo_k), - Method(<S as L>::foo_l), - TraitVPtr(<S as L>), - Method(<S as M>::foo_m), -] + MetadataDropInPlace, + MetadataSize, + MetadataAlign, + Method(<S as K>::foo_k), + Method(<S as L>::foo_l), + TraitVPtr(<S as L>), + Method(<S as M>::foo_m), + ] --> $DIR/vtable-multi-level.rs:83:1 | LL | / trait M: K + L { @@ -187,21 +187,21 @@ LL | | } | |_^ error: vtable entries for `<S as N>`: [ - MetadataDropInPlace, - MetadataSize, - MetadataAlign, - Method(<S as H>::foo_h), - Method(<S as I>::foo_i), - TraitVPtr(<S as I>), - Method(<S as J>::foo_j), - Method(<S as K>::foo_k), - TraitVPtr(<S as K>), - Method(<S as L>::foo_l), - TraitVPtr(<S as L>), - Method(<S as M>::foo_m), - TraitVPtr(<S as M>), - Method(<S as N>::foo_n), -] + MetadataDropInPlace, + MetadataSize, + MetadataAlign, + Method(<S as H>::foo_h), + Method(<S as I>::foo_i), + TraitVPtr(<S as I>), + Method(<S as J>::foo_j), + Method(<S as K>::foo_k), + TraitVPtr(<S as K>), + Method(<S as L>::foo_l), + TraitVPtr(<S as L>), + Method(<S as M>::foo_m), + TraitVPtr(<S as M>), + Method(<S as N>::foo_n), + ] --> $DIR/vtable-multi-level.rs:89:1 | LL | / trait N: J + M { diff --git a/src/test/ui/traits/vtable/vtable-multiple.stderr b/src/test/ui/traits/vtable/vtable-multiple.stderr index f25ac76fbe0..f1c8947f906 100644 --- a/src/test/ui/traits/vtable/vtable-multiple.stderr +++ b/src/test/ui/traits/vtable/vtable-multiple.stderr @@ -1,12 +1,12 @@ error: vtable entries for `<S as C>`: [ - MetadataDropInPlace, - MetadataSize, - MetadataAlign, - Method(<S as A>::foo_a), - Method(<S as B>::foo_b), - TraitVPtr(<S as B>), - Method(<S as C>::foo_c), -] + MetadataDropInPlace, + MetadataSize, + MetadataAlign, + Method(<S as A>::foo_a), + Method(<S as B>::foo_b), + TraitVPtr(<S as B>), + Method(<S as C>::foo_c), + ] --> $DIR/vtable-multiple.rs:16:1 | LL | / trait C: A + B { @@ -16,11 +16,11 @@ LL | | } | |_^ error: vtable entries for `<S as B>`: [ - MetadataDropInPlace, - MetadataSize, - MetadataAlign, - Method(<S as B>::foo_b), -] + MetadataDropInPlace, + MetadataSize, + MetadataAlign, + Method(<S as B>::foo_b), + ] --> $DIR/vtable-multiple.rs:10:1 | LL | / trait B { diff --git a/src/test/ui/traits/vtable/vtable-non-object-safe.stderr b/src/test/ui/traits/vtable/vtable-non-object-safe.stderr index 34fe910525b..bbfbde222f3 100644 --- a/src/test/ui/traits/vtable/vtable-non-object-safe.stderr +++ b/src/test/ui/traits/vtable/vtable-non-object-safe.stderr @@ -1,12 +1,12 @@ error: vtable entries for `<std::vec::IntoIter<u8> as A>`: [ - MetadataDropInPlace, - MetadataSize, - MetadataAlign, - Method(<std::vec::IntoIter<u8> as Iterator>::next), - Method(<std::vec::IntoIter<u8> as Iterator>::size_hint), - Method(<std::vec::IntoIter<u8> as Iterator>::advance_by), - Method(<std::vec::IntoIter<u8> as Iterator>::nth), -] + MetadataDropInPlace, + MetadataSize, + MetadataAlign, + Method(<std::vec::IntoIter<u8> as Iterator>::next), + Method(<std::vec::IntoIter<u8> as Iterator>::size_hint), + Method(<std::vec::IntoIter<u8> as Iterator>::advance_by), + Method(<std::vec::IntoIter<u8> as Iterator>::nth), + ] --> $DIR/vtable-non-object-safe.rs:8:1 | LL | trait A: Iterator {} diff --git a/src/test/ui/traits/vtable/vtable-vacant.stderr b/src/test/ui/traits/vtable/vtable-vacant.stderr index e3b75e7cf33..c8cf5839972 100644 --- a/src/test/ui/traits/vtable/vtable-vacant.stderr +++ b/src/test/ui/traits/vtable/vtable-vacant.stderr @@ -1,12 +1,12 @@ error: vtable entries for `<S as B>`: [ - MetadataDropInPlace, - MetadataSize, - MetadataAlign, - Method(<S as A>::foo_a1), - Vacant, - Method(<S as B>::foo_b1), - Vacant, -] + MetadataDropInPlace, + MetadataSize, + MetadataAlign, + Method(<S as A>::foo_a1), + Vacant, + Method(<S as B>::foo_b1), + Vacant, + ] --> $DIR/vtable-vacant.rs:15:1 | LL | / trait B: A { diff --git a/src/test/ui/trivial-bounds/trivial-bounds-leak.stderr b/src/test/ui/trivial-bounds/trivial-bounds-leak.stderr index d9e0d21541e..02c5d5d2484 100644 --- a/src/test/ui/trivial-bounds/trivial-bounds-leak.stderr +++ b/src/test/ui/trivial-bounds/trivial-bounds-leak.stderr @@ -27,12 +27,6 @@ LL | Foo::test(&4i32); | --------- ^^^^^ the trait `Foo` is not implemented for `i32` | | | required by a bound introduced by this call - | -note: required by `Foo::test` - --> $DIR/trivial-bounds-leak.rs:5:5 - | -LL | fn test(&self); - | ^^^^^^^^^^^^^^^ error[E0277]: the trait bound `i32: Foo` is not satisfied --> $DIR/trivial-bounds-leak.rs:26:22 diff --git a/src/test/ui/try-block/try-block-bad-type.stderr b/src/test/ui/try-block/try-block-bad-type.stderr index fce8dbab485..cf3a07808de 100644 --- a/src/test/ui/try-block/try-block-bad-type.stderr +++ b/src/test/ui/try-block/try-block-bad-type.stderr @@ -8,11 +8,6 @@ LL | Err("")?; = help: the following implementations were found: <TryFromSliceError as From<Infallible>> = note: required because of the requirements on the impl of `FromResidual<Result<Infallible, &str>>` for `Result<u32, TryFromSliceError>` -note: required by `from_residual` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn from_residual(residual: R) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0271]: type mismatch resolving `<Result<i32, i32> as Try>::Output == &str` --> $DIR/try-block-bad-type.rs:12:9 @@ -33,11 +28,6 @@ LL | let res: () = try { }; | ^ could not wrap the final value of the block as `()` doesn't implement `Try` | = help: the trait `Try` is not implemented for `()` -note: required by `from_output` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn from_output(output: Self::Output) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: a `try` block must return `Result` or `Option` (or another type that implements `Try`) --> $DIR/try-block-bad-type.rs:20:26 @@ -46,11 +36,6 @@ LL | let res: i32 = try { 5 }; | ^ could not wrap the final value of the block as `i32` doesn't implement `Try` | = help: the trait `Try` is not implemented for `i32` -note: required by `from_output` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn from_output(output: Self::Output) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 5 previous errors diff --git a/src/test/ui/try-block/try-block-in-while.stderr b/src/test/ui/try-block/try-block-in-while.stderr index 4270df5b406..62cc26dd401 100644 --- a/src/test/ui/try-block/try-block-in-while.stderr +++ b/src/test/ui/try-block/try-block-in-while.stderr @@ -5,11 +5,6 @@ LL | while try { false } {} | ^^^^^ could not wrap the final value of the block as `bool` doesn't implement `Try` | = help: the trait `Try` is not implemented for `bool` -note: required by `from_output` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn from_output(output: Self::Output) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/try-trait/bad-interconversion.stderr b/src/test/ui/try-trait/bad-interconversion.stderr index 5cecf9128bb..80c5e6f529c 100644 --- a/src/test/ui/try-trait/bad-interconversion.stderr +++ b/src/test/ui/try-trait/bad-interconversion.stderr @@ -11,11 +11,6 @@ LL | Ok(Err(123_i32)?) <u8 as From<NonZeroU8>> <u8 as From<bool>> = note: required because of the requirements on the impl of `FromResidual<Result<Infallible, i32>>` for `Result<u64, u8>` -note: required by `from_residual` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn from_residual(residual: R) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the `?` operator can only be used on `Result`s, not `Option`s, in a function that returns `Result` --> $DIR/bad-interconversion.rs:11:12 @@ -29,11 +24,6 @@ LL | | } | |_- this function returns a `Result` | = help: the trait `FromResidual<Option<Infallible>>` is not implemented for `Result<u64, String>` -note: required by `from_residual` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn from_residual(residual: R) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the `?` operator can only be used on `Result`s in a function that returns `Result` --> $DIR/bad-interconversion.rs:17:31 @@ -46,11 +36,6 @@ LL | | } | |_- this function returns a `Result` | = help: the trait `FromResidual<ControlFlow<{integer}, Infallible>>` is not implemented for `Result<u64, String>` -note: required by `from_residual` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn from_residual(residual: R) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the `?` operator can only be used on `Option`s, not `Result`s, in a function that returns `Option` --> $DIR/bad-interconversion.rs:22:22 @@ -63,11 +48,6 @@ LL | | } | |_- this function returns an `Option` | = help: the trait `FromResidual<Result<Infallible, &str>>` is not implemented for `Option<u16>` -note: required by `from_residual` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn from_residual(residual: R) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the `?` operator can only be used on `Option`s in a function that returns `Option` --> $DIR/bad-interconversion.rs:27:33 @@ -80,11 +60,6 @@ LL | | } | |_- this function returns an `Option` | = help: the trait `FromResidual<ControlFlow<{integer}, Infallible>>` is not implemented for `Option<u64>` -note: required by `from_residual` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn from_residual(residual: R) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the `?` operator can only be used on `ControlFlow`s in a function that returns `ControlFlow` --> $DIR/bad-interconversion.rs:32:39 @@ -97,11 +72,6 @@ LL | | } | |_- this function returns a `ControlFlow` | = help: the trait `FromResidual<Result<Infallible, &str>>` is not implemented for `ControlFlow<String>` -note: required by `from_residual` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn from_residual(residual: R) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the `?` operator can only be used on `ControlFlow`s in a function that returns `ControlFlow` --> $DIR/bad-interconversion.rs:37:12 @@ -115,11 +85,6 @@ LL | | } | |_- this function returns a `ControlFlow` | = help: the trait `FromResidual<Option<Infallible>>` is not implemented for `ControlFlow<u64>` -note: required by `from_residual` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn from_residual(residual: R) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the `?` operator in a function that returns `ControlFlow<B, _>` can only be used on other `ControlFlow<B, _>`s (with the same Break type) --> $DIR/bad-interconversion.rs:43:29 @@ -134,11 +99,6 @@ LL | | } | = help: the trait `FromResidual<ControlFlow<u8, Infallible>>` is not implemented for `ControlFlow<i64>` = note: unlike `Result`, there's no `From`-conversion performed for `ControlFlow` -note: required by `from_residual` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn from_residual(residual: R) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 8 previous errors diff --git a/src/test/ui/try-trait/option-to-result.stderr b/src/test/ui/try-trait/option-to-result.stderr index f89813e729f..aadfbf61f28 100644 --- a/src/test/ui/try-trait/option-to-result.stderr +++ b/src/test/ui/try-trait/option-to-result.stderr @@ -10,11 +10,6 @@ LL | | } | |_- this function returns a `Result` | = help: the trait `FromResidual<Option<Infallible>>` is not implemented for `Result<(), ()>` -note: required by `from_residual` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn from_residual(residual: R) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the `?` operator can only be used on `Option`s, not `Result`s, in a function that returns `Option` --> $DIR/option-to-result.rs:11:6 @@ -28,11 +23,6 @@ LL | | } | |_- this function returns an `Option` | = help: the trait `FromResidual<Result<Infallible, i32>>` is not implemented for `Option<i32>` -note: required by `from_residual` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn from_residual(residual: R) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/try-trait/try-on-option-diagnostics.stderr b/src/test/ui/try-trait/try-on-option-diagnostics.stderr index bb65aae561f..a6badd19038 100644 --- a/src/test/ui/try-trait/try-on-option-diagnostics.stderr +++ b/src/test/ui/try-trait/try-on-option-diagnostics.stderr @@ -10,11 +10,6 @@ LL | | } | |_- this function should return `Result` or `Option` to accept `?` | = help: the trait `FromResidual<Option<Infallible>>` is not implemented for `u32` -note: required by `from_residual` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn from_residual(residual: R) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the `?` operator can only be used in a closure that returns `Result` or `Option` (or another type that implements `FromResidual`) --> $DIR/try-on-option-diagnostics.rs:14:10 @@ -29,11 +24,6 @@ LL | | }; | |_____- this function should return `Result` or `Option` to accept `?` | = help: the trait `FromResidual<Option<Infallible>>` is not implemented for `{integer}` -note: required by `from_residual` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn from_residual(residual: R) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the `?` operator can only be used in a method that returns `Result` or `Option` (or another type that implements `FromResidual`) --> $DIR/try-on-option-diagnostics.rs:26:14 @@ -46,11 +36,6 @@ LL | | } | |_________- this function should return `Result` or `Option` to accept `?` | = help: the trait `FromResidual<Option<Infallible>>` is not implemented for `()` -note: required by `from_residual` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn from_residual(residual: R) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the `?` operator can only be used in a trait method that returns `Result` or `Option` (or another type that implements `FromResidual`) --> $DIR/try-on-option-diagnostics.rs:39:14 @@ -63,11 +48,6 @@ LL | | } | |_________- this function should return `Result` or `Option` to accept `?` | = help: the trait `FromResidual<Option<Infallible>>` is not implemented for `()` -note: required by `from_residual` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn from_residual(residual: R) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 4 previous errors diff --git a/src/test/ui/try-trait/try-on-option.stderr b/src/test/ui/try-trait/try-on-option.stderr index b522dd5709b..27e33bc022e 100644 --- a/src/test/ui/try-trait/try-on-option.stderr +++ b/src/test/ui/try-trait/try-on-option.stderr @@ -10,11 +10,6 @@ LL | | } | |_- this function returns a `Result` | = help: the trait `FromResidual<Option<Infallible>>` is not implemented for `Result<u32, ()>` -note: required by `from_residual` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn from_residual(residual: R) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`) --> $DIR/try-on-option.rs:13:6 @@ -28,11 +23,6 @@ LL | | } | |_- this function should return `Result` or `Option` to accept `?` | = help: the trait `FromResidual<Option<Infallible>>` is not implemented for `u32` -note: required by `from_residual` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn from_residual(residual: R) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/try-trait/try-operator-on-main.stderr b/src/test/ui/try-trait/try-operator-on-main.stderr index d669124e9f1..ad55f40b5b6 100644 --- a/src/test/ui/try-trait/try-operator-on-main.stderr +++ b/src/test/ui/try-trait/try-operator-on-main.stderr @@ -12,11 +12,6 @@ LL | | } | |_- this function should return `Result` or `Option` to accept `?` | = help: the trait `FromResidual<Result<Infallible, std::io::Error>>` is not implemented for `()` -note: required by `from_residual` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn from_residual(residual: R) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the `?` operator can only be applied to values that implement `Try` --> $DIR/try-operator-on-main.rs:10:5 @@ -25,11 +20,6 @@ LL | ()?; | ^^^ the `?` operator cannot be applied to type `()` | = help: the trait `Try` is not implemented for `()` -note: required by `branch` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn branch(self) -> ControlFlow<Self::Residual, Self::Output>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`) --> $DIR/try-operator-on-main.rs:10:7 @@ -47,11 +37,6 @@ LL | | } | |_- this function should return `Result` or `Option` to accept `?` | = help: the trait `FromResidual<_>` is not implemented for `()` -note: required by `from_residual` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn from_residual(residual: R) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the trait bound `(): Try` is not satisfied --> $DIR/try-operator-on-main.rs:14:25 @@ -72,11 +57,6 @@ LL | ()?; | ^^^ the `?` operator cannot be applied to type `()` | = help: the trait `Try` is not implemented for `()` -note: required by `branch` - --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL - | -LL | fn branch(self) -> ControlFlow<Self::Residual, Self::Output>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 5 previous errors diff --git a/src/test/ui/type/type-check-defaults.stderr b/src/test/ui/type/type-check-defaults.stderr index f8dbd66c1c7..2a61547997b 100644 --- a/src/test/ui/type/type-check-defaults.stderr +++ b/src/test/ui/type/type-check-defaults.stderr @@ -29,36 +29,18 @@ error[E0277]: the trait bound `String: Copy` is not satisfied | LL | struct Bounds<T:Copy=String>(T); | ^^^^ the trait `Copy` is not implemented for `String` - | -note: required by `Bounds` - --> $DIR/type-check-defaults.rs:11:1 - | -LL | struct Bounds<T:Copy=String>(T); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the trait bound `String: Copy` is not satisfied --> $DIR/type-check-defaults.rs:14:42 | LL | struct WhereClause<T=String>(T) where T: Copy; | ^^^^ the trait `Copy` is not implemented for `String` - | -note: required by `WhereClause` - --> $DIR/type-check-defaults.rs:14:1 - | -LL | struct WhereClause<T=String>(T) where T: Copy; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the trait bound `String: Copy` is not satisfied --> $DIR/type-check-defaults.rs:17:20 | LL | trait TraitBound<T:Copy=String> {} | ^^^^ the trait `Copy` is not implemented for `String` - | -note: required by `TraitBound` - --> $DIR/type-check-defaults.rs:17:1 - | -LL | trait TraitBound<T:Copy=String> {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the trait bound `T: Copy` is not satisfied --> $DIR/type-check-defaults.rs:21:25 @@ -83,11 +65,6 @@ LL | trait ProjectionPred<T:Iterator = IntoIter<i32>> where T::Item : Add<u8> {} | ^^^^^^^ no implementation for `i32 + u8` | = help: the trait `Add<u8>` is not implemented for `i32` -note: required by `ProjectionPred` - --> $DIR/type-check-defaults.rs:24:1 - | -LL | trait ProjectionPred<T:Iterator = IntoIter<i32>> where T::Item : Add<u8> {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 7 previous errors 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/type/type-params-in-different-spaces-2.stderr b/src/test/ui/type/type-params-in-different-spaces-2.stderr index 368adb456d6..53610985f31 100644 --- a/src/test/ui/type/type-params-in-different-spaces-2.stderr +++ b/src/test/ui/type/type-params-in-different-spaces-2.stderr @@ -4,11 +4,6 @@ error[E0277]: the trait bound `Self: Tr<U>` is not satisfied LL | Tr::op(u) | ^^^^^^ the trait `Tr<U>` is not implemented for `Self` | -note: required by `Tr::op` - --> $DIR/type-params-in-different-spaces-2.rs:5:5 - | -LL | fn op(_: T) -> Self; - | ^^^^^^^^^^^^^^^^^^^^ help: consider further restricting `Self` | LL | fn test<U>(u: U) -> Self where Self: Tr<U> { @@ -20,11 +15,6 @@ error[E0277]: the trait bound `Self: Tr<U>` is not satisfied LL | Tr::op(u) | ^^^^^^ the trait `Tr<U>` is not implemented for `Self` | -note: required by `Tr::op` - --> $DIR/type-params-in-different-spaces-2.rs:5:5 - | -LL | fn op(_: T) -> Self; - | ^^^^^^^^^^^^^^^^^^^^ help: consider further restricting `Self` | LL | fn test<U>(u: U) -> Self where Self: Tr<U> { diff --git a/src/test/ui/ufcs/ufcs-qpath-self-mismatch.stderr b/src/test/ui/ufcs/ufcs-qpath-self-mismatch.stderr index 23b91573756..d0bc432a1cd 100644 --- a/src/test/ui/ufcs/ufcs-qpath-self-mismatch.stderr +++ b/src/test/ui/ufcs/ufcs-qpath-self-mismatch.stderr @@ -5,11 +5,6 @@ LL | <i32 as Add<u32>>::add(1, 2); | ^^^^^^^^^^^^^^^^^^^^^^ no implementation for `i32 + u32` | = help: the trait `Add<u32>` is not implemented for `i32` -note: required by `add` - --> $SRC_DIR/core/src/ops/arith.rs:LL:COL - | -LL | fn add(self, rhs: Rhs) -> Self::Output; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0308]: mismatched types --> $DIR/ufcs-qpath-self-mismatch.rs:6:28 diff --git a/src/test/ui/unevaluated_fixed_size_array_len.stderr b/src/test/ui/unevaluated_fixed_size_array_len.stderr index be6ed8d5623..03932d5ed03 100644 --- a/src/test/ui/unevaluated_fixed_size_array_len.stderr +++ b/src/test/ui/unevaluated_fixed_size_array_len.stderr @@ -6,11 +6,6 @@ LL | <[(); 0] as Foo>::foo() | = help: the following implementations were found: <[(); 1] as Foo> -note: required by `Foo::foo` - --> $DIR/unevaluated_fixed_size_array_len.rs:4:5 - | -LL | fn 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 |
