Skip to content

windows Dir::rename: remove incorrect is_dir query - #163065

Open
RalfJung wants to merge 1 commit into
rust-lang:mainfrom
RalfJung:win-is-dir
Open

RalfJung wants to merge 1 commit into
rust-lang:mainfrom
RalfJung:win-is-dir

Conversation

@RalfJung

Copy link
Copy Markdown
Member

Hopefully fixes #163022
r? @ChrisDenton

try-jobs: test-x86_64-msvc-1

@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 Sep 20, 2026
let mut opts = OpenOptions::new();
opts.access_mode(c::DELETE);
let handle = self.open_file_native(path, &opts, dir)?;
let create_opt = if dir { c::FILE_DIRECTORY_FILE } else { c::FILE_NON_DIRECTORY_FILE };

@RalfJung RalfJung Sep 20, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

remove should not create new things so I don't know if this is needed... I wanted to preserve existing behavior as much as possible.

View changes since the review

@RalfJung

Copy link
Copy Markdown
Member Author

@bors try

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 20, 2026
windows Dir::rename: remove incorrect is_dir query
@rust-bors

rust-bors Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: c9a89f6 (c9a89f671bc73d79b1a38f9424335c372885a27a)
Base parent: feaadee (feaadeeaca7db0594da854e7c8c07495341c7439)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows implementation of Dir::rename resolves from path without considering self at all

3 participants