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
と呼ばれるモジュール)。