rustc 1.23.0-beta.2 (c9107ee93 2017-12-08)
尝试遵循协会文档https://docs.diesel.rs/diesel/associations/index.html并获得编译错误
没有构建错误
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.
完全可复制的回购在这里https://github.com/qmx/diesel-association-error-repro
您需要确保您的payees
模块在范围内,使用诸如use schema::payees;
(假设您的table!
或infer_schema!
声明在名为schema
模块)。
好的电话,关于如何在文档中使这一点更加明显的任何建议? 很高兴将 PR 放在一起,因为我已经阅读了几次但看不到。
我们在其他几个地方提到了这一点(我认为协会文档提到了它?)我们可能可以在文档中为Identifiable
相同的措辞。
最有用的评论
您需要确保您的
payees
模块在范围内,使用诸如use schema::payees;
(假设您的table!
或infer_schema!
声明在名为schema
模块)。