Skip to content

Reordering of attributes passed to rustc_macro_derive #36211

Closed
@dtolnay

Description

(Using rustc from #35957)

Macros 1.1 is reordering attributes in a way that breaks Syntex. If I have the following:

#[derive(Serialize, Deserialize)]
#[serde(bound(deserialize = "T::Owned: Deserialize"))]
struct CowT<'a, T: ?Sized + 'a + ToOwned>(Cow<'a, T>);

It gets passed to my #[rustc_macro_derive(Serialize)] as:

#[serde(bound(deserialize = "T::Owned: Deserialize"))]
#[derive(Deserialize)]
struct CowT<'a, T: ?Sized + 'a + ToOwned>(Cow<'a, T>);

I would expect the #[derive(Deserialize)] to stay above #[serde(...)].

cc @alexcrichton

Activity

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions