diff --git a/Cargo.toml b/Cargo.toml index 27020eb32b..b41f503af6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -83,7 +83,6 @@ used_underscore_binding = "allow" wildcard_imports = "allow" # TODO -borrow_as_ptr = "allow" match_same_arms = "allow" trivially_copy_pass_by_ref = "allow" unused_self = "allow" diff --git a/bindgen/clang.rs b/bindgen/clang.rs index 66558bc8cc..5c59defd8a 100644 --- a/bindgen/clang.rs +++ b/bindgen/clang.rs @@ -494,7 +494,7 @@ impl Cursor { where Visitor: FnMut(Cursor) -> CXChildVisitResult, { - let data = &mut visitor as *mut Visitor; + let data = ptr::addr_of_mut!(visitor); unsafe { clang_visitChildren(self.x, visit_children::, data.cast()); }