Skip to content

Clean up left over derive debug nits #873

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/ir/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ pub struct BindgenContext<'ctx> {
///
/// This is populated when we enter codegen by `compute_can_derive_debug`
/// and is always `None` before that and `Some` after.
cant_derive_debug: Option<HashSet<ItemId>>,
cannot_derive_debug: Option<HashSet<ItemId>>,

/// The set of (`ItemId`s of) types that can't derive default.
///
Expand Down Expand Up @@ -318,7 +318,7 @@ impl<'ctx> BindgenContext<'ctx> {
used_template_parameters: None,
need_bitfield_allocation: Default::default(),
needs_mangling_hack: needs_mangling_hack,
cant_derive_debug: None,
cannot_derive_debug: None,
cannot_derive_default: None,
have_vtable: None,
};
Expand Down Expand Up @@ -793,7 +793,7 @@ impl<'ctx> BindgenContext<'ctx> {

self.compute_has_vtable();
self.find_used_template_parameters();
self.compute_cant_derive_debug();
self.compute_cannot_derive_debug();
self.compute_cannot_derive_default();

let ret = cb(self);
Expand Down Expand Up @@ -1762,9 +1762,9 @@ impl<'ctx> BindgenContext<'ctx> {
}

/// Compute whether we can derive debug.
fn compute_cant_derive_debug(&mut self) {
assert!(self.cant_derive_debug.is_none());
self.cant_derive_debug = Some(analyze::<CannotDeriveDebug>(self));
fn compute_cannot_derive_debug(&mut self) {
assert!(self.cannot_derive_debug.is_none());
self.cannot_derive_debug = Some(analyze::<CannotDeriveDebug>(self));
}

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

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

/// Compute whether we can derive default.
Expand Down
4 changes: 1 addition & 3 deletions src/ir/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,8 @@ pub struct Item {
parent_id: ItemId,
/// The item kind.
kind: ItemKind,
/// Detect cycles when determining if we can derive debug/copy or not, and
/// Detect cycles when determining if we can derive copy or not, and
/// avoid infinite recursion.
detect_derive_debug_cycle: Cell<bool>,
detect_derive_copy_cycle: Cell<bool>,
}

Expand Down Expand Up @@ -409,7 +408,6 @@ impl Item {
comment: comment,
annotations: annotations.unwrap_or_default(),
kind: kind,
detect_derive_debug_cycle: Cell::new(false),
detect_derive_copy_cycle: Cell::new(false),
}
}
Expand Down