-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Refine error message for thread-safe usage of std::sync::Arc<{Self}> #114842
Conversation
r? @thomcc (rustbot has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This still points people at |
We can leave only the link to the book and not mention Arc at all in the !Send case. |
@@ -79,7 +79,7 @@ macro marker_impls { | |||
on(_Self = "std::rc::Rc<T, A>", note = "use `std::sync::Arc` instead of `std::rc::Rc`"), | |||
message = "`{Self}` cannot be sent between threads safely", | |||
label = "`{Self}` cannot be sent between threads safely", | |||
note = "consider using `std::sync::Arc<{Self}>`; for more information visit \ | |||
note = "consider whether `std::sync::Arc<{Self}>` could be incorporated to share this value between threads; for more information visit \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As long as Arc<{Self}>
continues to be mentioned, this does not fix #114687. That suggestion is always wrong.
Revert "Suggest using `Arc` on `!Send`/`!Sync` types" Closes rust-lang#114687. This is a clean revert of rust-lang#88936 + rust-lang#115210. The suggestion to Arc\<{Self}\> when Self does not implement Send is *always* wrong. rust-lang#114842 is considering a way to make a more refined suggestion.
☔ The latest upstream changes (presumably #115326) made this pull request unmergeable. Please resolve the merge conflicts. |
Thank you for your reviews. |
fixes #114687