Skip to content

Commit 6f0420d

Browse files
committed
Deny warnings for doc tests
1 parent 6408473 commit 6f0420d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+168
-13
lines changed

futures-channel/src/oneshot.rs

+1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ struct Inner<T> {
8282
/// # Examples
8383
///
8484
/// ```
85+
/// # #![deny(warnings)]
8586
/// use futures::channel::oneshot;
8687
/// use futures::future::FutureExt;
8788
/// use std::thread;

futures-core/src/task/__internal/atomic_waker.rs

+1
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ impl AtomicWaker {
169169
/// Here is how `register` is used when implementing a flag.
170170
///
171171
/// ```
172+
/// # #![deny(warnings)]
172173
/// use futures::future::Future;
173174
/// use futures::task::{Context, Poll, AtomicWaker};
174175
/// use std::sync::atomic::AtomicBool;

futures-executor/src/enter.rs

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ pub struct EnterError {
2525
/// completing task execution:
2626
///
2727
/// ```
28+
/// # #![deny(warnings)]
2829
/// use futures::executor::enter;
2930
///
3031
/// let enter = enter().expect("...");

futures-executor/src/local_pool.rs

+4
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ impl LocalPool {
108108
/// the `LocalPool` by using its spawner handle:
109109
///
110110
/// ```
111+
/// # #![deny(warnings)]
111112
/// use futures::executor::LocalPool;
112113
///
113114
/// let mut pool = LocalPool::new();
@@ -131,6 +132,7 @@ impl LocalPool {
131132
/// the `LocalPool` by using its spawner handle:
132133
///
133134
/// ```
135+
/// # #![deny(warnings)]
134136
/// use futures::executor::LocalPool;
135137
/// use futures::future::ready;
136138
///
@@ -168,6 +170,7 @@ impl LocalPool {
168170
/// can be made. Returns `true` if one future was completed, `false` otherwise.
169171
///
170172
/// ```
173+
/// # #![deny(warnings)]
171174
/// use futures::executor::LocalPool;
172175
/// use futures::task::LocalSpawnExt;
173176
/// use futures::future::{ready, empty};
@@ -208,6 +211,7 @@ impl LocalPool {
208211
/// on any task.
209212
///
210213
/// ```
214+
/// # #![deny(warnings)]
211215
/// use futures::executor::LocalPool;
212216
/// use futures::task::LocalSpawnExt;
213217
/// use futures::future::{ready, empty};

futures-test/src/assert.rs

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pub fn assert_is_unpin_stream<S: Stream + Unpin>(_: &mut S) {}
99
/// # Examples
1010
///
1111
/// ```
12+
/// # #![deny(warnings)]
1213
/// #![feature(async_await)]
1314
/// use futures::stream;
1415
/// use futures_test::future::FutureTestExt;
@@ -46,6 +47,7 @@ macro_rules! assert_stream_pending {
4647
/// # Examples
4748
///
4849
/// ```
50+
/// # #![deny(warnings)]
4951
/// #![feature(async_await)]
5052
/// use futures::stream;
5153
/// use futures_test::future::FutureTestExt;
@@ -89,6 +91,7 @@ macro_rules! assert_stream_next {
8991
/// # Examples
9092
///
9193
/// ```
94+
/// # #![deny(warnings)]
9295
/// #![feature(async_await)]
9396
/// use futures::stream;
9497
/// use futures_test::future::FutureTestExt;

futures-test/src/future/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ pub trait FutureTestExt: Future {
3333
/// # Examples
3434
///
3535
/// ```
36+
/// # #![deny(warnings)]
3637
/// #![feature(async_await)]
3738
/// use futures::task::Poll;
3839
/// use futures::future::FutureExt;
@@ -60,6 +61,7 @@ pub trait FutureTestExt: Future {
6061
/// # Examples
6162
///
6263
/// ```
64+
/// # #![deny(warnings)]
6365
/// #![feature(async_await)]
6466
/// # futures::executor::block_on(async {
6567
/// use futures::channel::oneshot;

futures-test/src/io/read/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ pub trait AsyncReadTestExt: AsyncRead {
1313
/// # Examples
1414
///
1515
/// ```
16+
/// # #![deny(warnings)]
1617
/// #![feature(async_await)]
1718
/// use futures::task::Poll;
1819
/// use futures::io::AsyncRead;
@@ -44,6 +45,7 @@ pub trait AsyncReadTestExt: AsyncRead {
4445
/// The returned reader will also implement `AsyncBufRead` if the underlying reader does.
4546
///
4647
/// ```
48+
/// # #![deny(warnings)]
4749
/// #![feature(async_await)]
4850
/// use futures::task::Poll;
4951
/// use futures::io::AsyncBufRead;

futures-test/src/io/write/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ pub trait AsyncWriteTestExt: AsyncWrite {
1616
/// # Examples
1717
///
1818
/// ```
19+
/// # #![deny(warnings)]
1920
/// #![feature(async_await)]
2021
/// use futures::task::Poll;
2122
/// use futures::io::AsyncWrite;
@@ -57,6 +58,7 @@ pub trait AsyncWriteTestExt: AsyncWrite {
5758
/// # Examples
5859
///
5960
/// ```
61+
/// # #![deny(warnings)]
6062
/// #![feature(async_await)]
6163
/// use futures::task::Poll;
6264
/// use futures::io::AsyncWrite;

futures-test/src/stream/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ pub trait StreamTestExt: Stream {
1313
/// # Examples
1414
///
1515
/// ```
16+
/// # #![deny(warnings)]
1617
/// #![feature(async_await)]
1718
/// use futures::task::Poll;
1819
/// use futures::stream::{self, Stream};

futures-test/src/task/context.rs

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use futures_core::task::Context;
77
/// # Examples
88
///
99
/// ```should_panic
10+
/// # #![deny(warnings)]
1011
/// use futures_test::task::panic_context;
1112
///
1213
/// let cx = panic_context();
@@ -22,6 +23,7 @@ pub fn panic_context() -> Context<'static> {
2223
/// # Examples
2324
///
2425
/// ```
26+
/// # #![deny(warnings)]
2527
/// #![feature(async_await)]
2628
/// use futures::future::Future;
2729
/// use futures::task::Poll;

futures-test/src/task/noop_spawner.rs

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use futures_core::task::{Spawn, SpawnError};
77
/// # Examples
88
///
99
/// ```
10+
/// # #![deny(warnings)]
1011
/// #![feature(async_await)]
1112
/// use futures::task::SpawnExt;
1213
/// use futures_test::task::NoopSpawner;
@@ -46,6 +47,7 @@ impl Default for NoopSpawner {
4647
/// # Examples
4748
///
4849
/// ```
50+
/// # #![deny(warnings)]
4951
/// #![feature(async_await)]
5052
/// use futures::task::SpawnExt;
5153
/// use futures_test::task::noop_spawner_mut;

futures-test/src/task/panic_spawner.rs

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use futures_core::task::{Spawn, SpawnError};
77
/// # Examples
88
///
99
/// ```should_panic
10+
/// # #![deny(warnings)]
1011
/// #![feature(async_await)]
1112
/// use futures::task::SpawnExt;
1213
/// use futures_test::task::PanicSpawner;
@@ -46,6 +47,7 @@ impl Default for PanicSpawner {
4647
/// # Examples
4748
///
4849
/// ```should_panic
50+
/// # #![deny(warnings)]
4951
/// #![feature(async_await)]
5052
/// use futures::task::SpawnExt;
5153
/// use futures_test::task::panic_spawner_mut;

futures-test/src/task/panic_waker.rs

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ fn raw_panic_waker() -> RawWaker {
3030
/// # Examples
3131
///
3232
/// ```should_panic
33+
/// # #![deny(warnings)]
3334
/// use futures_test::task::panic_waker;
3435
///
3536
/// let waker = panic_waker();
@@ -46,6 +47,7 @@ pub fn panic_waker() -> Waker {
4647
/// # Examples
4748
///
4849
/// ```should_panic
50+
/// # #![deny(warnings)]
4951
/// #![feature(async_await)]
5052
/// use futures::task;
5153
/// use futures_test::task::panic_waker_ref;

futures-test/src/task/record_spawner.rs

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use futures_core::task::{Spawn, SpawnError};
77
/// # Examples
88
///
99
/// ```
10+
/// # #![deny(warnings)]
1011
/// #![feature(async_await)]
1112
/// use futures::task::SpawnExt;
1213
/// use futures_test::task::RecordSpawner;

futures-test/src/task/wake_counter.rs

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ impl ArcWake for WakerInner {
4242
/// # Examples
4343
///
4444
/// ```
45+
/// # #![deny(warnings)]
4546
/// use futures_test::task::new_count_waker;
4647
///
4748
/// let (waker, count) = new_count_waker();

futures-util/src/async_await/join.rs

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
/// # Examples
1414
///
1515
/// ```
16+
/// # #![deny(warnings)]
1617
/// #![feature(async_await)]
1718
/// # futures::executor::block_on(async {
1819
/// use futures::{join, future};
@@ -64,6 +65,7 @@ macro_rules! join {
6465
/// `Ok` of a tuple of the values:
6566
///
6667
/// ```
68+
/// # #![deny(warnings)]
6769
/// #![feature(async_await)]
6870
/// # futures::executor::block_on(async {
6971
/// use futures::{try_join, future};
@@ -79,6 +81,7 @@ macro_rules! join {
7981
/// that error:
8082
///
8183
/// ```
84+
/// # #![deny(warnings)]
8285
/// #![feature(async_await)]
8386
/// # futures::executor::block_on(async {
8487
/// use futures::{try_join, future};

futures-util/src/async_await/select_mod.rs

+3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ macro_rules! document_select_macro {
2727
/// # Examples
2828
///
2929
/// ```
30+
/// # #![deny(warnings)]
3031
/// #![feature(async_await)]
3132
/// # futures::executor::block_on(async {
3233
/// use futures::future::{self, FutureExt};
@@ -43,6 +44,7 @@ macro_rules! document_select_macro {
4344
/// ```
4445
///
4546
/// ```
47+
/// # #![deny(warnings)]
4648
/// #![feature(async_await)]
4749
/// # futures::executor::block_on(async {
4850
/// use futures::future::{self, FutureExt};
@@ -65,6 +67,7 @@ macro_rules! document_select_macro {
6567
/// the case where all futures have completed.
6668
///
6769
/// ```
70+
/// # #![deny(warnings)]
6871
/// #![feature(async_await)]
6972
/// # futures::executor::block_on(async {
7073
/// use futures::future::{self, FutureExt};

futures-util/src/compat/compat01as03.rs

+5
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ pub trait Future01CompatExt: Future01 {
5353
/// [`Future<Output = Result<T, E>>`](futures_core::future::Future).
5454
///
5555
/// ```
56+
/// # #![deny(warnings)]
5657
/// #![feature(async_await)]
5758
/// # futures::executor::block_on(async {
5859
/// # // TODO: These should be all using `futures::compat`, but that runs up against Cargo
@@ -80,6 +81,7 @@ pub trait Stream01CompatExt: Stream01 {
8081
/// [`Stream<Item = Result<T, E>>`](futures_core::stream::Stream).
8182
///
8283
/// ```
84+
/// # #![deny(warnings)]
8385
/// #![feature(async_await)]
8486
/// # futures::executor::block_on(async {
8587
/// use futures::stream::StreamExt;
@@ -108,6 +110,7 @@ pub trait Sink01CompatExt: Sink01 {
108110
/// [`Sink<SinkItem = T, SinkError = E>`](futures_sink::Sink).
109111
///
110112
/// ```
113+
/// # #![deny(warnings)]
111114
/// #![feature(async_await)]
112115
/// # futures::executor::block_on(async {
113116
/// use futures::{sink::SinkExt, stream::StreamExt};
@@ -350,6 +353,7 @@ mod io {
350353
/// [`AsyncRead`](futures_io::AsyncRead).
351354
///
352355
/// ```
356+
/// # #![deny(warnings)]
353357
/// #![feature(async_await, impl_trait_in_bindings)]
354358
/// # futures::executor::block_on(async {
355359
/// use futures::io::AsyncReadExt;
@@ -379,6 +383,7 @@ mod io {
379383
/// [`AsyncWrite`](futures_io::AsyncWrite).
380384
///
381385
/// ```
386+
/// # #![deny(warnings)]
382387
/// #![feature(async_await, impl_trait_in_bindings)]
383388
/// # futures::executor::block_on(async {
384389
/// use futures::io::AsyncWriteExt;

futures-util/src/compat/executor.rs

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ pub trait Executor01CompatExt: Executor01<Executor01Future> +
2222
/// futures 0.3 [`Spawn`](futures_core::task::Spawn).
2323
///
2424
/// ```
25+
/// # #![deny(warnings)]
2526
/// #![feature(async_await)]
2627
/// use futures::Future;
2728
/// use futures::task::SpawnExt;

futures-util/src/future/abortable.rs

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ impl<Fut> Abortable<Fut> where Fut: Future {
2929
/// Example:
3030
///
3131
/// ```
32+
/// # #![deny(warnings)]
3233
/// #![feature(async_await)]
3334
/// # futures::executor::block_on(async {
3435
/// use futures::future::{ready, Abortable, AbortHandle, Aborted};
@@ -70,6 +71,7 @@ impl AbortHandle {
7071
/// Example:
7172
///
7273
/// ```
74+
/// # #![deny(warnings)]
7375
/// #![feature(async_await)]
7476
/// # futures::executor::block_on(async {
7577
/// use futures::future::{ready, Abortable, AbortHandle, Aborted};

futures-util/src/future/empty.rs

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ impl<T> FusedFuture for Empty<T> {
2222
/// # Examples
2323
///
2424
/// ```ignore
25+
/// # #![deny(warnings)]
2526
/// #![feature(async_await)]
2627
/// # futures::executor::block_on(async {
2728
/// use futures::future;

futures-util/src/future/fuse.rs

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ impl<Fut: Future> Fuse<Fut> {
2727
/// # Examples
2828
///
2929
/// ```
30+
/// # #![deny(warnings)]
3031
/// #![feature(async_await)]
3132
/// # futures::executor::block_on(async {
3233
/// use futures::channel::mpsc;

futures-util/src/future/join.rs

+4
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ generate! {
9090
/// # Examples
9191
///
9292
/// ```
93+
/// # #![deny(warnings)]
9394
/// #![feature(async_await)]
9495
/// # futures::executor::block_on(async {
9596
/// use futures::future;
@@ -115,6 +116,7 @@ where
115116
/// # Examples
116117
///
117118
/// ```
119+
/// # #![deny(warnings)]
118120
/// #![feature(async_await)]
119121
/// # futures::executor::block_on(async {
120122
/// use futures::future;
@@ -145,6 +147,7 @@ where
145147
/// # Examples
146148
///
147149
/// ```
150+
/// # #![deny(warnings)]
148151
/// #![feature(async_await)]
149152
/// # futures::executor::block_on(async {
150153
/// use futures::future;
@@ -179,6 +182,7 @@ where
179182
/// # Examples
180183
///
181184
/// ```
185+
/// # #![deny(warnings)]
182186
/// #![feature(async_await)]
183187
/// # futures::executor::block_on(async {
184188
/// use futures::future;

futures-util/src/future/join_all.rs

+1
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ where
102102
/// # Examples
103103
///
104104
/// ```
105+
/// # #![deny(warnings)]
105106
/// #![feature(async_await)]
106107
/// # futures::executor::block_on(async {
107108
/// use futures::future::{join_all};

futures-util/src/future/lazy.rs

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ impl<F> Unpin for Lazy<F> {}
1919
/// # Examples
2020
///
2121
/// ```
22+
/// # #![deny(warnings)]
2223
/// #![feature(async_await)]
2324
/// # futures::executor::block_on(async {
2425
/// use futures::future;

futures-util/src/future/maybe_done.rs

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ impl<Fut: Future + Unpin> Unpin for MaybeDone<Fut> {}
2727
/// # Examples
2828
///
2929
/// ```
30+
/// # #![deny(warnings)]
3031
/// #![feature(async_await)]
3132
/// # futures::executor::block_on(async {
3233
/// use futures::future;

0 commit comments

Comments
 (0)