diff options
author | Nick Fitzgerald <fitzgen@gmail.com> | 2017-10-02 13:20:34 -0700 |
---|---|---|
committer | Nick Fitzgerald <fitzgen@gmail.com> | 2017-10-02 13:20:34 -0700 |
commit | 3b8278678afdc940f39c137e709b06c293145d83 (patch) | |
tree | 1ae45e4fd1f1ff49bbf4ff08af453ef791350b20 | |
parent | a8c34ed60da2539f9e784c039110d29c7b34fd89 (diff) |
Make `has_destructor` checks operate on TypeId
-rw-r--r-- | src/ir/analysis/derive_copy.rs | 2 | ||||
-rw-r--r-- | src/ir/context.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/ir/analysis/derive_copy.rs b/src/ir/analysis/derive_copy.rs index e4241b5b..ba8ad500 100644 --- a/src/ir/analysis/derive_copy.rs +++ b/src/ir/analysis/derive_copy.rs @@ -224,7 +224,7 @@ impl<'ctx> MonotoneFramework for CannotDeriveCopy<'ctx> { // NOTE: Take into account that while unions in C and C++ are copied by // default, the may have an explicit destructor in C++, so we can't // defer this check just for the union case. - if self.ctx.lookup_item_id_has_destructor(&id) { + if self.ctx.lookup_item_id_has_destructor(id.expect_type_id(self.ctx)) { trace!(" comp has destructor which cannot derive copy"); return self.insert(id); } diff --git a/src/ir/context.rs b/src/ir/context.rs index 1c85e738..0edf10be 100644 --- a/src/ir/context.rs +++ b/src/ir/context.rs @@ -1272,13 +1272,13 @@ impl BindgenContext { } /// Look up whether the item with `id` has a destructor. - pub fn lookup_item_id_has_destructor(&self, id: &ItemId) -> bool { + pub fn lookup_item_id_has_destructor(&self, id: TypeId) -> bool { assert!( self.in_codegen_phase(), "We only compute destructors when we enter codegen" ); - self.have_destructor.as_ref().unwrap().contains(id) + self.have_destructor.as_ref().unwrap().contains(&id.into()) } fn find_used_template_parameters(&mut self) { |