Skip to content

Commit 344c704

Browse files
jieyouxugitbot
authored and
gitbot
committed
Rollup merge of rust-lang#135491 - RalfJung:remove-dead-rustc_allowed_through_unstable_modules, r=Mark-Simulacrum
Remove dead rustc_allowed_through_unstable_modules for std::os::fd contents As far as I was able to reconstruct, the history here is roughly as follows: - rust-lang#99723 added some `rustc_allowed_through_unstable_modules` to the types in `std::os::fd::raw` since they were accessible on stable via the unstable `std::os::wasi::io::AsRawFd` path. (This was needed to fix rust-lang#99502.) - Shortly thereafter, rust-lang#98368 re-organized things so that instead of re-exporting from an internal `std::os::wasi::io::raw`, `std::os::wasi::io::AsRawFd` is now directly re-exported from `std::os::fd`. This also made `library/std/src/os/wasi/io/raw.rs` entirely dead code as far as I can tell, it's not imported by anything any more. - Shortly thereafter, rust-lang#103308 stabilizes `std::os::wasi::io`, so `rustc_allowed_through_unstable_modules` is not needed any more to access `std::os::wasi::io::AsRawFd`. There is even a comment in `library/std/src/os/wasi/io/raw.rs` saying the attribute can be removed now, but that file is dead code so it is not touched as part of the stabilization. I did a grep for `pub use crate::os::fd` and all the re-exports I could find are in stable modules. So given all that, we can remove the `rustc_allowed_through_unstable_modules` (hoping they are not also re-exported somewhere else, it's really hard to be sure about this). I have checked that std still builds after this PR on the wasm32-wasip2 target.
2 parents 2592843 + b1b054e commit 344c704

File tree

5 files changed

+4
-34
lines changed

5 files changed

+4
-34
lines changed

std/src/os/fd/raw.rs

-5
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,9 @@ use crate::sys_common::{AsInner, IntoInner};
1919
use crate::{fs, io};
2020

2121
/// Raw file descriptors.
22-
#[rustc_allowed_through_unstable_modules]
2322
#[stable(feature = "rust1", since = "1.0.0")]
2423
#[cfg(not(target_os = "hermit"))]
2524
pub type RawFd = raw::c_int;
26-
#[rustc_allowed_through_unstable_modules]
2725
#[stable(feature = "rust1", since = "1.0.0")]
2826
#[cfg(target_os = "hermit")]
2927
pub type RawFd = i32;
@@ -33,7 +31,6 @@ pub type RawFd = i32;
3331
/// This is only available on unix and WASI platforms and must be imported in
3432
/// order to call the method. Windows platforms have a corresponding
3533
/// `AsRawHandle` and `AsRawSocket` set of traits.
36-
#[rustc_allowed_through_unstable_modules]
3734
#[stable(feature = "rust1", since = "1.0.0")]
3835
pub trait AsRawFd {
3936
/// Extracts the raw file descriptor.
@@ -67,7 +64,6 @@ pub trait AsRawFd {
6764

6865
/// A trait to express the ability to construct an object from a raw file
6966
/// descriptor.
70-
#[rustc_allowed_through_unstable_modules]
7167
#[stable(feature = "from_raw_os", since = "1.1.0")]
7268
pub trait FromRawFd {
7369
/// Constructs a new instance of `Self` from the given raw file
@@ -112,7 +108,6 @@ pub trait FromRawFd {
112108

113109
/// A trait to express the ability to consume an object and acquire ownership of
114110
/// its raw file descriptor.
115-
#[rustc_allowed_through_unstable_modules]
116111
#[stable(feature = "into_raw_os", since = "1.4.0")]
117112
pub trait IntoRawFd {
118113
/// Consumes this object, returning the raw underlying file descriptor.

std/src/os/wasi/io/fd.rs

-9
This file was deleted.

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

+4
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@
44

55
#[stable(feature = "io_safety_wasi", since = "1.65.0")]
66
pub use crate::os::fd::*;
7+
8+
// Tests for this module
9+
#[cfg(test)]
10+
mod tests;

std/src/os/wasi/io/raw.rs

-20
This file was deleted.
File renamed without changes.

0 commit comments

Comments
 (0)