Rollup merge of #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: - https://github.com/rust-lang/rust/pull/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 https://github.com/rust-lang/rust/issues/99502.) - Shortly thereafter, https://github.com/rust-lang/rust/pull/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, https://github.com/rust-lang/rust/pull/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.
This commit is contained in:
commit
e1e26f339d
5 changed files with 4 additions and 34 deletions
|
@ -19,11 +19,9 @@ use crate::sys_common::{AsInner, IntoInner};
|
||||||
use crate::{fs, io};
|
use crate::{fs, io};
|
||||||
|
|
||||||
/// Raw file descriptors.
|
/// Raw file descriptors.
|
||||||
#[rustc_allowed_through_unstable_modules]
|
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[cfg(not(target_os = "hermit"))]
|
#[cfg(not(target_os = "hermit"))]
|
||||||
pub type RawFd = raw::c_int;
|
pub type RawFd = raw::c_int;
|
||||||
#[rustc_allowed_through_unstable_modules]
|
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[cfg(target_os = "hermit")]
|
#[cfg(target_os = "hermit")]
|
||||||
pub type RawFd = i32;
|
pub type RawFd = i32;
|
||||||
|
@ -33,7 +31,6 @@ pub type RawFd = i32;
|
||||||
/// This is only available on unix and WASI platforms and must be imported in
|
/// This is only available on unix and WASI platforms and must be imported in
|
||||||
/// order to call the method. Windows platforms have a corresponding
|
/// order to call the method. Windows platforms have a corresponding
|
||||||
/// `AsRawHandle` and `AsRawSocket` set of traits.
|
/// `AsRawHandle` and `AsRawSocket` set of traits.
|
||||||
#[rustc_allowed_through_unstable_modules]
|
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
pub trait AsRawFd {
|
pub trait AsRawFd {
|
||||||
/// Extracts the raw file descriptor.
|
/// Extracts the raw file descriptor.
|
||||||
|
@ -67,7 +64,6 @@ pub trait AsRawFd {
|
||||||
|
|
||||||
/// A trait to express the ability to construct an object from a raw file
|
/// A trait to express the ability to construct an object from a raw file
|
||||||
/// descriptor.
|
/// descriptor.
|
||||||
#[rustc_allowed_through_unstable_modules]
|
|
||||||
#[stable(feature = "from_raw_os", since = "1.1.0")]
|
#[stable(feature = "from_raw_os", since = "1.1.0")]
|
||||||
pub trait FromRawFd {
|
pub trait FromRawFd {
|
||||||
/// Constructs a new instance of `Self` from the given raw file
|
/// Constructs a new instance of `Self` from the given raw file
|
||||||
|
@ -112,7 +108,6 @@ pub trait FromRawFd {
|
||||||
|
|
||||||
/// A trait to express the ability to consume an object and acquire ownership of
|
/// A trait to express the ability to consume an object and acquire ownership of
|
||||||
/// its raw file descriptor.
|
/// its raw file descriptor.
|
||||||
#[rustc_allowed_through_unstable_modules]
|
|
||||||
#[stable(feature = "into_raw_os", since = "1.4.0")]
|
#[stable(feature = "into_raw_os", since = "1.4.0")]
|
||||||
pub trait IntoRawFd {
|
pub trait IntoRawFd {
|
||||||
/// Consumes this object, returning the raw underlying file descriptor.
|
/// Consumes this object, returning the raw underlying file descriptor.
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
//! Owned and borrowed file descriptors.
|
|
||||||
|
|
||||||
#![unstable(feature = "wasi_ext", issue = "71213")]
|
|
||||||
|
|
||||||
// Tests for this module
|
|
||||||
#[cfg(test)]
|
|
||||||
mod tests;
|
|
||||||
|
|
||||||
pub use crate::os::fd::owned::*;
|
|
|
@ -4,3 +4,7 @@
|
||||||
|
|
||||||
#[stable(feature = "io_safety_wasi", since = "1.65.0")]
|
#[stable(feature = "io_safety_wasi", since = "1.65.0")]
|
||||||
pub use crate::os::fd::*;
|
pub use crate::os::fd::*;
|
||||||
|
|
||||||
|
// Tests for this module
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests;
|
||||||
|
|
|
@ -1,20 +0,0 @@
|
||||||
//! WASI-specific extensions to general I/O primitives.
|
|
||||||
|
|
||||||
#![unstable(feature = "wasi_ext", issue = "71213")]
|
|
||||||
|
|
||||||
// NOTE: despite the fact that this module is unstable,
|
|
||||||
// stable Rust had the capability to access the stable
|
|
||||||
// re-exported items from os::fd::raw through this
|
|
||||||
// unstable module.
|
|
||||||
// In PR #95956 the stability checker was changed to check
|
|
||||||
// all path segments of an item rather than just the last,
|
|
||||||
// which caused the aforementioned stable usage to regress
|
|
||||||
// (see issue #99502).
|
|
||||||
// As a result, the items in os::fd::raw were given the
|
|
||||||
// rustc_allowed_through_unstable_modules attribute.
|
|
||||||
// No regression tests were added to ensure this property,
|
|
||||||
// as CI is not configured to test wasm32-wasi.
|
|
||||||
// If this module is stabilized,
|
|
||||||
// you may want to remove those attributes
|
|
||||||
// (assuming no other unstable modules need them).
|
|
||||||
pub use crate::os::fd::raw::*;
|
|
Loading…
Add table
Add a link
Reference in a new issue