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

error: macro undefined: 'postgres!' #3

Closed
sfisol opened this issue Jan 29, 2017 · 6 comments
Closed

error: macro undefined: 'postgres!' #3

sfisol opened this issue Jan 29, 2017 · 6 comments

Comments

@sfisol
Copy link

sfisol commented Jan 29, 2017

I had a working code that compiles with:
rustc 1.15.0-nightly (c80c31a50 2016-12-02)
Upgrading to:
rustc 1.16.0-nightly (df8debf6d 2017-01-25)

shows
error: macro undefined: 'postgres!'
on
5 | #[postgres(name = "panel_position")]
and
14 | #[postgres(name = "panel_value_type")]

Given code (starting at line 4):

#[derive(Debug, ToSql, FromSql, PartialEq, Clone, Copy)]
#[postgres(name = "panel_position")]
pub enum Position {
    #[postgres(name = "left")]
    Left,
    #[postgres(name = "right")]
    Right,
}

#[derive(Debug, ToSql, FromSql)]
#[postgres(name = "panel_value_type")]
pub enum PanelValueType {
    #[postgres(name = "link")]
    Link,
    #[postgres(name = "post")]
    Post,
    #[postgres(name = "category")]
    Category,
   (...)

Also version of rust-postgres changed from 0.13.3 to 0.13.5, I can provide version changes for rest of crates if it would be necessary

@sfackler
Copy link
Owner

Hmm, that's strange. You're using the 0.2 release, right?

@sfisol
Copy link
Author

sfisol commented Jan 29, 2017

I'm using 0.2.2, I also tried downgrading postgres-derive and postgres-derive-internals to 0.2.0. It didn't help. In a few hours I'll try to provide the simplest possible example which renders the problem for me.

@sfackler
Copy link
Owner

Ah, I'm seeing the same thing.

@sfackler
Copy link
Owner

Ah, looks like rust-lang/rust#39347. Remove #![feature(proc_macro)] and it works.

@sfisol
Copy link
Author

sfisol commented Jan 29, 2017

Thanks, it worked!

BTW. I believe in example in README.md, line
postgres-derive-macros = "0.2"
should be
postgres-derive = "0.2"

@sfackler
Copy link
Owner

Fixed!

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