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

Mildly confusing line in getting_started_step_1 #499

Closed
bronson opened this Issue Nov 22, 2016 · 4 comments

Comments

Projects
None yet
2 participants
@bronson

bronson commented Nov 22, 2016

In getting_started_step_1, the instructions say to "add the following four lines to the top of src/lib.rs". Following this literally results in an uncompilable file:

#![feature(proc_macro)]

#[macro_use] extern crate diesel_codegen;

pub mod schema;
pub mod models;

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

#[macro_use] extern crate diesel; needs to come before #[macro_use] extern crate diesel_codegen; of course.

I'd submit a PR to add some wording but I didn't see where the getting-started file was located.

This didn't take long to figure out, just hoping to save others the trouble.

@bronson

This comment has been minimized.

bronson commented Nov 22, 2016

And the error is pretty darned confusing:

error: `#[derive]` for custom traits is not stable enough for use. It is deprecated and will be removed in v1.15 (see issue #29644)
 --> src/models.rs:1:10
  |
1 | #[derive(Queryable)]
  |          ^^^^^^^^^
  |
  = help: add #![feature(custom_derive)] to the crate attributes to enable

error: aborting due to previous error

error: Could not compile `diesel_demo`.
@bronson

This comment has been minimized.

bronson commented Nov 22, 2016

Same thing with src/models.rs in step 2, "We'll want a struct to use for inserting a new record." It's not clear that the new code should integrate with the existing.

@killercup

This comment has been minimized.

Member

killercup commented Nov 25, 2016

@bronson sorry for the short but still delayed answer; you can find the getting started code at https://github.com/diesel-rs/diesel/tree/master/examples and the website text at https://github.com/sgrif/diesel.rs-website

@bronson

This comment has been minimized.

bronson commented Nov 30, 2016

Thank you, I'll submit PRs there.

@bronson bronson closed this Nov 30, 2016

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