Add unsafe_op_in_unsafe_fn lint

Require explicit unsafe blocks inside unsafe functions to make
safety boundaries more precise. This is a forward-looking lint
that prevents future unsafe code from implicitly relying on the
enclosing unsafe fn.
This commit is contained in:
Sylvestre Ledru
2026-03-30 19:14:24 +02:00
parent 6bd2741792
commit f9f31f89d7
+1
View File
@@ -21,6 +21,7 @@
#![doc = include_str!("../README.md")]
// spell-checker:ignore (API) nodename osname sysname
// spell-checker:ignore (uutils) coreutils uutils
#![warn(unsafe_op_in_unsafe_fn)] // require explicit unsafe blocks inside unsafe fns
#![warn(unused_results)] // enable warnings for unused results
use std::ffi::OsStr;