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

compile error on deriving `Identifiable` #1438

Closed
qmx opened this Issue Dec 27, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@qmx

qmx commented Dec 27, 2017

Setup

Versions

  • Rust: rustc 1.23.0-beta.2 (c9107ee93 2017-12-08)
  • Diesel: 1.0.0-rc1
  • Database: sqlite
  • Operating System linux x86_64

Feature Flags

  • diesel: sqlite
  • diesel_codegen:

Problem Description

What are you trying to accomplish?

trying to follow the association documentation https://docs.diesel.rs/diesel/associations/index.html and get a compilation error

What is the expected output?

no build errors

What is the actual output?

   Compiling association_error v0.1.0 (file:///home/qmx/tmp/association_error)
error[E0433]: failed to resolve. Use of undeclared type or module `payees`
  --> src/lib.rs:13:17
   |
13 | #[derive(Debug, Identifiable)]
   |                 ^^^^^^^^^^^^ Use of undeclared type or module `payees`
   |
   = note: this error originates in a macro outside of the current crate

error: aborting due to 2 previous errors

error: Could not compile `association_error`.

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

Are you seeing any additional errors?

Steps to reproduce

fully reproduceable repo here https://github.com/qmx/diesel-association-error-repro

Checklist

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

This comment has been minimized.

Member

sgrif commented Dec 28, 2017

You need to ensure that your payees module is in scope, with a line such as use schema::payees; (Assuming that you have your table! or infer_schema! declarations in a module called schema).

@sgrif sgrif closed this Dec 28, 2017

@qmx

This comment has been minimized.

qmx commented Dec 28, 2017

good call, any suggestion on how to make this more obvious at the docs? Happy to put a PR together, as I've read it a handful times and couldn't see.

@sgrif

This comment has been minimized.

Member

sgrif commented Dec 28, 2017

We mention this in a few other places (I think the associations docs mentions it?) we could probably put that same wording in the docs for Identifiable.

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