File tree 4 files changed +5
-17
lines changed
4 files changed +5
-17
lines changed Original file line number Diff line number Diff line change @@ -1414,7 +1414,7 @@ impl CodeGenerator for CompInfo {
1414
1414
1415
1415
let is_union = self . kind ( ) == CompKind :: Union ;
1416
1416
let mut derives = vec ! [ ] ;
1417
- if item. can_derive_debug ( ctx, ( ) ) {
1417
+ if item. can_derive_debug ( ctx) {
1418
1418
derives. push ( "Debug" ) ;
1419
1419
}
1420
1420
Original file line number Diff line number Diff line change @@ -40,10 +40,8 @@ impl ItemId {
40
40
}
41
41
42
42
impl CanDeriveDebug for ItemId {
43
- type Extra = ( ) ;
44
-
45
- fn can_derive_debug ( & self , ctx : & BindgenContext , _: ( ) ) -> bool {
46
- ctx. resolve_item ( * self ) . can_derive_debug ( ctx, ( ) )
43
+ fn can_derive_debug ( & self , ctx : & BindgenContext ) -> bool {
44
+ ctx. options ( ) . derive_debug && ctx. lookup_item_id_can_derive_debug ( * self )
47
45
}
48
46
}
49
47
Original file line number Diff line number Diff line change @@ -10,17 +10,9 @@ use super::context::BindgenContext;
10
10
/// derive debug or not, because of the limit rust has on 32 items as max in the
11
11
/// array.
12
12
pub trait CanDeriveDebug {
13
- /// Implementations can define this type to get access to any extra
14
- /// information required to determine whether they can derive `Debug`. If
15
- /// extra information is unneeded, then this should simply be the unit type.
16
- type Extra ;
17
-
18
13
/// Return `true` if `Debug` can be derived for this thing, `false`
19
14
/// otherwise.
20
- fn can_derive_debug ( & self ,
21
- ctx : & BindgenContext ,
22
- extra : Self :: Extra )
23
- -> bool ;
15
+ fn can_derive_debug ( & self , ctx : & BindgenContext ) -> bool ;
24
16
}
25
17
26
18
/// A trait that encapsulates the logic for whether or not we can derive `Debug`.
Original file line number Diff line number Diff line change @@ -271,9 +271,7 @@ impl Trace for Item {
271
271
}
272
272
273
273
impl CanDeriveDebug for Item {
274
- type Extra = ( ) ;
275
-
276
- fn can_derive_debug ( & self , ctx : & BindgenContext , _: ( ) ) -> bool {
274
+ fn can_derive_debug ( & self , ctx : & BindgenContext ) -> bool {
277
275
ctx. options ( ) . derive_debug && ctx. lookup_item_id_can_derive_debug ( self . id ( ) )
278
276
}
279
277
}
You can’t perform that action at this time.
0 commit comments