chore: deny warnings for doc tests (#1539)

This commit is contained in:
Taiki Endo
2019-09-19 15:50:12 +09:00
committed by GitHub
parent e2161502ad
commit d1f60ac4c6
30 changed files with 81 additions and 53 deletions
+1 -1
View File
@@ -149,7 +149,7 @@ impl dyn Executor {
/// println!("running on the executor");
/// })).unwrap();
///
/// handle.map(|_| println!("the future has completed"));
/// let handle = handle.map(|_| println!("the future has completed"));
/// # }
/// ```
pub fn spawn_with_handle<Fut>(
+4 -1
View File
@@ -6,7 +6,10 @@
unreachable_pub
)]
#![deny(intra_doc_link_resolution_failure)]
#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]
#![doc(test(
no_crate_inject,
attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables))
))]
//! Task execution related traits and utilities.
//!
+1 -1
View File
@@ -104,7 +104,7 @@ pub struct BlockingError {
/// // from the context of a `Future` implementation. Since we don't
/// // have a complicated requirement, we can use `poll_fn` in this
/// // case.
/// poll_fn(move |_| {
/// let _ = poll_fn(move |_| {
/// blocking(|| {
/// let msg = rx.recv().unwrap();
/// println!("message = {}", msg);
+1 -1
View File
@@ -63,7 +63,7 @@ use crate::SpawnError;
/// if item.is_none() { break; }
/// }
///
/// self.tx.take().unwrap().send(()).map_err(|_| ());
/// let _ = self.tx.take().unwrap().send(()).map_err(|_| ());
/// Poll::Ready(())
/// }
/// }