File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,10 @@ use rustc_middle::ty::TypeckResults;
1616use rustc_span:: { sym, Symbol } ;
1717use 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
3236impl < ' a , ' tcx > SpanlessEq < ' a , ' tcx > {
Original file line number Diff line number Diff line change @@ -153,7 +153,8 @@ You can use tool lints to allow or deny lints from your code, eg.:
153153
154154const 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
You can’t perform that action at this time.
0 commit comments