diff --git a/Cargo.toml b/Cargo.toml index 6978f49e07..a1db1fd434 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -79,7 +79,6 @@ used_underscore_binding = "allow" wildcard_imports = "allow" # TODO -borrow_as_ptr = "allow" trivially_copy_pass_by_ref = "allow" unused_self = "allow" diff --git a/bindgen/clang.rs b/bindgen/clang.rs index 2440bc0ae6..9afc6e93b1 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()); }