about summary refs log tree commit diff
path: root/tests/ui/macros/missing-derive-1.rs
blob: e23ef7bf07ba609f7c15b8c1d8afeb1b4c560c95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//@aux-build:serde.rs

// derive macros imported and used

extern crate serde;
use serde::{Serialize, Deserialize};

#[serde(untagged)] //~ ERROR cannot find attribute `serde`
enum A { //~ HELP `serde` is an attribute that can be used by the derive macros `Deserialize` and `Serialize`
    A,
    B,
}

enum B { //~ HELP `serde` is an attribute that can be used by the derive macros `Deserialize` and `Serialize`
    A,
    #[serde(untagged)] //~ ERROR cannot find attribute `serde`
    B,
}

enum C {
    A,
    #[sede(untagged)] //~ ERROR cannot find attribute `sede`
    B, //~^ HELP the derive macros `Deserialize` and `Serialize` accept the similarly named `serde` attribute
}

#[derive(Serialize, Deserialize)]
#[serde(untagged)]
enum D {
    A,
    B,
}

fn main() {}