ImplDerivedObligation(DerivedObligationCause<'tcx>),
+ DerivedObligation(DerivedObligationCause<'tcx>),
+
/// Error derived when matching traits/impls; see ObligationCause for more details
CompareImplMethodObligation {
item_name: ast::Name,
// Return the base obligation, ignoring derived obligations.
pub fn peel_derives(&self) -> &Self {
let mut base_cause = self;
- while let BuiltinDerivedObligation(cause) | ImplDerivedObligation(cause) = base_cause {
+ while let BuiltinDerivedObligation(cause)
+ | ImplDerivedObligation(cause)
+ | DerivedObligation(cause) = base_cause
+ {
base_cause = &cause.parent_code;
}
base_cause
super::ImplDerivedObligation(ref cause) => {
tcx.lift(cause).map(super::ImplDerivedObligation)
}
+ super::DerivedObligation(ref cause) => tcx.lift(cause).map(super::DerivedObligation),
super::CompareImplMethodObligation {
item_name,
impl_item_def_id,
match obligation.cause.code {
ObligationCauseCode::BuiltinDerivedObligation(..)
- | ObligationCauseCode::ImplDerivedObligation(..) => {}
+ | ObligationCauseCode::ImplDerivedObligation(..)
+ | ObligationCauseCode::DerivedObligation(..) => {}
_ => {
// this is a "direct", user-specified, rather than derived,
// obligation.
while let Some(code) = next_code {
debug!("maybe_note_obligation_cause_for_async_await: code={:?}", code);
match code {
- ObligationCauseCode::BuiltinDerivedObligation(derived_obligation)
+ ObligationCauseCode::DerivedObligation(derived_obligation)
+ | ObligationCauseCode::BuiltinDerivedObligation(derived_obligation)
| ObligationCauseCode::ImplDerivedObligation(derived_obligation) => {
let ty = derived_obligation.parent_trait_ref.self_ty();
debug!(
obligated_types,
);
}
+ ObligationCauseCode::DerivedObligation(ref data) => {
+ let parent_trait_ref = self.resolve_vars_if_possible(&data.parent_trait_ref);
+ let parent_predicate = parent_trait_ref.without_const().to_predicate();
+ self.note_obligation_cause_code(
+ err,
+ &parent_predicate,
+ &data.parent_code,
+ obligated_types,
+ );
+ }
ObligationCauseCode::CompareImplMethodObligation { .. } => {
err.note(&format!(
"the requirement `{}` appears on the impl method \
parent_trait_ref,
parent_code: Rc::new(obligation.cause.code.clone()),
};
- cause.code = traits::ObligationCauseCode::ImplDerivedObligation(derived_cause);
+ cause.code = traits::ObligationCauseCode::DerivedObligation(derived_cause);
}
extend_cause_with_original_assoc_item_obligation(
tcx,
| ^^^^^ `<L1 as Lam<&'a u8>>::App` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
|
= help: the trait `for<'a> std::fmt::Debug` is not implemented for `<L1 as Lam<&'a u8>>::App`
- = note: required because of the requirements on the impl of `for<'a> std::fmt::Debug` for `<<<<S1 as Case1>::C as std::iter::Iterator>::Item as std::iter::Iterator>::Item as Lam<&'a u8>>::App`
error[E0277]: `<<T as Case1>::C as std::iter::Iterator>::Item` is not an iterator
--> $DIR/bad-bounds-on-assoc-in-trait.rs:36:20
|
= help: the trait `std::fmt::Display` is not implemented for `T`
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
- = note: required because of the requirements on the impl of `std::fmt::Display` for `<T as UncheckedCopy>::Output`
help: consider restricting type parameter `T`
|
LL | impl<T: std::fmt::Display> UncheckedCopy for T {}
LL | impl<T> UncheckedCopy for T {}
| ^^^^^^^^^^^^^ the trait `std::ops::Deref` is not implemented for `T`
|
- = note: required because of the requirements on the impl of `std::ops::Deref` for `<T as UncheckedCopy>::Output`
help: consider restricting type parameter `T`
|
LL | impl<T: std::ops::Deref> UncheckedCopy for T {}
| ^^^^^^^^^^^^^ no implementation for `T += &'static str`
|
= help: the trait `std::ops::AddAssign<&'static str>` is not implemented for `T`
- = note: required because of the requirements on the impl of `std::ops::AddAssign<&'static str>` for `<T as UncheckedCopy>::Output`
help: consider restricting type parameter `T`
|
LL | impl<T: std::ops::AddAssign<&'static str>> UncheckedCopy for T {}
LL | impl<T> UncheckedCopy for T {}
| ^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `T`
|
- = note: required because of the requirements on the impl of `std::marker::Copy` for `<T as UncheckedCopy>::Output`
help: consider restricting type parameter `T`
|
LL | impl<T: std::marker::Copy> UncheckedCopy for T {}
|
= help: the trait `std::fmt::Display` is not implemented for `T`
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
- = note: required because of the requirements on the impl of `std::fmt::Display` for `<T as UncheckedCopy>::Output`
help: consider restricting type parameter `T`
|
LL | impl<T: std::fmt::Display> UncheckedCopy for T {}
LL | impl<T> UncheckedCopy for T {}
| ^^^^^^^^^^^^^ the trait `std::ops::Deref` is not implemented for `T`
|
- = note: required because of the requirements on the impl of `std::ops::Deref` for `<T as UncheckedCopy>::Output`
help: consider restricting type parameter `T`
|
LL | impl<T: std::ops::Deref> UncheckedCopy for T {}
| ^^^^^^^^^^^^^ no implementation for `T += &'static str`
|
= help: the trait `std::ops::AddAssign<&'static str>` is not implemented for `T`
- = note: required because of the requirements on the impl of `std::ops::AddAssign<&'static str>` for `<T as UncheckedCopy>::Output`
help: consider restricting type parameter `T`
|
LL | impl<T: std::ops::AddAssign<&'static str>> UncheckedCopy for T {}
LL | impl<T> UncheckedCopy for T {}
| ^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `T`
|
- = note: required because of the requirements on the impl of `std::marker::Copy` for `<T as UncheckedCopy>::Output`
help: consider restricting type parameter `T`
|
LL | impl<T: std::marker::Copy> UncheckedCopy for T {}
...
LL | impl Foo<u32> for () {}
| ^^^^^^^^ the trait `std::default::Default` is not implemented for `(dyn std::string::ToString + 'static)`
- |
- = note: required because of the requirements on the impl of `std::default::Default` for `<() as Foo<u32>>::Out`
error[E0277]: the trait bound `(dyn std::string::ToString + 'static): std::default::Default` is not satisfied
--> $DIR/issue-43924.rs:11:6
...
LL | impl Foo<u64> for () {}
| ^^^^^^^^ the trait `std::default::Default` is not implemented for `(dyn std::string::ToString + 'static)`
- |
- = note: required because of the requirements on the impl of `std::default::Default` for `<() as Foo<u64>>::Out`
error: aborting due to 3 previous errors
...
LL | impl MPU for S { }
| ^^^ the trait `MyDisplay` is not implemented for `T`
- |
- = note: required because of the requirements on the impl of `MyDisplay` for `<S as MPU>::MpuConfig`
error: aborting due to 2 previous errors
...
LL | impl MPU for S { }
| ^^^ the trait `MyDisplay` is not implemented for `T`
- |
- = note: required because of the requirements on the impl of `MyDisplay` for `<S as MPU>::MpuConfig`
error: aborting due to 2 previous errors
...
LL | type Assoc = bool;
| ^^^^ the trait `Bar` is not implemented for `bool`
- |
- = note: required because of the requirements on the impl of `Bar` for `<() as Foo>::Assoc`
error[E0277]: the trait bound `bool: Bar` is not satisfied
--> $DIR/point-at-type-on-obligation-failure-2.rs:16:18
...
LL | type Assoc = bool;
| ^^^^ the trait `Bar` is not implemented for `bool`
- |
- = note: required because of the requirements on the impl of `Bar` for `<() as Baz>::Assoc`
error[E0277]: the trait bound `bool: Bar` is not satisfied
--> $DIR/point-at-type-on-obligation-failure-2.rs:24:18
...
LL | type Assoc = bool;
| ^^^^ the trait `Bar` is not implemented for `bool`
- |
- = note: required because of the requirements on the impl of `Bar` for `<() as Bat>::Assoc`
error: aborting due to 3 previous errors
|
= help: within `(T,)`, the trait `std::marker::Send` is not implemented for `T`
= note: required because it appears within the type `(T,)`
- = note: required because of the requirements on the impl of `std::marker::Send` for `(T,)`
help: consider further restricting this bound
|
LL | impl <T: Sync+'static + std::marker::Send> Foo for (T,) { }
|
= help: within `(T, T)`, the trait `std::marker::Sync` is not implemented for `T`
= note: required because it appears within the type `(T, T)`
- = note: required because of the requirements on the impl of `std::marker::Sync` for `(T, T)`
help: consider further restricting this bound
|
LL | impl <T: Send + std::marker::Sync> Foo for (T,T) { }
|
= help: within `X<T>`, the trait `std::marker::Send` is not implemented for `T`
= note: required because it appears within the type `X<T>`
- = note: required because of the requirements on the impl of `std::marker::Send` for `X<T>`
help: consider further restricting this bound
|
LL | impl <T:Sync+'static + std::marker::Send> RequiresRequiresShareAndSend for X<T> { }
| ^^^ `std::rc::Rc<i8>` cannot be sent between threads safely
|
= help: the trait `std::marker::Send` is not implemented for `std::rc::Rc<i8>`
- = note: required because of the requirements on the impl of `std::marker::Send` for `std::rc::Rc<i8>`
error: aborting due to previous error
| ^^^ `T` cannot be sent between threads safely
|
= help: the trait `std::marker::Send` is not implemented for `T`
- = note: required because of the requirements on the impl of `std::marker::Send` for `T`
help: consider further restricting this bound
|
LL | impl <T: Sync+'static + std::marker::Send> Foo for T { }
|
= help: the trait `std::marker::Sized` is not implemented for `[isize]`
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
- = note: required because of the requirements on the impl of `std::marker::Sized` for `[isize]`
error[E0277]: the size for values of type `[usize]` cannot be known at compilation time
--> $DIR/dst-sized-trait-param.rs:10:6
|
= help: the trait `std::marker::Sized` is not implemented for `[usize]`
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
- = note: required because of the requirements on the impl of `std::marker::Sized` for `[usize]`
error: aborting due to 2 previous errors
|
= help: the trait `std::marker::Sized` is not implemented for `[()]`
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
- = note: required because of the requirements on the impl of `std::marker::Sized` for `[()]`
error: aborting due to previous error
...
LL | impl Getter<isize> for isize {
| ^^^^^^^^^^^^^ the trait `Clone2` is not implemented for `isize`
- |
- = note: required because of the requirements on the impl of `Clone2` for `isize`
error: aborting due to previous error
|
= help: the trait `std::marker::Sized` is not implemented for `str`
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
- = note: required because of the requirements on the impl of `std::marker::Sized` for `str`
error: aborting due to 9 previous errors
LL | type Assoc = T;
| ^ the trait `std::marker::Copy` is not implemented for `T`
|
- = note: required because of the requirements on the impl of `std::marker::Copy` for `<T as Complete>::Assoc`
help: consider restricting type parameter `T`
|
LL | impl<T: std::marker::Copy> Complete for T {
LL | impl<T> Complete for T {}
| ^^^^^^^^ the trait `std::marker::Copy` is not implemented for `T`
|
- = note: required because of the requirements on the impl of `std::marker::Copy` for `T`
help: consider restricting type parameter `T`
|
LL | impl<T: std::marker::Copy> Complete for T {}
|
= help: the trait `std::marker::Sized` is not implemented for `(dyn Trait + 'static)`
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
- = note: required because of the requirements on the impl of `std::marker::Sized` for `<T as WithType>::Ctx`
error: aborting due to previous error
LL | pub trait Copy: Clone {
| ----- required by this bound in `std::marker::Copy`
|
- = note: required because of the requirements on the impl of `std::clone::Clone` for `Test1`
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Test2: std::clone::Clone` is not satisfied
LL | pub trait Copy: Clone {
| ----- required by this bound in `std::marker::Copy`
|
- = note: required because of the requirements on the impl of `std::clone::Clone` for `Test2`
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 5 previous errors
LL | default impl<U> Foo<'static, U> for () {}
| ^^^^^^^^^^^^^^^ the trait `std::cmp::Eq` is not implemented for `U`
|
- = note: required because of the requirements on the impl of `std::cmp::Eq` for `U`
help: consider restricting type parameter `U`
|
LL | default impl<U: std::cmp::Eq> Foo<'static, U> for () {}
| ^^^^^^^^^^^^^^^^^^^^^^ the trait `Child<A>` is not implemented for `<T as Parent>::Assoc`
|
= note: required because of the requirements on the impl of `Child<A>` for `ChildWrapper<<T as Parent>::Assoc>`
- = note: required because of the requirements on the impl of `Child<<ParentWrapper<T> as Parent>::Ty>` for `<ParentWrapper<T> as Parent>::Assoc`
error[E0277]: the trait bound `<T as Parent>::Assoc: Child<A>` is not satisfied
--> $DIR/missing-assoc-type-bound-restriction.rs:20:5
= note: required because of the requirements on the impl of `SourceDatabase` for `RootDatabase`
= note: required because of the requirements on the impl of `Query<RootDatabase>` for `ParseQuery`
= note: required because it appears within the type `SalsaStorage`
- = note: required because of the requirements on the impl of `std::marker::Sized` for `<RootDatabase as Database>::Storage`
error: aborting due to 2 previous errors
|
= help: the trait `std::marker::Sized` is not implemented for `X`
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
- = note: required because of the requirements on the impl of `std::marker::Sized` for `X`
error: aborting due to previous error
|
= help: the trait `std::marker::Sized` is not implemented for `X`
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
- = note: required because of the requirements on the impl of `std::marker::Sized` for `X`
error: aborting due to previous error