Skip to content

Deriving proc_macros should be documented under their exported name #52210

Closed
@alercah

Description

@alercah

The serde_derive crate exports derivation macros for Deserialize and Serialize. The actual functions implementing these macros are named derive_deserialize and derive_serialize, and that is what they are listed under in Rustdoc. This is not the actual exported name, however; they are exported under the names Deserialize and Serialize, as specified in the proc_macro_derive attribute.

This hasn't mattered as much in the past, but in Rust 2018, the new macro import feature requires you to be able to name the macro as exported:

use serde_derive::Deserialize; // not use serde_derive::derive_deserialize;

While proc_macro_derive's behaviour here is a bit weird and the attribute has a number of other issues, those need to be addressed comprehensively and definitely won't be in time for 2018.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions