diff options
-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) { |