File tree 2 files changed +7
-2
lines changed
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;
16
16
use rustc_span:: { sym, Symbol } ;
17
17
use std:: hash:: { Hash , Hasher } ;
18
18
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
+
19
23
/// Type used to check whether two ast are the same. This is different from the
20
24
/// operator `==` on ast types as this operator would compare true equality with
21
25
/// ID and span.
@@ -26,7 +30,7 @@ pub struct SpanlessEq<'a, 'tcx> {
26
30
cx : & ' a LateContext < ' tcx > ,
27
31
maybe_typeck_results : Option < ( & ' tcx TypeckResults < ' tcx > , & ' tcx TypeckResults < ' tcx > ) > ,
28
32
allow_side_effects : bool ,
29
- expr_fallback : Option < Box < dyn FnMut ( & Expr < ' _ > , & Expr < ' _ > ) -> bool + ' a > > ,
33
+ expr_fallback : Option < Box < SpanlessEqCallback < ' a > > > ,
30
34
}
31
35
32
36
impl < ' 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.:
153
153
154
154
const BUG_REPORT_URL : & str = "https://github.com/rust-lang/rust-clippy/issues/new" ;
155
155
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 ( || {
157
158
let hook = panic:: take_hook ( ) ;
158
159
panic:: set_hook ( Box :: new ( |info| report_clippy_ice ( info, BUG_REPORT_URL ) ) ) ;
159
160
hook
You can’t perform that action at this time.
0 commit comments