New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#[insertable_into] fails with lifetimes other than 'a or 'insert #246

Closed
TimNN opened this Issue Mar 28, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@TimNN

TimNN commented Mar 28, 2016

The following code fails to compile unless the 'b lifetime is changed to 'a or 'insert:

#![feature(custom_attribute, plugin)]
#![plugin(diesel_codegen)]

#[macro_use]
extern crate diesel;

table! {
    foo {
        id -> Integer,
        s -> VarChar,
    }
}

#[insertable_into(foo)]
pub struct Bar<'b> {
    pub s: &'b str,
}

I believe that this code only works with 'a because as far as I know lifetimes are exempt from macro hygiene.

@sgrif

This comment has been minimized.

Member

sgrif commented Mar 31, 2016

Fixed in 4771cb6

@sgrif sgrif closed this Mar 31, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment