Skip to content

doc: list all remove_dir_all fallback targets - #158999

Open
Muhtasim-Munif-Fahim wants to merge 2 commits into
rust-lang:mainfrom
Muhtasim-Munif-Fahim:codex/rust-remove-dir-all-docs
Open

doc: list all remove_dir_all fallback targets#158999
Muhtasim-Munif-Fahim wants to merge 2 commits into
rust-lang:mainfrom
Muhtasim-Munif-Fahim:codex/rust-remove-dir-all-docs

Conversation

@Muhtasim-Munif-Fahim

@Muhtasim-Munif-Fahim Muhtasim-Munif-Fahim commented Jul 9, 2026

Copy link
Copy Markdown

This adds the still-missing
emove_dir_all fallback targets to the TOCTOU warning and updates the wording to describe the current implementation detail directly.

Closes #153781

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 9, 2026
@rustbot

rustbot commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pull request, and welcome! The Rust Project is excited to review your changes, and you should hear from @aapoalas (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue
Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ChrisDenton, libs
  • @ChrisDenton, libs expanded to 13 candidates
  • Random selection from 6 candidates

Comment thread library/std/src/fs.rs Outdated
/// TOCTOU races, Miri will not do so.
/// - **QNX**, **Redox OS**, **VxWorks**: This function does not protect against TOCTOU races, as
/// the underlying platform does not implement the required platform support to do so.
/// - **ESP-IDF**, **Horizon**, **PS Vita**, **QNX**, **Redox OS**, **VxWorks**: This function

@aapoalas aapoalas Jul 19, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick (blocking): I'd keep the original phrasing. It's technically wrong for QNX, but that's just a great way to rope the QNX folks in to remove this fallback when libc bindings for the platform are available. When QNX then inevitably gets removed from this list, the original phrasing will be more informative of why there is no TOCTOU protection: because there cannot be.

Also, "the fallback implementation" is only mentioned here so it means nothing to the reader of this documentation, only to the writer. Effectively it is internal documentation and should be in a // comment if anywhere. For a reader it is more important to hear that the reason is in the platform - hearing that the reason is that "this function uses the fallback implementation" sounds like they should come in and open a PR to remove the fallback implementation usage, which is not the case.

... Honestly; I'm not even sure if it's right to mention ESP-IDF, Horizon, and PS Vita here since if they don't have symlink support then there are no symlink TOCTOU races to protect against. But it's fine I guess.

View changes since the review

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 19, 2026
@rustbot

rustbot commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rustbot rustbot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jul 19, 2026
Keep the expanded platform list but drop the writer-facing "uses the fallback
implementation" wording per review, restoring the original reason phrasing that
explains protection is absent because the underlying platform lacks the required
support.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-libs Relevant 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.

fs::remove_dir_all: TOCTOU doc incomplete, five targets missing from warning

3 participants