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

macro impl_Insertable! not found during build #1689

Closed
MattsSe opened this Issue May 12, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@MattsSe

MattsSe commented May 12, 2018

Versions

  • Rust: rustc 1.27.0-nightly (acd3871ba 2018-05-10)
  • Diesel: 1.2.2
  • Database: postgres
  • Operating System macos high sierra 10.13.4

Problem Description

Can't compile structs that derive the Insertable trait, the Associations trait also seems to cause troubles. I checked various diesel version both on stable and nightly but received the same error.

What is the actual output?

 --> <proc-macro source code>:1:1
  |
1 | impl_Insertable ! { ( struct_name = Abc , table_name = abc , struct_ty = Abc , lifetimes = ( ) , ) , fields = [ { field_name:  id ,  column_name:  id ,  field_ty:  i32 ,  field_kind:  regular ,  inner_field_ty:  i32 ,  } { field_name:  name ,  column_name:  name ,  field_ty:  String ,  field_kind:  regular ,  inner_field_ty:  String ,  } ] , }
  | ^^^^^^^^^^^^^^^

Steps to reproduce

lib.rs

#![feature(custom_attribute)]
#[macro_use]
extern crate diesel;
#[macro_use]
extern crate diesel_codegen;
extern crate serde;
#[macro_use]
extern crate serde_derive;

table! {
     abc (id) {
        id -> Int4,
        name -> Varchar,
    }
}

#[derive(Queryable, Insertable, Debug, Clone)]
#[table_name = "abc"]
pub struct Abc {
    pub id: i32,
    pub name: String,
}

Cargo.toml

[dependencies]
serde = "1.0.54"
serde_derive = "1.0.54"

[dependencies.diesel]
features = [
    "postgres",
    "chrono",
]
version = "1.2.2"

[dependencies.diesel_codegen]
features = ["postgres"]
version = "0.16.0"
@weiznich

This comment has been minimized.

Contributor

weiznich commented May 12, 2018

Diesel codegen is dead since 0.99. See the changelog for details.

@weiznich weiznich closed this May 12, 2018

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