Skip to content

Commit db4e4af

Browse files
Don't elaborate non-obligations into obligations
1 parent 8df896c commit db4e4af

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

clippy_lints/src/needless_pass_by_value.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ impl<'tcx> LateLintPass<'tcx> for NeedlessPassByValue {
124124

125125
let preds = traits::elaborate_predicates(cx.tcx, cx.param_env.caller_bounds().iter())
126126
.filter(|p| !p.is_global())
127-
.filter_map(|obligation| {
127+
.filter_map(|pred| {
128128
// Note that we do not want to deal with qualified predicates here.
129-
match obligation.predicate.kind().no_bound_vars() {
129+
match pred.kind().no_bound_vars() {
130130
Some(ty::PredicateKind::Clause(ty::Clause::Trait(pred))) if pred.def_id() != sized_trait => {
131131
Some(pred)
132132
},

clippy_utils/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2106,7 +2106,6 @@ pub fn fn_has_unsatisfiable_preds(cx: &LateContext<'_>, did: DefId) -> bool {
21062106
traits::impossible_predicates(
21072107
cx.tcx,
21082108
traits::elaborate_predicates(cx.tcx, predicates)
2109-
.map(|o| o.predicate)
21102109
.collect::<Vec<_>>(),
21112110
)
21122111
}

0 commit comments

Comments
 (0)