Skip to content

Built-in derive macros Send and Sync exist #62050

Closed
@petrochenkov

Description

@petrochenkov
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.

Activity

added
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
C-bugCategory: This is a bug.
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
on Jun 22, 2019
added a commit that references this issue on Jun 24, 2019

Rollup merge of rust-lang#62078 - petrochenkov:nosendync2, r=varkor

5015430
eddyb

eddyb commented on Jun 24, 2019

@eddyb
Member

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

petrochenkov commented on Jun 24, 2019

@petrochenkov
ContributorAuthor

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

added a commit that references this issue on Jun 25, 2019

Rollup merge of rust-lang#62078 - petrochenkov:nosendync2, r=varkor

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @eddyb@Centril@jonas-schievink@petrochenkov

      Issue actions

        Built-in derive macros `Send` and `Sync` exist · Issue #62050 · rust-lang/rust