about summary refs log tree commit diff
path: root/clippy_utils/src
diff options
context:
space:
mode:
authorPhilipp Krones <hello@philkrones.com>2022-06-30 10:28:04 +0200
committerPhilipp Krones <hello@philkrones.com>2022-06-30 10:28:04 +0200
commitbf9b39ae7df5cca418fd2afc25b30a5632b32c23 (patch)
treefaa195808c3128e84e4af60a7bb2aceaef068799 /clippy_utils/src
parentf26cf11fe88e1b5bb51d0bd7515941fe51d5739d (diff)
downloadrust-bf9b39ae7df5cca418fd2afc25b30a5632b32c23.tar.gz
rust-bf9b39ae7df5cca418fd2afc25b30a5632b32c23.zip
Fix dogfood
Diffstat (limited to 'clippy_utils/src')
-rw-r--r--clippy_utils/src/hir_utils.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/clippy_utils/src/hir_utils.rs b/clippy_utils/src/hir_utils.rs
index 74ef2c1bebb..793e3cc58c2 100644
--- a/clippy_utils/src/hir_utils.rs
+++ b/clippy_utils/src/hir_utils.rs
@@ -16,6 +16,10 @@ use rustc_middle::ty::TypeckResults;
 use rustc_span::{sym, Symbol};
 use std::hash::{Hash, Hasher};
 
+/// Callback that is called when two expressions are not equal in the sense of `SpanlessEq`, but
+/// other conditions would make them equal.
+type SpanlessEqCallback<'a> = dyn FnMut(&Expr<'_>, &Expr<'_>) -> bool + 'a;
+
 /// Type used to check whether two ast are the same. This is different from the
 /// operator `==` on ast types as this operator would compare true equality with
 /// ID and span.
@@ -26,7 +30,7 @@ pub struct SpanlessEq<'a, 'tcx> {
     cx: &'a LateContext<'tcx>,
     maybe_typeck_results: Option<(&'tcx TypeckResults<'tcx>, &'tcx TypeckResults<'tcx>)>,
     allow_side_effects: bool,
-    expr_fallback: Option<Box<dyn FnMut(&Expr<'_>, &Expr<'_>) -> bool + 'a>>,
+    expr_fallback: Option<Box<SpanlessEqCallback<'a>>>,
 }
 
 impl<'a, 'tcx> SpanlessEq<'a, 'tcx> {