Skip to content

Allow using stable os::fd::raw items through unstable os::wasi module - #99723

Merged
bors merged 1 commit into
rust-lang:masterfrom
bstrie:wasifd
Jul 28, 2022
Merged

Allow using stable os::fd::raw items through unstable os::wasi module#99723
bors merged 1 commit into
rust-lang:masterfrom
bstrie:wasifd

Conversation

@bstrie

Copy link
Copy Markdown
Contributor

This fixes a regression from stable to nightly.

Closes#99502.

@rustbotrustbot added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Jul 25, 2022
@rustbot

Copy link
Copy Markdown
Collaborator

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @joshtriplett

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 25, 2022
@Aaron1011

Copy link
Copy Markdown
Contributor

Can you add a test for this?

@yaahc

Copy link
Copy Markdown
Member

r=me once the test is added

Comment threadlibrary/std/src/os/wasi/io/raw.rs Outdated
@bstrie

Copy link
Copy Markdown
ContributorAuthor

I'm happy to add a test, but I don't know where in the test suite it would live. I don't really want a unit test, because it will be ruined if anyone ever adds feature(wasi_ext) to std. A doctest doesn't really make sense. And I don't know which of the litany of folders under src/test is most suitable. Any guidance?

@yaahc

Copy link
Copy Markdown
Member

@bstrie add them to this test: https://github.com/rust-lang/rust/blob/master/src/test/ui/stability-attribute/accidental-stable-in-unstable.rs

@bstrie

Copy link
Copy Markdown
ContributorAuthor

I've added a test to ensure these items are available on stable. I didn't add them to the existing accidentally-stable-in-unstable test because these items are specific to the the wasm32-wasi target and I didn't want to force that entire test to be built for wasm32-wasi, so I created a new test, accidentally-stable-in-unstable-wasi. This also required teaching compiletest a little about the wasm32-wasi target, which I did in a separate commit.

@bstrie

Copy link
Copy Markdown
ContributorAuthor

There's some question on Zulip as to whether or not the test that I've added will actually be run in practice. Since I had to modify compiletest to get this test to run, I assume that it's not currently set up to run any wasm32-wasi tests (even check-pass tests like this one). So should I remove the test? Should I leave it, and expect it to never get run? Should I find a way to get the test to run during CI (which might be a bit of a large project, I'd like to get this regression fixed before the next beta is cut...)?

@bstrie

Copy link
Copy Markdown
ContributorAuthor

I've removed the test, since @yaahc indicated on Zulip that she's fine with not adding a test for this. I'm happy to open a follow-up issue to track adding a test for this if anyone thinks that's necessary.

@yaahc

Copy link
Copy Markdown
Member

@bors r+

@bors

bors commented Jul 27, 2022

Copy link
Copy Markdown
Collaborator

📌 Commit 0eb28ab has been approved by yaahc

It is now in the queue for this repository.

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 27, 2022
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jul 27, 2022
Allow using stable os::fd::raw items through unstable os::wasi module
This fixes a regression from stable to nightly.
Closesrust-lang#99502.
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jul 27, 2022
Allow using stable os::fd::raw items through unstable os::wasi module
This fixes a regression from stable to nightly.
Closesrust-lang#99502.
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Jul 28, 2022
Allow using stable os::fd::raw items through unstable os::wasi module
This fixes a regression from stable to nightly.
Closesrust-lang#99502.
@Dylan-DPCDylan-DPC mentioned this pull request Jul 28, 2022
@Dylan-DPCDylan-DPC mentioned this pull request Jul 28, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 28, 2022
Rollup of 5 pull requests
Successful merges:
- rust-lang#99714 (Fix regression introduced with rust-lang#99383)
- rust-lang#99723 (Allow using stable os::fd::raw items through unstable os::wasi module)
- rust-lang#99810 (Fix settings slider on small width screens)
- rust-lang#99837 (Avoid `Symbol` to `String` conversions)
- rust-lang#99846 (Refactor `UnresolvedImportError`)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit f326692 into rust-lang:masterJul 28, 2022
@rustbotrustbot added this to the 1.64.0 milestone Jul 28, 2022
@sunfishcodesunfishcode mentioned this pull request Aug 23, 2022
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jan 19, 2025
…_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 fixrust-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.
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jan 19, 2025
…_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 fixrust-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.
jieyouxu added a commit to jieyouxu/rust that referenced this pull request Jan 20, 2025
…_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 fixrust-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.
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jan 20, 2025
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 fixrust-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.
github-actionsBot pushed a commit to tautschnig/verify-rust-std that referenced this pull request Mar 11, 2025
…_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 fixrust-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.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-libsRelevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression on nightly when compiling mio for wasm32-wasi

7 participants

@bstrie@rustbot@rust-highfive@Aaron1011@yaahc@bors@joshtriplett