Skip to content

rename Owned to Send #6496

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

Closed
thestinger opened this issue May 15, 2013 · 5 comments
Closed

rename Owned to Send #6496

thestinger opened this issue May 15, 2013 · 5 comments

Comments

@thestinger
Copy link
Contributor

Types with the Owned kind are sendable, and those without it are not sendable. It does not represent ownership because a shared ownership type like those in std::arc have to be Owned if they're intended to be sendable.

I think this is going to confuse people and lead to bugs. It's tempting to treat Owned as meaning the types are owned, but that ends up treating ARCs incorrectly.

@graydon
Copy link
Contributor

graydon commented May 15, 2013

Note: it used to be called Send

@thestinger
Copy link
Contributor Author

@graydon: yup, I think the old name was better :)

I wasn't around when it was changed, so I don't know if naming it Owned pre-dated shared-ownership sendable types.

@glaebhoerl
Copy link
Contributor

Do the various clients even want the same semantics? It's being used in some places (e.g. for ruling out cycles) that have nothing to do with tasks. Maybe some of them actually do want "single ownership of whole tree" and not just "safe to send between tasks"?

@thestinger
Copy link
Contributor Author

@glehel: the places using it to rule out cycles don't really care what it means, only that they can mark themselves as #[non_send] and then require Send as a trait bound for the constructor. It's fine for them to contain @ as long as they don't cycle back to themselves (Const allows that for Rc).

@thestinger
Copy link
Contributor Author

This landed as part of #7451.

flip1995 pushed a commit to flip1995/rust that referenced this issue Jan 2, 2021
ci: test cargo clippy --fix -Zunstable-options

Make sure we catch cases like rust-lang/rust-clippy#6487 in CI in the future.

---

*Please write a short comment explaining your change (or "none" for internal only changes)*
changelog: none
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

No branches or pull requests

3 participants