My documentation test code looks like this:
/// ``` /// extern crate rand; /// # extern crate rusty_ulid; /// # use rusty_ulid::Ulid; /// let ulid = Ulid::from_timestamp_with_rng(0, &mut rand::thread_rng()); /// let timestamp = ulid.timestamp(); /// assert_eq!(timestamp, 0); /// ```
The test works fine in
nightly but fails in
rustc 1.25.0 (84203cac6 2018-03-25)) with the following error message:
| 5 | use rusty_ulid::Ulid; | ^^^^^^^^^^ Maybe a missing `extern crate rusty_ulid;`?
Other code looking quite similar is working. The only difference is that the failing test code contains the line
extern crate rand;.
Did I stumble over an actual bug in
stable or am I doing something wrong? Is there any way to get this up and running in all three environments?