let o = self.resolve_vars_if_possible(o);
if !self.predicate_may_hold(&o) {
result = ProbeResult::NoMatch;
- possibly_unsatisfied_predicates.push((
- o.predicate,
- None,
- Some(o.cause),
- ));
+ let parent_o = o.clone();
+ let implied_obligations =
+ traits::elaborate_obligations(self.tcx, vec![o]);
+ for o in implied_obligations {
+ let parent = if o == parent_o {
+ None
+ } else {
+ if o.predicate.to_opt_poly_trait_pred().map(|p| p.def_id())
+ == self.tcx.lang_items().sized_trait()
+ {
+ // We don't care to talk about implicit `Sized` bounds.
+ continue;
+ }
+ Some(parent_o.predicate)
+ };
+ if !self.predicate_may_hold(&o) {
+ possibly_unsatisfied_predicates.push((
+ o.predicate,
+ parent,
+ Some(o.cause),
+ ));
+ }
+ }
}
}
}
| |
| doesn't satisfy `Value: Eq`
| doesn't satisfy `Value: Hash`
+ | doesn't satisfy `Value: PartialEq`
...
LL | hs.insert(Value(0));
| ^^^^^^
|
= note: the following trait bounds were not satisfied:
`Value: Eq`
+ `Value: PartialEq`
+ which is required by `Value: Eq`
`Value: Hash`
help: consider annotating `Value` with `#[derive(Eq, Hash, PartialEq)]`
|
--> $DIR/issue-91550.rs:26:9
|
LL | pub struct NoDerives;
- | -------------------- doesn't satisfy `NoDerives: Eq`
+ | --------------------
+ | |
+ | doesn't satisfy `NoDerives: Eq`
+ | doesn't satisfy `NoDerives: PartialEq`
LL |
LL | struct Object<T>(T);
| ---------------- method `use_eq` not found for this struct
LL | foo.use_eq();
| ^^^^^^ method cannot be called on `Object<NoDerives>` due to unsatisfied trait bounds
|
-note: trait bound `NoDerives: Eq` was not satisfied
+note: the following trait bounds were not satisfied:
+ `NoDerives: Eq`
+ `NoDerives: PartialEq`
--> $DIR/issue-91550.rs:15:9
|
LL | impl<T: Eq> Object<T> {
--> $DIR/issue-91550.rs:27:9
|
LL | pub struct NoDerives;
- | -------------------- doesn't satisfy `NoDerives: Ord`
+ | --------------------
+ | |
+ | doesn't satisfy `NoDerives: Eq`
+ | doesn't satisfy `NoDerives: Ord`
+ | doesn't satisfy `NoDerives: PartialEq`
+ | doesn't satisfy `NoDerives: PartialOrd`
LL |
LL | struct Object<T>(T);
| ---------------- method `use_ord` not found for this struct
LL | foo.use_ord();
| ^^^^^^^ method cannot be called on `Object<NoDerives>` due to unsatisfied trait bounds
|
-note: trait bound `NoDerives: Ord` was not satisfied
+note: the following trait bounds were not satisfied:
+ `NoDerives: Eq`
+ `NoDerives: Ord`
+ `NoDerives: PartialEq`
+ `NoDerives: PartialOrd`
--> $DIR/issue-91550.rs:18:9
|
LL | impl<T: Ord> Object<T> {
LL | pub struct NoDerives;
| --------------------
| |
+ | doesn't satisfy `NoDerives: Eq`
| doesn't satisfy `NoDerives: Ord`
+ | doesn't satisfy `NoDerives: PartialEq`
| doesn't satisfy `NoDerives: PartialOrd`
LL |
LL | struct Object<T>(T);
| ^^^^^^^^^^^^^^^^^^^^^^^ method cannot be called on `Object<NoDerives>` due to unsatisfied trait bounds
|
note: the following trait bounds were not satisfied:
+ `NoDerives: Eq`
`NoDerives: Ord`
+ `NoDerives: PartialEq`
`NoDerives: PartialOrd`
--> $DIR/issue-91550.rs:21:9
|
|
= note: the following trait bounds were not satisfied:
`T: Eq`
+ `T: PartialEq`
+ which is required by `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 {
- | ++++++++++++++++++++
+LL | fn is_subset<T>(this: &HashSet<T>, other: &HashSet<T>) -> bool where T: Eq, T: Hash, T: PartialEq {
+ | ++++++++++++++++++++++++++++++++++
error: aborting due to previous error