diff options
-rw-r--r-- | src/codegen/mod.rs | 6 | ||||
-rw-r--r-- | tests/expectations/tests/bitfield-method-same-name.rs | 6 | ||||
-rw-r--r-- | tests/expectations/tests/class.rs | 6 | ||||
-rw-r--r-- | tests/expectations/tests/class_with_typedef.rs | 8 | ||||
-rw-r--r-- | tests/expectations/tests/gen-destructors.rs | 2 | ||||
-rw-r--r-- | tests/expectations/tests/issue-410.rs | 2 | ||||
-rw-r--r-- | tests/expectations/tests/method-mangling.rs | 4 | ||||
-rw-r--r-- | tests/expectations/tests/namespace.rs | 2 | ||||
-rw-r--r-- | tests/expectations/tests/public-dtor.rs | 4 | ||||
-rw-r--r-- | tests/expectations/tests/union_dtor.rs | 2 |
10 files changed, 17 insertions, 25 deletions
diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs index 72c03c37..5586c146 100644 --- a/src/codegen/mod.rs +++ b/src/codegen/mod.rs @@ -1821,11 +1821,7 @@ impl MethodCodegen for Method { 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() { - quote_expr!(ctx.ext_cx(), &*self) - } else { - quote_expr!(ctx.ext_cx(), &mut *self) - }; + exprs[0] = quote_expr!(ctx.ext_cx(), self); }; let call = aster::expr::ExprBuilder::new() diff --git a/tests/expectations/tests/bitfield-method-same-name.rs b/tests/expectations/tests/bitfield-method-same-name.rs index 9222f74d..e180153b 100644 --- a/tests/expectations/tests/bitfield-method-same-name.rs +++ b/tests/expectations/tests/bitfield-method-same-name.rs @@ -54,14 +54,14 @@ impl Foo { } #[inline] pub unsafe fn type_(&mut self) -> ::std::os::raw::c_schar { - Foo_type(&mut *self) + Foo_type(self) } #[inline] pub unsafe fn set_type_(&mut self, c: ::std::os::raw::c_schar) { - Foo_set_type_(&mut *self, c) + Foo_set_type_(self, c) } #[inline] pub unsafe fn set_type(&mut self, c: ::std::os::raw::c_schar) { - Foo_set_type(&mut *self, c) + Foo_set_type(self, c) } } diff --git a/tests/expectations/tests/class.rs b/tests/expectations/tests/class.rs index 3ed5edd2..edb2697b 100644 --- a/tests/expectations/tests/class.rs +++ b/tests/expectations/tests/class.rs @@ -283,14 +283,14 @@ impl Clone for RealAbstractionWithTonsOfMethods { } impl RealAbstractionWithTonsOfMethods { #[inline] - pub unsafe fn bar(&self) { RealAbstractionWithTonsOfMethods_bar(&*self) } + pub unsafe fn bar(&self) { RealAbstractionWithTonsOfMethods_bar(self) } #[inline] pub unsafe fn bar1(&mut self) { - RealAbstractionWithTonsOfMethods_bar1(&mut *self) + RealAbstractionWithTonsOfMethods_bar1(self) } #[inline] pub unsafe fn bar2(&mut self, foo: ::std::os::raw::c_int) { - RealAbstractionWithTonsOfMethods_bar2(&mut *self, foo) + RealAbstractionWithTonsOfMethods_bar2(self, foo) } #[inline] pub unsafe fn sta() { RealAbstractionWithTonsOfMethods_sta() } diff --git a/tests/expectations/tests/class_with_typedef.rs b/tests/expectations/tests/class_with_typedef.rs index 03822233..e962992d 100644 --- a/tests/expectations/tests/class_with_typedef.rs +++ b/tests/expectations/tests/class_with_typedef.rs @@ -70,18 +70,18 @@ impl Default for C { } impl C { #[inline] - pub unsafe fn method(&mut self, c: C_MyInt) { C_method(&mut *self, c) } + pub unsafe fn method(&mut self, c: C_MyInt) { C_method(self, c) } #[inline] pub unsafe fn methodRef(&mut self, c: *mut C_MyInt) { - C_methodRef(&mut *self, c) + C_methodRef(self, c) } #[inline] pub unsafe fn complexMethodRef(&mut self, c: *mut C_Lookup) { - C_complexMethodRef(&mut *self, c) + C_complexMethodRef(self, c) } #[inline] pub unsafe fn anotherMethod(&mut self, c: AnotherInt) { - C_anotherMethod(&mut *self, c) + C_anotherMethod(self, c) } } #[repr(C)] diff --git a/tests/expectations/tests/gen-destructors.rs b/tests/expectations/tests/gen-destructors.rs index 4bbc8393..7ec13b03 100644 --- a/tests/expectations/tests/gen-destructors.rs +++ b/tests/expectations/tests/gen-destructors.rs @@ -27,5 +27,5 @@ extern "C" { } impl Foo { #[inline] - pub unsafe fn destruct(&mut self) { Foo_Foo_destructor(&mut *self) } + pub unsafe fn destruct(&mut self) { Foo_Foo_destructor(self) } } diff --git a/tests/expectations/tests/issue-410.rs b/tests/expectations/tests/issue-410.rs index 1f624fec..8833ef4e 100644 --- a/tests/expectations/tests/issue-410.rs +++ b/tests/expectations/tests/issue-410.rs @@ -34,7 +34,7 @@ pub mod root { impl Value { #[inline] pub unsafe fn a(&mut self, arg1: root::JSWhyMagic) { - Value_a(&mut *self, arg1) + Value_a(self, arg1) } } } diff --git a/tests/expectations/tests/method-mangling.rs b/tests/expectations/tests/method-mangling.rs index 23f12280..360f0ea7 100644 --- a/tests/expectations/tests/method-mangling.rs +++ b/tests/expectations/tests/method-mangling.rs @@ -25,7 +25,5 @@ impl Clone for Foo { } impl Foo { #[inline] - pub unsafe fn type_(&mut self) -> ::std::os::raw::c_int { - Foo_type(&mut *self) - } + pub unsafe fn type_(&mut self) -> ::std::os::raw::c_int { Foo_type(self) } } diff --git a/tests/expectations/tests/namespace.rs b/tests/expectations/tests/namespace.rs index 21b5a58b..8e64fa22 100644 --- a/tests/expectations/tests/namespace.rs +++ b/tests/expectations/tests/namespace.rs @@ -58,7 +58,7 @@ pub mod root { #[inline] pub unsafe fn lets_hope_this_works(&mut self) -> ::std::os::raw::c_int { - A_lets_hope_this_works(&mut *self) + A_lets_hope_this_works(self) } } } diff --git a/tests/expectations/tests/public-dtor.rs b/tests/expectations/tests/public-dtor.rs index 519cdf67..d24e863e 100644 --- a/tests/expectations/tests/public-dtor.rs +++ b/tests/expectations/tests/public-dtor.rs @@ -22,7 +22,5 @@ extern "C" { } impl cv_String { #[inline] - pub unsafe fn destruct(&mut self) { - cv_String_String_destructor(&mut *self) - } + pub unsafe fn destruct(&mut self) { cv_String_String_destructor(self) } } diff --git a/tests/expectations/tests/union_dtor.rs b/tests/expectations/tests/union_dtor.rs index af9a8c04..61fb0380 100644 --- a/tests/expectations/tests/union_dtor.rs +++ b/tests/expectations/tests/union_dtor.rs @@ -59,6 +59,6 @@ extern "C" { impl UnionWithDtor { #[inline] pub unsafe fn destruct(&mut self) { - UnionWithDtor_UnionWithDtor_destructor(&mut *self) + UnionWithDtor_UnionWithDtor_destructor(self) } } |