Skip to content

Mark libc's `fs::Dir as Sync#1232

Merged
sunfishcode merged 1 commit intobytecodealliance:mainfrom
nrath-js:mut-dirops
Dec 8, 2024
Merged

Mark libc's `fs::Dir as Sync#1232
sunfishcode merged 1 commit intobytecodealliance:mainfrom
nrath-js:mut-dirops

Conversation

@nrath-js
Copy link
Copy Markdown
Contributor

@nrath-js nrath-js commented Dec 3, 2024

This is safe since all methods that mutate the internal state require a &mut self. It also makes behavior consistent with the linux_raw backend (whose fs::Dir is Sync+Send).

Fixes: #1230.

This is safe since all methods that mutate the internal state require
a &mut self. It also makes behavior consistent with the linux_raw
backend (whose `fs::Dir` is Sync+Send).

Fixes: bytecodealliance#1230.
@nrath-js
Copy link
Copy Markdown
Contributor Author

nrath-js commented Dec 3, 2024

I think the (Windows) test failures are unrelated to this change. Is that correct?

@sunfishcode
Copy link
Copy Markdown
Member

Thanks!

@sunfishcode sunfishcode merged commit 5a012c8 into bytecodealliance:main Dec 8, 2024
sunfishcode pushed a commit that referenced this pull request Dec 8, 2024
This is safe since all methods that mutate the internal state require
a &mut self. It also makes behavior consistent with the linux_raw
backend (whose `fs::Dir` is Sync+Send).

Fixes: #1230.
sunfishcode pushed a commit that referenced this pull request Dec 8, 2024
This is safe since all methods that mutate the internal state require
a &mut self. It also makes behavior consistent with the linux_raw
backend (whose `fs::Dir` is Sync+Send).

Fixes: #1230.
@sunfishcode
Copy link
Copy Markdown
Member

This is now released in rustix 0.38.42.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Why is fs::Dir not Sync?

2 participants