Skip to content

Commit 09abb26

Browse files
author
bors-servo
authored
Auto merge of #873 - photoszzt:cleanup_derive_debug, r=fitzgen
Clean up left over derive debug nits r? @fitzgen
2 parents d1d3500 + 7388cb5 commit 09abb26

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

src/ir/context.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ pub struct BindgenContext<'ctx> {
180180
///
181181
/// This is populated when we enter codegen by `compute_can_derive_debug`
182182
/// and is always `None` before that and `Some` after.
183-
cant_derive_debug: Option<HashSet<ItemId>>,
183+
cannot_derive_debug: Option<HashSet<ItemId>>,
184184

185185
/// The set of (`ItemId`s of) types that can't derive default.
186186
///
@@ -318,7 +318,7 @@ impl<'ctx> BindgenContext<'ctx> {
318318
used_template_parameters: None,
319319
need_bitfield_allocation: Default::default(),
320320
needs_mangling_hack: needs_mangling_hack,
321-
cant_derive_debug: None,
321+
cannot_derive_debug: None,
322322
cannot_derive_default: None,
323323
have_vtable: None,
324324
};
@@ -793,7 +793,7 @@ impl<'ctx> BindgenContext<'ctx> {
793793

794794
self.compute_has_vtable();
795795
self.find_used_template_parameters();
796-
self.compute_cant_derive_debug();
796+
self.compute_cannot_derive_debug();
797797
self.compute_cannot_derive_default();
798798

799799
let ret = cb(self);
@@ -1762,9 +1762,9 @@ impl<'ctx> BindgenContext<'ctx> {
17621762
}
17631763

17641764
/// Compute whether we can derive debug.
1765-
fn compute_cant_derive_debug(&mut self) {
1766-
assert!(self.cant_derive_debug.is_none());
1767-
self.cant_derive_debug = Some(analyze::<CannotDeriveDebug>(self));
1765+
fn compute_cannot_derive_debug(&mut self) {
1766+
assert!(self.cannot_derive_debug.is_none());
1767+
self.cannot_derive_debug = Some(analyze::<CannotDeriveDebug>(self));
17681768
}
17691769

17701770
/// Look up whether the item with `id` can
@@ -1775,7 +1775,7 @@ impl<'ctx> BindgenContext<'ctx> {
17751775

17761776
// Look up the computed value for whether the item with `id` can
17771777
// derive debug or not.
1778-
!self.cant_derive_debug.as_ref().unwrap().contains(&id)
1778+
!self.cannot_derive_debug.as_ref().unwrap().contains(&id)
17791779
}
17801780

17811781
/// Compute whether we can derive default.

src/ir/item.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,9 +379,8 @@ pub struct Item {
379379
parent_id: ItemId,
380380
/// The item kind.
381381
kind: ItemKind,
382-
/// Detect cycles when determining if we can derive debug/copy or not, and
382+
/// Detect cycles when determining if we can derive copy or not, and
383383
/// avoid infinite recursion.
384-
detect_derive_debug_cycle: Cell<bool>,
385384
detect_derive_copy_cycle: Cell<bool>,
386385
}
387386

@@ -409,7 +408,6 @@ impl Item {
409408
comment: comment,
410409
annotations: annotations.unwrap_or_default(),
411410
kind: kind,
412-
detect_derive_debug_cycle: Cell::new(false),
413411
detect_derive_copy_cycle: Cell::new(false),
414412
}
415413
}

0 commit comments

Comments
 (0)