Skip to content

derive(Serialize) regression with lifetimes #443

Closed
@arcnmx

Description

@arcnmx

This used to work around version 0.7.10 of serde_codegen...

#[derive(Serialize)]
struct S<'a> {
    a: Option<&'static str>,
    b: Option<&'a str>,
}
error: mismatched types [E0308]
#[derive(Serialize)]
help: run `rustc --explain E0308` to see a detailed explanation
note: expected type `serde::Serialize`
note:    found type `serde::Serialize`
note: the lifetime 'a as defined on the impl at 31:9...
#[derive(Serialize)]
note: ...does not necessarily outlive the static lifetime

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions