diff options
| author | Michael Goulet <michael@errs.io> | 2023-03-26 20:33:54 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-03-26 20:33:54 +0000 |
| commit | db4e4afce8f87eb73db3808981215cd28e97095d (patch) | |
| tree | 1662e8eda235b075f9c7097c48d76913961ec302 /clippy_lints/src | |
| parent | 8df896c076fd993bad58878ee8a6ed29d8e586ba (diff) | |
| download | rust-db4e4afce8f87eb73db3808981215cd28e97095d.tar.gz rust-db4e4afce8f87eb73db3808981215cd28e97095d.zip | |
Don't elaborate non-obligations into obligations
Diffstat (limited to 'clippy_lints/src')
| -rw-r--r-- | clippy_lints/src/needless_pass_by_value.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clippy_lints/src/needless_pass_by_value.rs b/clippy_lints/src/needless_pass_by_value.rs index 1ab81aee7b8..327e090d38b 100644 --- a/clippy_lints/src/needless_pass_by_value.rs +++ b/clippy_lints/src/needless_pass_by_value.rs @@ -124,9 +124,9 @@ impl<'tcx> LateLintPass<'tcx> for NeedlessPassByValue { let preds = traits::elaborate_predicates(cx.tcx, cx.param_env.caller_bounds().iter()) .filter(|p| !p.is_global()) - .filter_map(|obligation| { + .filter_map(|pred| { // Note that we do not want to deal with qualified predicates here. - match obligation.predicate.kind().no_bound_vars() { + match pred.kind().no_bound_vars() { Some(ty::PredicateKind::Clause(ty::Clause::Trait(pred))) if pred.def_id() != sized_trait => { Some(pred) }, |
