Diesel: 导出“可识别”时出现编译错误

创建于 2017-12-27  ·  3评论  ·  资料来源: diesel-rs/diesel

设置

版本

  • 锈: rustc 1.23.0-beta.2 (c9107ee93 2017-12-08)
  • 柴油: 1.0.0-rc1
  • 数据库: sqlite
  • 操作系统linux x86_64

功能标志

  • 柴油: sqlite
  • 柴油代码:

问题描述

你想达到什么目的?

尝试遵循协会文档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模块)。

所有3条评论

您需要确保您的payees模块在范围内,使用诸如use schema::payees; (假设您的table!infer_schema!声明在名为schema模块)。

好的电话,关于如何在文档中使这一点更加明显的任何建议? 很高兴将 PR 放在一起,因为我已经阅读了几次但看不到。

我们在其他几个地方提到了这一点(我认为协会文档提到了它?)我们可能可以在文档中为Identifiable相同的措辞。

此页面是否有帮助?
0 / 5 - 0 等级