Skip to content
This repository was archived by the owner on Oct 10, 2019. It is now read-only.

ToSql can't be derived in structs with lifetimes #11

Open
CodeSandwich opened this issue Apr 24, 2018 · 1 comment
Open

ToSql can't be derived in structs with lifetimes #11

CodeSandwich opened this issue Apr 24, 2018 · 1 comment

Comments

@CodeSandwich
Copy link

Example:

#[derive(ToSql)]
pub struct Dto<'a> {
    field: &'a str,
}

Error:

error[E0106]: missing lifetime specifier
 --> src/main.rs:9:10
  |
9 | #[derive(ToSql)]
  |          ^^^^^ expected lifetime parameter
@sfackler
Copy link
Owner

Should be doable to fix - in the next rust-postgres release we'll support borrowing during deserialization so we'll want to support it in FromSql as well.

@CodeSandwich CodeSandwich changed the title ToSql can't be applied to structs with lifetimes ToSql can't be derived in structs with lifetimes Apr 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants