Skip to content

Not working with non static lifetime #6

@bytedream

Description

@bytedream

It is not working when there is a lifetime

#[serde_inline_default]
#[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "lowercase")]
struct Person<'a> {
    #[serde_inline_default("A name")]
    name: &'a str,
}
error[E0261]: use of undeclared lifetime name `'a`
  --> src/main.rs:36:12
   |
31 | #[serde_inline_default]
   |                        - lifetime `'a` is missing in item created through this procedural macro
...
36 |     name: &'a str,
   |            ^^ undeclared lifetime

Originally posted by @rochacbruno in #1 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions