mirror of
https://github.com/rust-lang/rust.git
synced 2025-09-28 21:55:31 +00:00

``` error: cannot find attribute `empty_helper` in this scope --> $DIR/derive-helper-legacy-limits.rs:17:3 | LL | #[empty_helper] | ^^^^^^^^^^^^ | help: `empty_helper` is an attribute that can be used by the derive macro `Empty`, you might be missing a `derive` attribute | LL + #[derive(Empty)] LL | struct S2; | ``` Look at proc-macro attributes when encountering unknown attribute ``` error: cannot find attribute `sede` in this scope --> src/main.rs:18:7 | 18 | #[sede(untagged)] | ^^^^ | help: the derive macros `Serialize` and `Deserialize` accept the similarly named `serde` attribute | 18 | #[serde(untagged)] | ~~~~~ error: cannot find attribute `serde` in this scope --> src/main.rs:12:7 | 12 | #[serde(untagged)] | ^^^^^ | = note: `serde` is in scope, but it is a crate, not an attribute help: `serde` is an attribute that can be used by the derive macros `Serialize` and `Deserialize`, you might be missing a `derive` attribute | 10 | #[derive(Serialize, Deserialize)] | ```
34 lines
775 B
Rust
34 lines
775 B
Rust
//@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() {}
|