Skip to content

Commit a239314

Browse files
committed
clippy: suppress ptr_offset and missing_safety_doc warnings
Suppress two clippy warnings in bindgen-generated code: - ptr_offset_with_cast: Generated code uses ptr::offset with usize->isize cast - missing_safety_doc: Auto-generated unsafe functions lack safety documentation These warnings are not actionable since the code is auto-generated by bindgen. Also updated the top comment of the wolfcrypt-rs/src/bindings.rs accordingly.
1 parent 1c598e4 commit a239314

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

wolfcrypt-rs/src/bindings.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
/*
2-
* These are used to suppress all the errors that rust complains
3-
* about our symbols and/or macro (since they don't follow rust's style
4-
* convention).
5-
* */
2+
* Allow attributes to suppress warnings in bindgen-generated code.
3+
* These warnings arise from:
4+
* - Naming conventions that don't match Rust style (e.g. from C symbols)
5+
* - Auto-generated unsafe code patterns
6+
* - Type/casting patterns common in C FFI but discouraged in pure Rust
7+
*
8+
* Since this code is auto-generated, these warnings cannot be fixed manually
9+
* and must be suppressed.
10+
*/
611
#![allow(dead_code)]
712
#![allow(non_upper_case_globals)]
813
#![allow(non_camel_case_types)]
@@ -11,4 +16,6 @@
1116
#![allow(clippy::upper_case_acronyms)]
1217
#![allow(clippy::too_many_arguments)]
1318
#![allow(improper_ctypes)]
19+
#![allow(clippy::missing_safety_doc)]
20+
#![allow(clippy::ptr_offset_with_cast)]
1421
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));

0 commit comments

Comments
 (0)