Skip to content

Commit f326692

Browse files
authored
Rollup merge of #99723 - bstrie:wasifd, r=yaahc
Allow using stable os::fd::raw items through unstable os::wasi module This fixes a regression from stable to nightly. Closes #99502.
2 parents 91b8b9b + 0eb28ab commit f326692

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

Diff for: library/std/src/os/fd/raw.rs

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use crate::os::wasi::io::OwnedFd;
1414
use crate::sys_common::{AsInner, IntoInner};
1515

1616
/// Raw file descriptors.
17+
#[cfg_attr(not(bootstrap), rustc_allowed_through_unstable_modules)]
1718
#[stable(feature = "rust1", since = "1.0.0")]
1819
pub type RawFd = raw::c_int;
1920

@@ -22,6 +23,7 @@ pub type RawFd = raw::c_int;
2223
/// This is only available on unix and WASI platforms and must be imported in
2324
/// order to call the method. Windows platforms have a corresponding
2425
/// `AsRawHandle` and `AsRawSocket` set of traits.
26+
#[cfg_attr(not(bootstrap), rustc_allowed_through_unstable_modules)]
2527
#[stable(feature = "rust1", since = "1.0.0")]
2628
pub trait AsRawFd {
2729
/// Extracts the raw file descriptor.
@@ -57,6 +59,7 @@ pub trait AsRawFd {
5759

5860
/// A trait to express the ability to construct an object from a raw file
5961
/// descriptor.
62+
#[cfg_attr(not(bootstrap), rustc_allowed_through_unstable_modules)]
6063
#[stable(feature = "from_raw_os", since = "1.1.0")]
6164
pub trait FromRawFd {
6265
/// Constructs a new instance of `Self` from the given raw file
@@ -100,6 +103,7 @@ pub trait FromRawFd {
100103

101104
/// A trait to express the ability to consume an object and acquire ownership of
102105
/// its raw file descriptor.
106+
#[cfg_attr(not(bootstrap), rustc_allowed_through_unstable_modules)]
103107
#[stable(feature = "into_raw_os", since = "1.4.0")]
104108
pub trait IntoRawFd {
105109
/// Consumes this object, returning the raw underlying file descriptor.

Diff for: library/std/src/os/wasi/io/raw.rs

+15
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,19 @@
22
33
#![unstable(feature = "wasi_ext", issue = "71213")]
44

5+
// NOTE: despite the fact that this module is unstable,
6+
// stable Rust had the capability to access the stable
7+
// re-exported items from os::fd::raw through this
8+
// unstable module.
9+
// In PR #95956 the stability checker was changed to check
10+
// all path segments of an item rather than just the last,
11+
// which caused the aforementioned stable usage to regress
12+
// (see issue #99502).
13+
// As a result, the items in os::fd::raw were given the
14+
// rustc_allowed_through_unstable_modules attribute.
15+
// No regression tests were added to ensure this property,
16+
// as CI is not configured to test wasm32-wasi.
17+
// If this module is stabilized,
18+
// you may want to remove those attributes
19+
// (assuming no other unstable modules need them).
520
pub use crate::os::fd::raw::*;

0 commit comments

Comments
 (0)