Skip to content

Commit 4dce373

Browse files
committed
codegen: Rename the destructor methods to "destruct".
1 parent 4044876 commit 4dce373

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

src/codegen/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1720,7 +1720,7 @@ impl MethodCodegen for Method {
17201720
let signature_item = ctx.resolve_item(function.signature());
17211721
let mut name = match self.kind() {
17221722
MethodKind::Constructor => "new".into(),
1723-
MethodKind::Destructor => "__bindgen_destructor__".into(),
1723+
MethodKind::Destructor => "destruct".into(),
17241724
_ => function.name().to_owned(),
17251725
};
17261726

tests/expectations/tests/gen-destructors.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,5 @@ extern "C" {
2727
}
2828
impl Foo {
2929
#[inline]
30-
pub unsafe fn __bindgen_destructor__(&mut self) {
31-
Foo_Foo_destructor(&mut *self)
32-
}
30+
pub unsafe fn destruct(&mut self) { Foo_Foo_destructor(&mut *self) }
3331
}

tests/expectations/tests/public-dtor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ extern "C" {
2222
}
2323
impl cv_String {
2424
#[inline]
25-
pub unsafe fn __bindgen_destructor__(&mut self) {
25+
pub unsafe fn destruct(&mut self) {
2626
cv_String_String_destructor(&mut *self)
2727
}
2828
}

tests/expectations/tests/union_dtor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ extern "C" {
5858
}
5959
impl UnionWithDtor {
6060
#[inline]
61-
pub unsafe fn __bindgen_destructor__(&mut self) {
61+
pub unsafe fn destruct(&mut self) {
6262
UnionWithDtor_UnionWithDtor_destructor(&mut *self)
6363
}
6464
}

0 commit comments

Comments
 (0)