Skip to content

Commit

Permalink
std: deny(unsafe_op_in_unsafe_fn) but allow sites
Browse files Browse the repository at this point in the history
This provides a list of locations to hunt down issues in.
  • Loading branch information
workingjubilee committed Jul 14, 2024
1 parent 3492a6b commit ac0fd27
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions std/src/collections/hash/map.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(unsafe_op_in_unsafe_fn)]

#[cfg(test)]
mod tests;

Expand Down
1 change: 1 addition & 0 deletions std/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
//! and those without will return a [`String`].
#![stable(feature = "env", since = "1.0.0")]
#![allow(unsafe_op_in_unsafe_fn)]

#[cfg(test)]
mod tests;
Expand Down
1 change: 1 addition & 0 deletions std/src/ffi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@
//! [`from_wide`]: crate::os::windows::ffi::OsStringExt::from_wide "os::windows::ffi::OsStringExt::from_wide"
#![stable(feature = "rust1", since = "1.0.0")]
#![allow(unsafe_op_in_unsafe_fn)]

#[unstable(feature = "c_str_module", issue = "112134")]
pub mod c_str;
Expand Down
1 change: 1 addition & 0 deletions std/src/io/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@
//! [`Arc`]: crate::sync::Arc
#![stable(feature = "rust1", since = "1.0.0")]
#![allow(unsafe_op_in_unsafe_fn)]

#[cfg(test)]
mod tests;
Expand Down
3 changes: 2 additions & 1 deletion std/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@
#![allow(internal_features)]
#![deny(rustc::existing_doc_keyword)]
#![deny(fuzzy_provenance_casts)]
#![deny(unsafe_op_in_unsafe_fn)]
#![allow(rustdoc::redundant_explicit_links)]
// Ensure that std can be linked against panic_abort despite compiled with `-C panic=unwind`
#![deny(ffi_unwind_calls)]
Expand Down Expand Up @@ -664,7 +665,7 @@ pub mod alloc;
mod panicking;

#[path = "../../backtrace/src/lib.rs"]
#[allow(dead_code, unused_attributes, fuzzy_provenance_casts)]
#[allow(dead_code, unused_attributes, fuzzy_provenance_casts, unsafe_op_in_unsafe_fn)]
mod backtrace_rs;

// Re-export macros defined in core.
Expand Down
1 change: 1 addition & 0 deletions std/src/os/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#![stable(feature = "os", since = "1.0.0")]
#![allow(missing_docs, nonstandard_style, missing_debug_implementations)]
#![allow(unsafe_op_in_unsafe_fn)]

pub mod raw;

Expand Down
1 change: 1 addition & 0 deletions std/src/sync/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@
//! [`RwLock`]: crate::sync::RwLock
#![stable(feature = "rust1", since = "1.0.0")]
#![allow(unsafe_op_in_unsafe_fn)]

#[stable(feature = "rust1", since = "1.0.0")]
pub use alloc_crate::sync::{Arc, Weak};
Expand Down
2 changes: 2 additions & 0 deletions std/src/sys/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(unsafe_op_in_unsafe_fn)]

/// The PAL (platform abstraction layer) contains platform-specific abstractions
/// for implementing the features in the other submodules, e.g. UNIX file
/// descriptors.
Expand Down
1 change: 1 addition & 0 deletions std/src/sys_common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#![allow(missing_docs)]
#![allow(missing_debug_implementations)]
#![allow(unsafe_op_in_unsafe_fn)]

#[cfg(test)]
mod tests;
Expand Down

0 comments on commit ac0fd27

Please sign in to comment.