1
Fork 0

Don't elaborate non-obligations into obligations

This commit is contained in:
Michael Goulet 2023-03-26 20:33:54 +00:00
parent 96bd50dd47
commit 1ce4b37900
20 changed files with 112 additions and 131 deletions

View file

@ -258,11 +258,11 @@ impl<'tcx> LateLintPass<'tcx> for UnusedResults {
cx.tcx,
cx.tcx.explicit_item_bounds(def).iter().cloned(),
)
.find_map(|obligation| {
.find_map(|(pred, _span)| {
// We only look at the `DefId`, so it is safe to skip the binder here.
if let ty::PredicateKind::Clause(ty::Clause::Trait(
ref poly_trait_predicate,
)) = obligation.predicate.kind().skip_binder()
)) = pred.kind().skip_binder()
{
let def_id = poly_trait_predicate.trait_ref.def_id;