Rollup merge of #106703 - compiler-errors:impl-derived-span, r=estebank

Note predicate span on `ImplDerivedObligation`

Seems obvious to point out the where-clause that introduces the `ImplDerivedObligation` :)

r? `@estebank`
This commit is contained in:
Matthias Krüger 2023-01-11 21:08:08 +01:00 committed by GitHub
commit 90f9c681d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
52 changed files with 200 additions and 68 deletions

View File

@ -36,7 +36,7 @@ use rustc_middle::ty::{
TypeSuperFoldable, TypeVisitable, TypeckResults,
};
use rustc_span::symbol::{sym, Ident, Symbol};
use rustc_span::{BytePos, DesugaringKind, ExpnKind, Span, DUMMY_SP};
use rustc_span::{BytePos, DesugaringKind, ExpnKind, MacroKind, Span, DUMMY_SP};
use rustc_target::spec::abi;
use std::ops::Deref;
@ -2949,7 +2949,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
// FIXME: we should do something else so that it works even on crate foreign
// auto traits.
is_auto_trait = matches!(is_auto, hir::IsAuto::Yes);
err.span_note(ident.span, &msg)
err.span_note(ident.span, &msg);
}
Some(Node::Item(hir::Item {
kind: hir::ItemKind::Impl(hir::Impl { of_trait, self_ty, .. }),
@ -2960,9 +2960,29 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
spans.push(trait_ref.path.span);
}
spans.push(self_ty.span);
err.span_note(spans, &msg)
let mut spans: MultiSpan = spans.into();
if matches!(
self_ty.span.ctxt().outer_expn_data().kind,
ExpnKind::Macro(MacroKind::Derive, _)
) || matches!(
of_trait.as_ref().map(|t| t.path.span.ctxt().outer_expn_data().kind),
Some(ExpnKind::Macro(MacroKind::Derive, _))
) {
spans.push_span_label(
data.span,
"unsatisfied trait bound introduced in this `derive` macro",
);
} else if !data.span.is_dummy() && !data.span.overlaps(self_ty.span) {
spans.push_span_label(
data.span,
"unsatisfied trait bound introduced here",
);
}
err.span_note(spans, &msg);
}
_ => {
err.note(&msg);
}
_ => err.note(&msg),
};
if let Some(file) = file {

View File

@ -10,6 +10,9 @@ note: required for `u32` to implement `for<'b> X<'b>`
|
LL | impl X<'_> for u32
| ^^^^^ ^^^
LL | where
LL | for<'b> <Self as X<'b>>::U: Clone,
| ----- unsatisfied trait bound introduced here
= note: 128 redundant requirements hidden
= note: required for `u32` to implement `for<'b> X<'b>`

View File

@ -9,6 +9,9 @@ note: required for `(T,)` to implement `Grault`
|
LL | impl<T: Grault> Grault for (T,)
| ^^^^^^ ^^^^
...
LL | Self::A: Baz,
| --- unsatisfied trait bound introduced here
= note: 1 redundant requirement hidden
= note: required for `(T,)` to implement `Grault`

View File

@ -9,6 +9,9 @@ note: required for `(T,)` to implement `Grault`
|
LL | impl<T: Grault> Grault for (T,)
| ^^^^^^ ^^^^
...
LL | Self::A: Copy,
| ---- unsatisfied trait bound introduced here
error: aborting due to previous error

View File

@ -14,6 +14,8 @@ note: required for `()` to implement `Visit`
|
LL | impl<'a> Visit for () where
| ^^^^^ ^^
LL | (): Array<Element=&'a ()>,
| -------------- unsatisfied trait bound introduced here
error: aborting due to previous error

View File

@ -22,7 +22,9 @@ note: required for `&mut T` to implement `MyDisplay`
--> $DIR/issue-65774-1.rs:5:24
|
LL | impl<'a, T: MyDisplay> MyDisplay for &'a mut T { }
| ^^^^^^^^^ ^^^^^^^^^
| --------- ^^^^^^^^^ ^^^^^^^^^
| |
| unsatisfied trait bound introduced here
= note: required for the cast from `&mut T` to the object type `dyn MyDisplay`
error: aborting due to 2 previous errors

View File

@ -81,7 +81,9 @@ note: required for `str` to implement `Foo<'_, '_, u8>`
--> $DIR/substs-ppaux.rs:11:17
|
LL | impl<'a,'b,T,S> Foo<'a, 'b, S> for T {}
| ^^^^^^^^^^^^^^ ^
| - ^^^^^^^^^^^^^^ ^
| |
| unsatisfied trait bound introduced here
error: aborting due to 5 previous errors

View File

@ -81,7 +81,9 @@ note: required for `str` to implement `Foo<'_#0r, '_#1r, u8>`
--> $DIR/substs-ppaux.rs:11:17
|
LL | impl<'a,'b,T,S> Foo<'a, 'b, S> for T {}
| ^^^^^^^^^^^^^^ ^
| - ^^^^^^^^^^^^^^ ^
| |
| unsatisfied trait bound introduced here
error: aborting due to 5 previous errors

View File

@ -9,7 +9,9 @@ note: required for `&'static u32` to implement `Defaulted`
--> $DIR/typeck-default-trait-impl-precedence.rs:10:19
|
LL | impl<'a,T:Signed> Defaulted for &'a T { }
| ^^^^^^^^^ ^^^^^
| ------ ^^^^^^^^^ ^^^^^
| |
| unsatisfied trait bound introduced here
note: required by a bound in `is_defaulted`
--> $DIR/typeck-default-trait-impl-precedence.rs:12:19
|

View File

@ -9,7 +9,9 @@ note: required for `Bob` to implement `Add<{integer}>`
--> $DIR/issue-22645.rs:8:19
|
LL | impl<RHS: Scalar> Add <RHS> for Bob {
| ^^^^^^^^^ ^^^
| ------ ^^^^^^^^^ ^^^
| |
| unsatisfied trait bound introduced here
error[E0308]: mismatched types
--> $DIR/issue-22645.rs:15:3

View File

@ -11,12 +11,12 @@ note: required for `&C` to implement `Contains<(), true>`
--> $DIR/issue-85848.rs:21:12
|
LL | impl<T, U> Contains<T, { contains::<T, U>() }> for U where T: _Contains<U> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^ ------------ unsatisfied trait bound introduced here
note: required for `&C` to implement `Delegates<()>`
--> $DIR/issue-85848.rs:12:12
|
LL | impl<T, U> Delegates<U> for T where T: Contains<U, true> {}
| ^^^^^^^^^^^^ ^
| ^^^^^^^^^^^^ ^ ----------------- unsatisfied trait bound introduced here
note: required by a bound in `writes_to_specific_path`
--> $DIR/issue-85848.rs:30:31
|
@ -36,12 +36,14 @@ note: required for `&C` to implement `Contains<(), true>`
--> $DIR/issue-85848.rs:21:12
|
LL | impl<T, U> Contains<T, { contains::<T, U>() }> for U where T: _Contains<U> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^
| ^^^^^^^^^^^^----------------------^ ^
| |
| unsatisfied trait bound introduced here
note: required for `&C` to implement `Delegates<()>`
--> $DIR/issue-85848.rs:12:12
|
LL | impl<T, U> Delegates<U> for T where T: Contains<U, true> {}
| ^^^^^^^^^^^^ ^
| ^^^^^^^^^^^^ ^ ----------------- unsatisfied trait bound introduced here
note: required by a bound in `writes_to_specific_path`
--> $DIR/issue-85848.rs:30:31
|

View File

@ -8,7 +8,7 @@ note: required for `Foo<String>` to implement `Copy`
--> $DIR/trait-error.rs:1:10
|
LL | #[derive(Copy, Clone)]
| ^^^^
| ^^^^ unsatisfied trait bound introduced in this `derive` macro
= note: the `Copy` trait is required because this value will be copied for each element of the array
= help: consider creating a new `const` item and initializing it with the result of the function call to be used in the repeat position, like `const VAL: Type = const_fn();` and `let x = [VAL; 42];`
= help: create an inline `const` block, see RFC #2920 <https://github.com/rust-lang/rfcs/pull/2920> for more information

View File

@ -10,7 +10,7 @@ note: required for `B<C>` to implement `Copy`
--> $DIR/deriving-copyclone.rs:9:10
|
LL | #[derive(Copy, Clone)]
| ^^^^
| ^^^^ unsatisfied trait bound introduced in this `derive` macro
note: required by a bound in `is_copy`
--> $DIR/deriving-copyclone.rs:18:15
|
@ -34,7 +34,7 @@ note: required for `B<C>` to implement `Clone`
--> $DIR/deriving-copyclone.rs:9:16
|
LL | #[derive(Copy, Clone)]
| ^^^^^
| ^^^^^ unsatisfied trait bound introduced in this `derive` macro
note: required by a bound in `is_clone`
--> $DIR/deriving-copyclone.rs:19:16
|
@ -58,7 +58,7 @@ note: required for `B<D>` to implement `Copy`
--> $DIR/deriving-copyclone.rs:9:10
|
LL | #[derive(Copy, Clone)]
| ^^^^
| ^^^^ unsatisfied trait bound introduced in this `derive` macro
note: required by a bound in `is_copy`
--> $DIR/deriving-copyclone.rs:18:15
|

View File

@ -9,7 +9,7 @@ note: required for `Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<
--> $DIR/E0275.rs:6:9
|
LL | impl<T> Foo for T where Bar<T>: Foo {}
| ^^^ ^
| ^^^ ^ --- unsatisfied trait bound introduced here
= note: the full type name has been written to '$TEST_BUILD_DIR/error-codes/E0275/E0275.long-type-hash.txt'
= note: 127 redundant requirements hidden
= note: required for `Bar<T>` to implement `Foo`

View File

@ -31,7 +31,7 @@ note: required for `Fooy<T>` to implement `Copy`
--> $DIR/impl_bounds.rs:10:10
|
LL | #[derive(Copy, Clone)]
| ^^^^
| ^^^^ unsatisfied trait bound introduced in this `derive` macro
note: the requirement `Fooy<T>: Copy` appears on the `impl`'s associated type `C` but not on the corresponding trait's associated type
--> $DIR/impl_bounds.rs:6:10
|
@ -56,7 +56,7 @@ note: required for `Fooy<T>` to implement `Copy`
--> $DIR/impl_bounds.rs:10:10
|
LL | #[derive(Copy, Clone)]
| ^^^^
| ^^^^ unsatisfied trait bound introduced in this `derive` macro
note: the requirement `Fooy<T>: Copy` appears on the `impl`'s method `d` but not on the corresponding trait's method
--> $DIR/impl_bounds.rs:7:8
|

View File

@ -8,7 +8,7 @@ note: required for `&'a mut ()` to implement `for<'a> FuncInput<'a, &'a mut ()>`
--> $DIR/issue-101020.rs:27:20
|
LL | impl<'a, T, F: 'a> FuncInput<'a, F> for T where F: Foo<T> {}
| ^^^^^^^^^^^^^^^^ ^
| ^^^^^^^^^^^^^^^^ ^ ------ unsatisfied trait bound introduced here
note: required by a bound in `LendingIterator::consume`
--> $DIR/issue-101020.rs:9:33
|

View File

@ -49,6 +49,9 @@ note: required for `L<[closure@$DIR/issue-62203-hrtb-ice.rs:42:16: 42:19]>` to i
|
LL | impl<'a, A, T> T0<'a, A> for L<T>
| ^^^^^^^^^ ^^^^
LL | where
LL | T: FnMut(A) -> Unit3,
| ----- unsatisfied trait bound introduced here
note: required by a bound in `T1::m`
--> $DIR/issue-62203-hrtb-ice.rs:27:12
|

View File

@ -8,7 +8,9 @@ note: required for `Ctx<()>` to implement `for<'a> BufferUdpStateContext<&'a ()>
--> $DIR/issue-89118.rs:5:23
|
LL | impl<B: BufferMut, C> BufferUdpStateContext<B> for C {}
| ^^^^^^^^^^^^^^^^^^^^^^^^ ^
| --------- ^^^^^^^^^^^^^^^^^^^^^^^^ ^
| |
| unsatisfied trait bound introduced here
note: required by a bound in `StackContext`
--> $DIR/issue-89118.rs:9:14
|
@ -28,7 +30,9 @@ note: required for `Ctx<()>` to implement `for<'a> BufferUdpStateContext<&'a ()>
--> $DIR/issue-89118.rs:5:23
|
LL | impl<B: BufferMut, C> BufferUdpStateContext<B> for C {}
| ^^^^^^^^^^^^^^^^^^^^^^^^ ^
| --------- ^^^^^^^^^^^^^^^^^^^^^^^^ ^
| |
| unsatisfied trait bound introduced here
note: required by a bound in `EthernetWorker`
--> $DIR/issue-89118.rs:28:14
|
@ -48,7 +52,9 @@ note: required for `Ctx<()>` to implement `for<'a> BufferUdpStateContext<&'a ()>
--> $DIR/issue-89118.rs:5:23
|
LL | impl<B: BufferMut, C> BufferUdpStateContext<B> for C {}
| ^^^^^^^^^^^^^^^^^^^^^^^^ ^
| --------- ^^^^^^^^^^^^^^^^^^^^^^^^ ^
| |
| unsatisfied trait bound introduced here
note: required by a bound in `StackContext`
--> $DIR/issue-89118.rs:9:14
|

View File

@ -9,7 +9,9 @@ note: required for `[closure@$DIR/nested-return-type2-tait2.rs:27:5: 27:7]` to i
--> $DIR/nested-return-type2-tait2.rs:14:31
|
LL | impl<R: Duh, F: FnMut() -> R> Trait for F {
| ^^^^^ ^
| --- ^^^^^ ^
| |
| unsatisfied trait bound introduced here
error: aborting due to previous error

View File

@ -9,7 +9,9 @@ note: required for `[closure@$DIR/nested-return-type2-tait3.rs:26:5: 26:7]` to i
--> $DIR/nested-return-type2-tait3.rs:14:31
|
LL | impl<R: Duh, F: FnMut() -> R> Trait for F {
| ^^^^^ ^
| --- ^^^^^ ^
| |
| unsatisfied trait bound introduced here
error: aborting due to previous error

View File

@ -13,7 +13,7 @@ note: required for `()` to implement `Test`
--> $DIR/projection-mismatch-in-impl-where-clause.rs:11:9
|
LL | impl<T> Test for T where T: Super<Assoc = ()> {}
| ^^^^ ^
| ^^^^ ^ ---------- unsatisfied trait bound introduced here
error: aborting due to previous error

View File

@ -30,6 +30,7 @@ pub trait Access<T> {
}
impl<T, A: Access<T>, P: Deref<Target = A>> Access<T> for P {
//~^ NOTE: required for `Arc<ArcSwapAny<Arc<usize>>>` to implement `Access<_>`
//~| NOTE unsatisfied trait bound introduced here
type Guard = A::Guard;
}
impl<T> Access<T> for ArcSwapAny<T> {

View File

@ -1,11 +1,11 @@
error[E0283]: type annotations needed
--> $DIR/issue-80816.rs:49:38
--> $DIR/issue-80816.rs:50:38
|
LL | let guard: Guard<Arc<usize>> = s.load();
| ^^^^
|
note: multiple `impl`s satisfying `ArcSwapAny<Arc<usize>>: Access<_>` found
--> $DIR/issue-80816.rs:35:1
--> $DIR/issue-80816.rs:36:1
|
LL | impl<T> Access<T> for ArcSwapAny<T> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -16,7 +16,9 @@ note: required for `Arc<ArcSwapAny<Arc<usize>>>` to implement `Access<_>`
--> $DIR/issue-80816.rs:31:45
|
LL | impl<T, A: Access<T>, P: Deref<Target = A>> Access<T> for P {
| ^^^^^^^^^ ^
| --------- ^^^^^^^^^ ^
| |
| unsatisfied trait bound introduced here
help: try using a fully qualified path to specify the expected types
|
LL | let guard: Guard<Arc<usize>> = <Arc<ArcSwapAny<Arc<usize>>> as Access<T>>::load(&s);

View File

@ -18,7 +18,7 @@ note: required for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoDa
--> $DIR/issue-20413.rs:9:9
|
LL | impl<T> Foo for T where NoData<T>: Foo {
| ^^^ ^
| ^^^ ^ --- unsatisfied trait bound introduced here
= note: the full type name has been written to '$TEST_BUILD_DIR/issues/issue-20413/issue-20413.long-type-hash.txt'
= note: 127 redundant requirements hidden
= note: required for `NoData<T>` to implement `Foo`
@ -34,13 +34,13 @@ note: required for `AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNo
--> $DIR/issue-20413.rs:28:9
|
LL | impl<T> Bar for T where EvenLessData<T>: Baz {
| ^^^ ^
| ^^^ ^ --- unsatisfied trait bound introduced here
= note: the full type name has been written to '$TEST_BUILD_DIR/issues/issue-20413/issue-20413.long-type-hash.txt'
note: required for `EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<...>>>>>>>` to implement `Baz`
--> $DIR/issue-20413.rs:35:9
|
LL | impl<T> Baz for T where AlmostNoData<T>: Bar {
| ^^^ ^
| ^^^ ^ --- unsatisfied trait bound introduced here
= note: the full type name has been written to '$TEST_BUILD_DIR/issues/issue-20413/issue-20413.long-type-hash.txt'
= note: 126 redundant requirements hidden
= note: required for `EvenLessData<T>` to implement `Baz`
@ -56,13 +56,13 @@ note: required for `EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLess
--> $DIR/issue-20413.rs:35:9
|
LL | impl<T> Baz for T where AlmostNoData<T>: Bar {
| ^^^ ^
| ^^^ ^ --- unsatisfied trait bound introduced here
= note: the full type name has been written to '$TEST_BUILD_DIR/issues/issue-20413/issue-20413.long-type-hash.txt'
note: required for `AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<...>>>>>>>` to implement `Bar`
--> $DIR/issue-20413.rs:28:9
|
LL | impl<T> Bar for T where EvenLessData<T>: Baz {
| ^^^ ^
| ^^^ ^ --- unsatisfied trait bound introduced here
= note: the full type name has been written to '$TEST_BUILD_DIR/issues/issue-20413/issue-20413.long-type-hash.txt'
= note: 126 redundant requirements hidden
= note: required for `AlmostNoData<T>` to implement `Bar`

View File

@ -10,6 +10,9 @@ note: required for `Wrapper<P>` to implement `for<'b> Wrap<'b>`
|
LL | impl<'b, P> Wrap<'b> for Wrapper<P>
| ^^^^^^^^ ^^^^^^^^^^
LL | where P: Process<'b>,
LL | <P as Process<'b>>::Item: Iterator {
| -------- unsatisfied trait bound introduced here
= note: required for the cast from `Wrapper<P>` to the object type `dyn for<'b> Wrap<'b>`
help: consider further restricting the associated type
|

View File

@ -9,7 +9,9 @@ note: required for `GetNext<<<<<<<... as Next>::Next as Next>::Next as Next>::Ne
--> $DIR/issue-23122-2.rs:10:15
|
LL | impl<T: Next> Next for GetNext<T> {
| ^^^^ ^^^^^^^^^^
| - ^^^^ ^^^^^^^^^^
| |
| unsatisfied trait bound introduced here
= note: the full type name has been written to '$TEST_BUILD_DIR/issues/issue-23122-2/issue-23122-2.long-type-hash.txt'
error: aborting due to previous error

View File

@ -8,7 +8,9 @@ note: required for `<Col as Expression>::SqlType` to implement `IntoNullable`
--> $DIR/issue-38821.rs:9:18
|
LL | impl<T: NotNull> IntoNullable for T {
| ^^^^^^^^^^^^ ^
| ------- ^^^^^^^^^^^^ ^
| |
| unsatisfied trait bound introduced here
= note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider further restricting the associated type
|

View File

@ -14,6 +14,9 @@ note: required for `()` to implement `Visit`
|
LL | impl Visit for () where
| ^^^^^ ^^
LL | //(): for<'a> Array<'a, Element=&'a ()>, // No ICE
LL | (): for<'a> Array<'a, Element=()>, // ICE
| ---------- unsatisfied trait bound introduced here
error: aborting due to previous error

View File

@ -10,7 +10,9 @@ note: required for `Box<{integer}>` to implement `Foo`
--> $DIR/kindck-impl-type-params-2.rs:6:14
|
LL | impl<T:Copy> Foo for T {
| ^^^ ^
| ---- ^^^ ^
| |
| unsatisfied trait bound introduced here
note: required by a bound in `take_param`
--> $DIR/kindck-impl-type-params-2.rs:9:17
|

View File

@ -8,7 +8,9 @@ note: required for `S<T>` to implement `Gettable<T>`
--> $DIR/kindck-impl-type-params.rs:12:32
|
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
| ^^^^^^^^^^^ ^^^^
| ---- ^^^^^^^^^^^ ^^^^
| |
| unsatisfied trait bound introduced here
= note: required for the cast from `S<T>` to the object type `dyn Gettable<T>`
help: consider restricting type parameter `T`
|
@ -25,7 +27,9 @@ note: required for `S<T>` to implement `Gettable<T>`
--> $DIR/kindck-impl-type-params.rs:12:32
|
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
| ^^^^^^^^^^^ ^^^^
| ---- ^^^^^^^^^^^ ^^^^
| |
| unsatisfied trait bound introduced here
= note: required for the cast from `S<T>` to the object type `dyn Gettable<T>`
help: consider restricting type parameter `T`
|
@ -42,7 +46,9 @@ note: required for `S<T>` to implement `Gettable<T>`
--> $DIR/kindck-impl-type-params.rs:12:32
|
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
| ^^^^^^^^^^^ ^^^^
| ---- ^^^^^^^^^^^ ^^^^
| |
| unsatisfied trait bound introduced here
= note: required for the cast from `S<T>` to the object type `dyn Gettable<T>`
help: consider restricting type parameter `T`
|
@ -59,7 +65,9 @@ note: required for `S<T>` to implement `Gettable<T>`
--> $DIR/kindck-impl-type-params.rs:12:32
|
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
| ^^^^^^^^^^^ ^^^^
| ---- ^^^^^^^^^^^ ^^^^
| |
| unsatisfied trait bound introduced here
= note: required for the cast from `S<T>` to the object type `dyn Gettable<T>`
help: consider restricting type parameter `T`
|
@ -77,7 +85,9 @@ note: required for `S<String>` to implement `Gettable<String>`
--> $DIR/kindck-impl-type-params.rs:12:32
|
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
| ^^^^^^^^^^^ ^^^^
| ---- ^^^^^^^^^^^ ^^^^
| |
| unsatisfied trait bound introduced here
= note: required for the cast from `S<String>` to the object type `dyn Gettable<String>`
error[E0277]: the trait bound `Foo: Copy` is not satisfied
@ -91,7 +101,9 @@ note: required for `S<Foo>` to implement `Gettable<Foo>`
--> $DIR/kindck-impl-type-params.rs:12:32
|
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
| ^^^^^^^^^^^ ^^^^
| ---- ^^^^^^^^^^^ ^^^^
| |
| unsatisfied trait bound introduced here
= note: required for the cast from `S<Foo>` to the object type `dyn Gettable<Foo>`
help: consider annotating `Foo` with `#[derive(Copy)]`
|

View File

@ -10,7 +10,9 @@ note: required for `Box<{integer}>` to implement `Foo`
--> $DIR/kindck-inherited-copy-bound.rs:14:14
|
LL | impl<T:Copy> Foo for T {
| ^^^ ^
| ---- ^^^ ^
| |
| unsatisfied trait bound introduced here
note: required by a bound in `take_param`
--> $DIR/kindck-inherited-copy-bound.rs:17:17
|

View File

@ -10,7 +10,9 @@ note: required for `Box<{integer}>` to implement `Foo`
--> $DIR/kindck-inherited-copy-bound.rs:14:14
|
LL | impl<T:Copy> Foo for T {
| ^^^ ^
| ---- ^^^ ^
| |
| unsatisfied trait bound introduced here
note: required by a bound in `take_param`
--> $DIR/kindck-inherited-copy-bound.rs:17:17
|

View File

@ -10,7 +10,7 @@ note: required for `&T` to implement `Zen`
--> $DIR/phantom-auto-trait.rs:10:24
|
LL | unsafe impl<'a, T: 'a> Zen for &'a T where T: Sync {}
| ^^^ ^^^^^
| ^^^ ^^^^^ ---- unsatisfied trait bound introduced here
= note: required because it appears within the type `PhantomData<&T>`
note: required because it appears within the type `Guard<'_, T>`
--> $DIR/phantom-auto-trait.rs:12:8
@ -39,7 +39,7 @@ note: required for `&T` to implement `Zen`
--> $DIR/phantom-auto-trait.rs:10:24
|
LL | unsafe impl<'a, T: 'a> Zen for &'a T where T: Sync {}
| ^^^ ^^^^^
| ^^^ ^^^^^ ---- unsatisfied trait bound introduced here
= note: required because it appears within the type `PhantomData<&T>`
note: required because it appears within the type `Guard<'_, T>`
--> $DIR/phantom-auto-trait.rs:12:8

View File

@ -29,7 +29,7 @@ note: required for `PriorityQueue<T>` to implement `PartialOrd`
--> $DIR/issue-104884-trait-impl-sugg-err.rs:13:10
|
LL | #[derive(PartialOrd, AddImpl)]
| ^^^^^^^^^^
| ^^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro
note: required by a bound in `Ord`
--> $SRC_DIR/core/src/cmp.rs:LL:COL
= note: this error originates in the derive macro `AddImpl` which comes from the expansion of the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -11,7 +11,9 @@ note: required for `u8` to implement `Bar`
--> $DIR/feature-gate-do_not_recommend.rs:13:14
|
LL | impl<T: Foo> Bar for T {
| ^^^ ^
| --- ^^^ ^
| |
| unsatisfied trait bound introduced here
note: required by a bound in `stuff`
--> $DIR/feature-gate-do_not_recommend.rs:16:13
|

View File

@ -8,7 +8,9 @@ note: required for `T` to implement `~const A`
--> $DIR/specializing-constness-2.rs:20:37
|
LL | impl<T: Default + ~const Sup> const A for T {
| ^ ^
| ---------- ^ ^
| |
| unsatisfied trait bound introduced here
help: consider further restricting this bound
|
LL | const fn generic<T: Default + ~const Sup>() {

View File

@ -15,6 +15,9 @@ note: required for `i32` to implement `Iterate<'_>`
|
LL | impl<'a, T> Iterate<'a> for T
| ^^^^^^^^^^^ ^
LL | where
LL | T: Check,
| ----- unsatisfied trait bound introduced here
error: aborting due to previous error; 1 warning emitted

View File

@ -18,12 +18,17 @@ note: required for `T` to implement `FromA<U>`
--> $DIR/issue-39448.rs:24:29
|
LL | impl<T: A, U: A + FromA<T>> FromA<T> for U {
| ^^^^^^^^ ^
| -------- ^^^^^^^^ ^
| |
| unsatisfied trait bound introduced here
note: required for `U` to implement `ToA<T>`
--> $DIR/issue-39448.rs:34:12
|
LL | impl<T, U> ToA<U> for T
| ^^^^^^ ^
LL | where
LL | U: FromA<T>,
| -------- unsatisfied trait bound introduced here
error: aborting due to previous error; 1 warning emitted

View File

@ -8,7 +8,9 @@ note: required for `Struct<T>` to implement `PartialEq`
--> $DIR/derive-clone-for-eq.rs:9:19
|
LL | impl<T: Clone, U> PartialEq<U> for Struct<T>
| ^^^^^^^^^^^^ ^^^^^^^^^
| ----- ^^^^^^^^^^^^ ^^^^^^^^^
| |
| unsatisfied trait bound introduced here
note: required by a bound in `Eq`
--> $SRC_DIR/core/src/cmp.rs:LL:COL
= note: this error originates in the derive macro `Eq` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -30,7 +30,9 @@ note: required for `c::Inner<T>` to implement `Debug`
--> $DIR/derive-macro-missing-bounds.rs:34:28
|
LL | impl<T: Debug + Trait> Debug for Inner<T> {
| ^^^^^ ^^^^^^^^
| ----- ^^^^^ ^^^^^^^^
| |
| unsatisfied trait bound introduced here
= note: 1 redundant requirement hidden
= note: required for `&c::Inner<T>` to implement `Debug`
= note: required for the cast from `&c::Inner<T>` to the object type `dyn Debug`
@ -52,7 +54,7 @@ note: required for `d::Inner<T>` to implement `Debug`
--> $DIR/derive-macro-missing-bounds.rs:49:13
|
LL | impl<T> Debug for Inner<T> where T: Debug, T: Trait {
| ^^^^^ ^^^^^^^^
| ^^^^^ ^^^^^^^^ ----- unsatisfied trait bound introduced here
= note: 1 redundant requirement hidden
= note: required for `&d::Inner<T>` to implement `Debug`
= note: required for the cast from `&d::Inner<T>` to the object type `dyn Debug`
@ -74,7 +76,7 @@ note: required for `e::Inner<T>` to implement `Debug`
--> $DIR/derive-macro-missing-bounds.rs:64:13
|
LL | impl<T> Debug for Inner<T> where T: Debug + Trait {
| ^^^^^ ^^^^^^^^
| ^^^^^ ^^^^^^^^ ----- unsatisfied trait bound introduced here
= note: 1 redundant requirement hidden
= note: required for `&e::Inner<T>` to implement `Debug`
= note: required for the cast from `&e::Inner<T>` to the object type `dyn Debug`
@ -96,7 +98,7 @@ note: required for `f::Inner<T>` to implement `Debug`
--> $DIR/derive-macro-missing-bounds.rs:79:20
|
LL | impl<T: Debug> Debug for Inner<T> where T: Trait {
| ^^^^^ ^^^^^^^^
| ^^^^^ ^^^^^^^^ ----- unsatisfied trait bound introduced here
= note: 1 redundant requirement hidden
= note: required for `&f::Inner<T>` to implement `Debug`
= note: required for the cast from `&f::Inner<T>` to the object type `dyn Debug`

View File

@ -11,12 +11,15 @@ note: required for `Baz<EmptyBis<'de>>` to implement `for<'de> Foo<'de>`
--> $DIR/issue-96223.rs:16:14
|
LL | impl<'de, T> Foo<'de> for Baz<T> where T: Foo<'de> {}
| ^^^^^^^^ ^^^^^^
| ^^^^^^^^ ^^^^^^ -------- unsatisfied trait bound introduced here
note: required for `Empty` to implement `Dummy<EmptyMarker>`
--> $DIR/issue-96223.rs:20:9
|
LL | impl<M> Dummy<M> for Empty
| ^^^^^^^^ ^^^^^
...
LL | for<'de> Baz<<M::Bar as Bar<'de>>::Inner>: Foo<'de>,
| -------- unsatisfied trait bound introduced here
note: required by a bound in `icey_bounds`
--> $DIR/issue-96223.rs:45:19
|

View File

@ -22,11 +22,17 @@ note: required for `RootDatabase` to implement `SourceDatabase`
|
LL | impl<T> SourceDatabase for T
| ^^^^^^^^^^^^^^ ^
LL | where
LL | T: RefUnwindSafe,
| ------------- unsatisfied trait bound introduced here
note: required for `ParseQuery` to implement `Query<RootDatabase>`
--> $DIR/cycle-cache-err-60010.rs:37:10
|
LL | impl<DB> Query<DB> for ParseQuery
| ^^^^^^^^^ ^^^^^^^^^^
LL | where
LL | DB: SourceDatabase,
| -------------- unsatisfied trait bound introduced here
error: aborting due to previous error

View File

@ -16,6 +16,7 @@ struct C<'a>(&'a ());
struct X<T: Y>(T::P);
impl<T: NotAuto> NotAuto for Box<T> {} //~ NOTE: required
//~^ NOTE unsatisfied trait bound introduced here
impl<T: Y> NotAuto for X<T> where T::P: NotAuto {}
impl<'a> NotAuto for C<'a> {}

View File

@ -1,5 +1,5 @@
error[E0275]: overflow evaluating the requirement `X<C<'_>>: NotAuto`
--> $DIR/lifetime.rs:28:5
--> $DIR/lifetime.rs:29:5
|
LL | is_send::<X<C<'static>>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^
@ -8,11 +8,13 @@ note: required for `Box<X<C<'_>>>` to implement `NotAuto`
--> $DIR/lifetime.rs:18:18
|
LL | impl<T: NotAuto> NotAuto for Box<T> {}
| ^^^^^^^ ^^^^^^
| ------- ^^^^^^^ ^^^^^^
| |
| unsatisfied trait bound introduced here
= note: 3 redundant requirements hidden
= note: required for `X<C<'static>>` to implement `NotAuto`
note: required by a bound in `is_send`
--> $DIR/lifetime.rs:22:15
--> $DIR/lifetime.rs:23:15
|
LL | fn is_send<S: NotAuto>() {}
| ^^^^^^^ required by this bound in `is_send`

View File

@ -8,7 +8,9 @@ note: required for `{integer}` to implement `Combo`
--> $DIR/simultaneous.rs:11:34
|
LL | impl<T: Tweedledee + Tweedledum> Combo for T {}
| ^^^^^ ^
| ---------- ^^^^^ ^
| |
| unsatisfied trait bound introduced here
note: required by a bound in `is_ee`
--> $DIR/simultaneous.rs:13:13
|

View File

@ -8,7 +8,9 @@ note: required for `NoClone` to implement `Magic`
--> $DIR/supertrait.rs:5:16
|
LL | impl<T: Magic> Magic for T {}
| ^^^^^ ^
| ----- ^^^^^ ^
| |
| unsatisfied trait bound introduced here
note: required by a bound in `copy`
--> $DIR/supertrait.rs:7:12
|

View File

@ -9,7 +9,9 @@ note: required for `{integer}` to implement `Set<&[_]>`
--> $DIR/issue-18400.rs:6:16
|
LL | impl<'a, T, S> Set<&'a [T]> for S where
| ^^^^^^^^^^^^ ^
| - ^^^^^^^^^^^^ ^
| |
| unsatisfied trait bound introduced here
= note: 128 redundant requirements hidden
= note: required for `{integer}` to implement `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>`

View File

@ -9,7 +9,9 @@ note: required for `Foo` to implement `Component<Foo>`
--> $DIR/issue-91594.rs:13:27
|
LL | impl<M: HasComponent<()>> Component<M> for Foo {
| ^^^^^^^^^^^^ ^^^
| ---------------- ^^^^^^^^^^^^ ^^^
| |
| unsatisfied trait bound introduced here
error: aborting due to previous error

View File

@ -113,7 +113,9 @@ note: required for `Outer2<main::TestType>` to implement `Sync`
--> $DIR/negated-auto-traits-error.rs:14:22
|
LL | unsafe impl<T: Send> Sync for Outer2<T> {}
| ^^^^ ^^^^^^^^^
| ---- ^^^^ ^^^^^^^^^
| |
| unsatisfied trait bound introduced here
note: required by a bound in `is_sync`
--> $DIR/negated-auto-traits-error.rs:17:15
|

View File

@ -27,6 +27,9 @@ note: required for `A<B>` to implement `V<_>`
|
LL | impl<T, U> V<U> for A<T>
| ^^^^ ^^^^
LL | where
LL | T: I<U>,
| ---- unsatisfied trait bound introduced here
help: try using a fully qualified path to specify the expected types
|
LL | <A<B> as V<U>>::method(a);

View File

@ -8,7 +8,9 @@ note: required for `MyBaz<B>` to implement `Baz`
--> $DIR/issue-90400-2.rs:30:14
|
LL | impl<B: Bar> Baz for MyBaz<B> {
| ^^^ ^^^^^^^^
| --- ^^^ ^^^^^^^^
| |
| unsatisfied trait bound introduced here
help: consider restricting type parameter `B`
|
LL | type FooFn<B: Bar> = impl Baz;

View File

@ -8,7 +8,9 @@ note: required for `()` to implement `ProofForConversion<T>`
--> $DIR/underconstrained_generic.rs:13:16
|
LL | impl<X: Trait> ProofForConversion<X> for () {
| ^^^^^^^^^^^^^^^^^^^^^ ^^
| ----- ^^^^^^^^^^^^^^^^^^^^^ ^^
| |
| unsatisfied trait bound introduced here
help: consider restricting type parameter `T`
|
LL | type Converter<T: Trait> = impl ProofForConversion<T>;