summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libbindgen/src/codegen/mod.rs9
-rw-r--r--libbindgen/tests/expectations/tests/constructors.rs18
2 files changed, 14 insertions, 13 deletions
diff --git a/libbindgen/src/codegen/mod.rs b/libbindgen/src/codegen/mod.rs
index f3181de7..bf516cd2 100644
--- a/libbindgen/src/codegen/mod.rs
+++ b/libbindgen/src/codegen/mod.rs
@@ -1359,13 +1359,14 @@ impl MethodCodegen for Method {
let mut stmts = vec![];
// If it's a constructor, we need to insert an extra parameter with a
- // variable called `tmp` we're going to create.
+ // variable called `__bindgen_tmp` we're going to create.
if self.is_constructor() {
let tmp_variable_decl =
- quote_stmt!(ctx.ext_cx(), let mut tmp = ::std::mem::uninitialized())
+ quote_stmt!(ctx.ext_cx(),
+ let mut __bindgen_tmp = ::std::mem::uninitialized())
.unwrap();
stmts.push(tmp_variable_decl);
- exprs[0] = quote_expr!(ctx.ext_cx(), &mut tmp);
+ exprs[0] = quote_expr!(ctx.ext_cx(), &mut __bindgen_tmp);
} else if !self.is_static() {
assert!(!exprs.is_empty());
exprs[0] = if self.is_const() {
@@ -1388,7 +1389,7 @@ impl MethodCodegen for Method {
});
if self.is_constructor() {
- stmts.push(quote_stmt!(ctx.ext_cx(), tmp).unwrap());
+ stmts.push(quote_stmt!(ctx.ext_cx(), __bindgen_tmp).unwrap());
}
let block = ast::Block {
diff --git a/libbindgen/tests/expectations/tests/constructors.rs b/libbindgen/tests/expectations/tests/constructors.rs
index 80c14057..95afb82d 100644
--- a/libbindgen/tests/expectations/tests/constructors.rs
+++ b/libbindgen/tests/expectations/tests/constructors.rs
@@ -29,15 +29,15 @@ impl Clone for TestOverload {
impl TestOverload {
#[inline]
pub unsafe fn new(arg1: ::std::os::raw::c_int) -> Self {
- let mut tmp = ::std::mem::uninitialized();
- TestOverload_TestOverload(&mut tmp, arg1);
- tmp
+ let mut __bindgen_tmp = ::std::mem::uninitialized();
+ TestOverload_TestOverload(&mut __bindgen_tmp, arg1);
+ __bindgen_tmp
}
#[inline]
pub unsafe fn new1(arg1: f64) -> Self {
- let mut tmp = ::std::mem::uninitialized();
- TestOverload_TestOverload1(&mut tmp, arg1);
- tmp
+ let mut __bindgen_tmp = ::std::mem::uninitialized();
+ TestOverload_TestOverload1(&mut __bindgen_tmp, arg1);
+ __bindgen_tmp
}
}
#[repr(C)]
@@ -60,8 +60,8 @@ impl Clone for TestPublicNoArgs {
impl TestPublicNoArgs {
#[inline]
pub unsafe fn new() -> Self {
- let mut tmp = ::std::mem::uninitialized();
- TestPublicNoArgs_TestPublicNoArgs(&mut tmp);
- tmp
+ let mut __bindgen_tmp = ::std::mem::uninitialized();
+ TestPublicNoArgs_TestPublicNoArgs(&mut __bindgen_tmp);
+ __bindgen_tmp
}
}