1
Fork 0

Separate bounds and predicates for associated/opaque types

This commit is contained in:
Matthew Jasper 2020-06-27 21:36:35 +01:00
parent d297147e62
commit f958e6c246
107 changed files with 923 additions and 1117 deletions

View file

@ -200,7 +200,7 @@ impl<'tcx> LateLintPass<'tcx> for UnusedResults {
ty::Adt(def, _) => check_must_use_def(cx, def.did, span, descr_pre, descr_post),
ty::Opaque(def, _) => {
let mut has_emitted = false;
for (predicate, _) in cx.tcx.predicates_of(def).predicates {
for &(predicate, _) in cx.tcx.explicit_item_bounds(def) {
// We only look at the `DefId`, so it is safe to skip the binder here.
if let ty::PredicateAtom::Trait(ref poly_trait_predicate, _) =
predicate.skip_binders()