diff --git a/Cargo.toml b/Cargo.toml index 46ae5c104..e7172ea57 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,3 +34,4 @@ rand = "0.6" rand_xorshift = "0.1" serde = "1" serde_derive = "1" +doc-comment = "0.3" diff --git a/README.md b/README.md index 9d820d914..c669e7ad2 100644 --- a/README.md +++ b/README.md @@ -104,14 +104,14 @@ command to get a visualization of an nbody simulation. To see the effect of using Rayon, press `s` to run sequentially and `p` to run in parallel. -``` +```text > cd rayon-demo > cargo run --release -- nbody visualize ``` For more information on demos, try: -``` +```text > cd rayon-demo > cargo run --release -- --help ``` diff --git a/rayon-core/src/compile_fail/scope_join_bad.rs b/rayon-core/src/compile_fail/scope_join_bad.rs index 91eef0579..75e4c5ca6 100644 --- a/rayon-core/src/compile_fail/scope_join_bad.rs +++ b/rayon-core/src/compile_fail/scope_join_bad.rs @@ -1,4 +1,4 @@ -/*! ```compile_fail,E0597 +/*! ```compile_fail,E0373 fn bad_scope(f: F) where F: FnOnce(&i32) + Send, diff --git a/src/lib.rs b/src/lib.rs index 999828ba7..dd7bc2ea2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -85,6 +85,12 @@ extern crate rayon_core; extern crate rand; #[cfg(test)] extern crate rand_xorshift; +#[cfg(test)] +#[macro_use] +extern crate doc_comment; + +#[cfg(test)] +doctest!("../README.md"); #[macro_use] mod delegate;