-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Send not implemented for std::fs::read_dir #22577
Comments
Note that the function does not build a list, but rather generates results lazily, therefore yes, sending result of Wrap the iterator into |
Thanks @nagisa that allows me to work around the issue but looking at the code its not clear, to me at least, what benefit of an Rc is in https://github.com/rust-lang/rust/blob/master/src/libstd/sys/unix/fs2.rs.
|
Rc only allows sharing a pointer inside the same thread. I can’t quite say now why Rc is necessary here without looking at the code, but it is an implementation detail and doesn’t help to deal with the original problem. |
The windows/unix modules were currently inconsistent about the traits being implemented for `DirEntry` and there isn't much particular reason why the traits *couldn't* be implemented for `ReadDir` and `DirEntry`, so this commit ensures that they are implemented. Closes rust-lang#22577
The windows/unix modules were currently inconsistent about the traits being implemented for `DirEntry` and there isn't much particular reason why the traits *couldn't* be implemented for `ReadDir` and `DirEntry`, so this commit ensures that they are implemented. Closes rust-lang#22577
Now that the new std::fs changes #21936 have landed. I'm getting the following error with code similar to this snippet http://is.gd/6usayc
Error:
Is it really unsafe to move the read_dir results to a TaskPool?
The text was updated successfully, but these errors were encountered: