mod simulation;
use simulation::factory::FactoryType;
では正常に動作しますがmain.rs
、 内の doctest では動作しませんsimulation/factory.rs
:
impl product_type::ProductType for FactoryType {
/// Lorem Ipsum
///
/// # Examples
///
/// ```
/// use simulation::factory::FactoryType;
///
/// ...
/// ```
fn human_id(&self) -> &String {
...
}
}
cargo test
エラーが表示されます
---- simulation::factory::human_id_0 stdout ----
<anon>:2:9: 2:19 error: unresolved import `simulation::factory::FactoryType`. Maybe a missing `extern crate simulation`?
<anon>:2 use simulation::factory::FactoryType;
^~~~~~~~~~
error: aborting due to previous error
thread 'simulation::factory::human_id_0' panicked at 'Box<Any>', /home/rustbuild/src/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libsyntax/diagnostic.rs:192
doctest を機能させるにはどうすればよいですか?