Skip to content

Commit bf9b39a

Browse files
committed
Fix dogfood
1 parent f26cf11 commit bf9b39a

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

clippy_utils/src/hir_utils.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ use rustc_middle::ty::TypeckResults;
1616
use rustc_span::{sym, Symbol};
1717
use std::hash::{Hash, Hasher};
1818

19+
/// Callback that is called when two expressions are not equal in the sense of `SpanlessEq`, but
20+
/// other conditions would make them equal.
21+
type SpanlessEqCallback<'a> = dyn FnMut(&Expr<'_>, &Expr<'_>) -> bool + 'a;
22+
1923
/// Type used to check whether two ast are the same. This is different from the
2024
/// operator `==` on ast types as this operator would compare true equality with
2125
/// ID and span.
@@ -26,7 +30,7 @@ pub struct SpanlessEq<'a, 'tcx> {
2630
cx: &'a LateContext<'tcx>,
2731
maybe_typeck_results: Option<(&'tcx TypeckResults<'tcx>, &'tcx TypeckResults<'tcx>)>,
2832
allow_side_effects: bool,
29-
expr_fallback: Option<Box<dyn FnMut(&Expr<'_>, &Expr<'_>) -> bool + 'a>>,
33+
expr_fallback: Option<Box<SpanlessEqCallback<'a>>>,
3034
}
3135

3236
impl<'a, 'tcx> SpanlessEq<'a, 'tcx> {

src/driver.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ You can use tool lints to allow or deny lints from your code, eg.:
153153

154154
const BUG_REPORT_URL: &str = "https://github.com/rust-lang/rust-clippy/issues/new";
155155

156-
static ICE_HOOK: LazyLock<Box<dyn Fn(&panic::PanicInfo<'_>) + Sync + Send + 'static>> = LazyLock::new(|| {
156+
type PanicCallback = dyn Fn(&panic::PanicInfo<'_>) + Sync + Send + 'static;
157+
static ICE_HOOK: LazyLock<Box<PanicCallback>> = LazyLock::new(|| {
157158
let hook = panic::take_hook();
158159
panic::set_hook(Box::new(|info| report_clippy_ice(info, BUG_REPORT_URL)));
159160
hook

0 commit comments

Comments
 (0)