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

Cannot find macro? #1664

Closed
SuperCuber opened this Issue Apr 27, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@SuperCuber

SuperCuber commented Apr 27, 2018

Setup

Versions

  • Rust: rustc 1.27.0-nightly (ac3c2288f 2018-04-18)
  • Diesel: 1.2.2, diesel_codegen: 0.16.0
  • Database: N/A
  • Operating System: Ubuntu

Feature Flags

  • diesel: None

Problem Description

Missing macro?

What are you trying to accomplish?

Build this simple code:

#[macro_use]
extern crate diesel;
#[macro_use]
extern crate diesel_codegen;

table! {
    users  (id) {
        id -> Int4,
        username ->  Text,
    }
}

#[derive(Queryable, Identifiable, AsChangeset)]
pub struct User {
    pub id: i32,
    pub username: String,
}

What is the expected output?

Successful compilation

What is the actual output?

   Compiling diesel-test v0.1.0 (file:///home/amit/diesel-test)
error: cannot find macro `impl_AsChangeset!` in this scope
 --> <proc-macro source code>:1:1
  |
1 | impl_AsChangeset ! { ( struct_name = User , table_name = users , treat_none_as_null = "false" , struct_ty = User , lifetimes = ( 'a ) , ) , fields = [ { field_name:  username ,  column_name:  username ,  field_ty:  String ,  field_kind:  regular ,  inner_field_ty:  String ,  } ] , }
  | ^^^^^^^^^^^^^^^^

error: cannot find macro `impl_Identifiable!` in this scope
 --> <proc-macro source code>:1:1
  |
1 | impl_Identifiable ! { ( table_name = users , primary_key_names = ( id ) , struct_ty = User , lifetimes = ( ) , ) , fields = [ { field_name:  id ,  column_name:  id ,  field_ty:  i32 ,  field_kind:  regular ,  inner_field_ty:  i32 ,  } { field_name:  username ,  column_name:  username ,  field_ty:  String ,  field_kind:  regular ,  inner_field_ty:  String ,  } ] , }
  | ^^^^^^^^^^^^^^^^^

error: aborting due to 2 previous errors

error: Could not compile `diesel-test`.

To learn more, run the command again with --verbose.

Are you seeing any additional errors?

Steps to reproduce

Put the code I tried into a main.rs, put the versions of crates I specified into Cargo.toml, cargo build

Checklist

  • I have already looked over the issue tracker for similar issues.
@weiznich

This comment has been minimized.

Contributor

weiznich commented Apr 27, 2018

diesel_codegen is dead since 0.99. See the Changelog for details.

@weiznich weiznich closed this Apr 27, 2018

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