Skip to content
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

Built-in derive macros Send and Sync exist #62050

Closed
petrochenkov opened this issue Jun 22, 2019 · 2 comments · Fixed by #62078
Closed

Built-in derive macros Send and Sync exist #62050

petrochenkov opened this issue Jun 22, 2019 · 2 comments · Fixed by #62078
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@petrochenkov
Copy link
Contributor

Their single purpose is improving diagnostics.
When those macros expand they always produce an error saying that unsafe impl Send for Foo {} should be written explicitly rather than derived.

So, when #61877 is implemented you'll be able to write use Send or use std::Send without an error, but that's not an intent.

The macros should be removed, and derive(Send) should result in a resolution error, and the suggestion to write unsafe impl Send for Foo {} explicitly should be put on that resolution error.

@jonas-schievink jonas-schievink added A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 22, 2019
Centril added a commit to Centril/rust that referenced this issue Jun 24, 2019
Remove built-in derive macros `Send` and `Sync`

Closes rust-lang#62050
@eddyb
Copy link
Member

eddyb commented Jun 24, 2019

I would've half-expected e.g. use core::Clone; to never work, and instead the builtin macro be exposed from core::clone::Clone and core::prelude::v1::Clone (and both overlap with the Clone trait).
But it sounds like that's not going to be the case?

@petrochenkov
Copy link
Contributor Author

@eddyb
I've answered in #62086 (comment).

Centril added a commit to Centril/rust that referenced this issue Jun 25, 2019
Remove built-in derive macros `Send` and `Sync`

Closes rust-lang#62050
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants