From de5943aea4a44d7e748ac4b038512bf7e734fb6e Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Tue, 5 Nov 2019 02:50:42 +0000 Subject: [PATCH] Ignore clippy::not_unsafe_ptr_arg_deref lint --- librustzcash/src/rustzcash.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/librustzcash/src/rustzcash.rs b/librustzcash/src/rustzcash.rs index f166bd9..83d24d0 100644 --- a/librustzcash/src/rustzcash.rs +++ b/librustzcash/src/rustzcash.rs @@ -1,5 +1,19 @@ // Catch documentation errors caused by code changes. #![deny(intra_doc_link_resolution_failure)] +// Clippy has a default-deny lint to prevent dereferencing raw pointer arguments +// in a non-unsafe function. However, declaring a function as unsafe has the +// side-effect that the entire function body is treated as an unsafe {} block, +// and rustc will not enforce full safety checks on the parts of the function +// that would otherwise be safe. +// +// The functions in this crate are all for FFI usage, so it's obvious to the +// caller (which is only ever zcashd) that the arguments must satisfy the +// necessary assumptions. We therefore ignore this lint to retain the benefit of +// explicitly annotating the parts of each function that must themselves satisfy +// assumptions of underlying code. +// +// See https://github.com/rust-lang/rfcs/pull/2585 for more background. +#![allow(clippy::not_unsafe_ptr_arg_deref)] use bellman::{ gadgets::multipack,