Skip to content

Commit be44e4d

Browse files
authored
Rollup merge of rust-lang#128432 - g0djan:godjan/wasi_prohibit_implicit_unsafe, r=tgross35
WASI: forbid `unsafe_op_in_unsafe_fn` for `std::{os, sys}` Part of rust-lang#127747 for WASI try-job: test-various
2 parents 4d7c095 + 8a61674 commit be44e4d

File tree

14 files changed

+24
-18
lines changed

14 files changed

+24
-18
lines changed

library/std/src/os/wasi/fs.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
//!
33
//! [`std::fs`]: crate::fs
44
5-
#![deny(unsafe_op_in_unsafe_fn)]
65
#![unstable(feature = "wasi_ext", issue = "71213")]
76

87
// Used for `File::read` on intra-doc links

library/std/src/os/wasi/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
3131
#![cfg_attr(not(target_env = "p2"), stable(feature = "rust1", since = "1.0.0"))]
3232
#![cfg_attr(target_env = "p2", unstable(feature = "wasip2", issue = "none"))]
33-
#![deny(unsafe_op_in_unsafe_fn)]
33+
#![forbid(unsafe_op_in_unsafe_fn)]
3434
#![doc(cfg(target_os = "wasi"))]
3535

3636
pub mod ffi;

library/std/src/os/wasip2/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
//!
33
//! This module is currently empty, but will be filled over time as wasi-libc support for WASI Preview 2 is stabilized.
44
5+
#![forbid(unsafe_op_in_unsafe_fn)]
56
#![stable(feature = "raw_ext", since = "1.1.0")]

library/std/src/sys/pal/wasi/args.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![deny(unsafe_op_in_unsafe_fn)]
1+
#![forbid(unsafe_op_in_unsafe_fn)]
22

33
use crate::ffi::{CStr, OsStr, OsString};
44
use crate::os::wasi::ffi::OsStrExt;

library/std/src/sys/pal/wasi/env.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![forbid(unsafe_op_in_unsafe_fn)]
2+
13
pub mod os {
24
pub const FAMILY: &str = "";
35
pub const OS: &str = "";

library/std/src/sys/pal/wasi/fd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![deny(unsafe_op_in_unsafe_fn)]
1+
#![forbid(unsafe_op_in_unsafe_fn)]
22
#![allow(dead_code)]
33

44
use super::err2io;

library/std/src/sys/pal/wasi/fs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![deny(unsafe_op_in_unsafe_fn)]
1+
#![forbid(unsafe_op_in_unsafe_fn)]
22

33
use super::fd::WasiFd;
44
use crate::ffi::{CStr, OsStr, OsString};

library/std/src/sys/pal/wasi/helpers.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![forbid(unsafe_op_in_unsafe_fn)]
2+
13
use crate::{io as std_io, mem};
24

35
#[inline]

library/std/src/sys/pal/wasi/io.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![deny(unsafe_op_in_unsafe_fn)]
1+
#![forbid(unsafe_op_in_unsafe_fn)]
22

33
use crate::marker::PhantomData;
44
use crate::os::fd::{AsFd, AsRawFd};

library/std/src/sys/pal/wasi/net.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![deny(unsafe_op_in_unsafe_fn)]
1+
#![forbid(unsafe_op_in_unsafe_fn)]
22

33
use super::err2io;
44
use super::fd::WasiFd;

0 commit comments

Comments
 (0)