Skip to content

Commit b438e30

Browse files
committed
Track bound vars
1 parent d121b34 commit b438e30

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

clippy_lints/src/unit_return_expecting_ord.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ fn get_trait_predicates_for_trait_id<'tcx>(
4444
for (pred, _) in generics.predicates {
4545
if_chain! {
4646
if let PredicateKind::Trait(poly_trait_pred, _) = pred.kind().skip_binder();
47-
let trait_pred = cx.tcx.erase_late_bound_regions(ty::Binder::bind(poly_trait_pred));
47+
let trait_pred = cx.tcx.erase_late_bound_regions(pred.kind().rebind(poly_trait_pred));
4848
if let Some(trait_def_id) = trait_id;
4949
if trait_def_id == trait_pred.trait_ref.def_id;
5050
then {
@@ -58,12 +58,12 @@ fn get_trait_predicates_for_trait_id<'tcx>(
5858
fn get_projection_pred<'tcx>(
5959
cx: &LateContext<'tcx>,
6060
generics: GenericPredicates<'tcx>,
61-
pred: TraitPredicate<'tcx>,
61+
trait_pred: TraitPredicate<'tcx>,
6262
) -> Option<ProjectionPredicate<'tcx>> {
6363
generics.predicates.iter().find_map(|(proj_pred, _)| {
64-
if let ty::PredicateKind::Projection(proj_pred) = proj_pred.kind().skip_binder() {
65-
let projection_pred = cx.tcx.erase_late_bound_regions(ty::Binder::bind(proj_pred));
66-
if projection_pred.projection_ty.substs == pred.trait_ref.substs {
64+
if let ty::PredicateKind::Projection(pred) = proj_pred.kind().skip_binder() {
65+
let projection_pred = cx.tcx.erase_late_bound_regions(proj_pred.kind().rebind(pred));
66+
if projection_pred.projection_ty.substs == trait_pred.trait_ref.substs {
6767
return Some(projection_pred);
6868
}
6969
}

0 commit comments

Comments
 (0)