Skip to content

Commit d8f4a46

Browse files
hkratztaiki-e
authored andcommitted
Various fixes too make the CI green (#2885)
* Fix unexpected `cfg` condition name: ... warnings introduced in Rust 1.80 See https://blog.rust-lang.org/2024/05/06/check-cfg.html * io_slice_advance feature is now stable * clippy: enable missing_const_for_thread_local lint, now checks for MSRV (see rust-lang/rust-clippy#12404) * clippy: fixes for "doc list item without indentation" lint * clippy: ignore incorrect "first doc comment paragraph is too long" warning see rust-lang/rust-clippy#13315 * clippy: allow long first paragraphs in select... fn doc comments * use workspace level setting to ignore error about the futures_sanitizer unexpected config
1 parent a1fbc62 commit d8f4a46

File tree

10 files changed

+15
-9
lines changed

10 files changed

+15
-9
lines changed

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ missing_debug_implementations = "warn"
2424
rust_2018_idioms = "warn"
2525
single_use_lifetimes = "warn"
2626
unreachable_pub = "warn"
27+
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(futures_sanitizer)'] }

futures-core/src/stream.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ pub trait Stream {
3838
/// stream state:
3939
///
4040
/// - `Poll::Pending` means that this stream's next value is not ready
41-
/// yet. Implementations will ensure that the current task will be notified
42-
/// when the next value may be ready.
41+
/// yet. Implementations will ensure that the current task will be notified
42+
/// when the next value may be ready.
4343
///
4444
/// - `Poll::Ready(Some(val))` means that the stream has successfully
45-
/// produced a value, `val`, and may produce further values on subsequent
46-
/// `poll_next` calls.
45+
/// produced a value, `val`, and may produce further values on subsequent
46+
/// `poll_next` calls.
4747
///
4848
/// - `Poll::Ready(None)` means that the stream has terminated, and
49-
/// `poll_next` should not be invoked again.
49+
/// `poll_next` should not be invoked again.
5050
///
5151
/// # Panics
5252
///

futures-util/src/abortable.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ impl<T> Abortable<T> {
6464
/// This means that it will return `true` even if:
6565
/// * `abort` was called after the task had completed.
6666
/// * `abort` was called while the task was being polled - the task may still be running and
67-
/// will not be stopped until `poll` returns.
67+
/// will not be stopped until `poll` returns.
6868
pub fn is_aborted(&self) -> bool {
6969
self.inner.aborted.load(Ordering::Relaxed)
7070
}
@@ -200,7 +200,7 @@ impl AbortHandle {
200200
/// even if:
201201
/// * `abort` was called after the task had completed.
202202
/// * `abort` was called while the task was being polled - the task may still be running and
203-
/// will not be stopped until `poll` returns.
203+
/// will not be stopped until `poll` returns.
204204
///
205205
/// This operation has a Relaxed ordering.
206206
pub fn is_aborted(&self) -> bool {

futures-util/src/async_await/select_mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
macro_rules! document_select_macro {
44
// This branch is required for `futures 0.3.1`, from before select_biased was introduced
55
($select:item) => {
6+
#[allow(clippy::too_long_first_doc_paragraph)]
67
/// Polls multiple futures and streams simultaneously, executing the branch
78
/// for the future that finishes first. If multiple futures are ready,
89
/// one will be pseudo-randomly selected at runtime. Futures directly
@@ -153,6 +154,7 @@ macro_rules! document_select_macro {
153154
($select:item $select_biased:item) => {
154155
document_select_macro!($select);
155156

157+
#[allow(clippy::too_long_first_doc_paragraph)]
156158
/// Polls multiple futures and streams simultaneously, executing the branch
157159
/// for the future that finishes first. Unlike [`select!`], if multiple futures are ready,
158160
/// one will be selected in order of declaration. Futures directly

futures-util/src/async_await/stream_select_mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#[doc(hidden)]
55
pub use futures_macro::stream_select_internal;
66

7+
#[allow(clippy::too_long_first_doc_paragraph)]
78
/// Combines several streams, all producing the same `Item` type, into one stream.
89
/// This is similar to `select_all` but does not require the streams to all be the same type.
910
/// It also keeps the streams inline, and does not require `Box<dyn Stream>`s to be allocated.

futures-util/src/compat/compat03as01.rs

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use futures_sink::Sink as Sink03;
1515
use std::marker::PhantomData;
1616
use std::{mem, pin::Pin, sync::Arc, task::Context};
1717

18+
#[allow(clippy::too_long_first_doc_paragraph)] // clippy bug, see https://github.com/rust-lang/rust-clippy/issues/13315
1819
/// Converts a futures 0.3 [`TryFuture`](futures_core::future::TryFuture) or
1920
/// [`TryStream`](futures_core::stream::TryStream) into a futures 0.1
2021
/// [`Future`](futures_01::future::Future) or

futures-util/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
)
1111
))]
1212
#![warn(missing_docs, unsafe_op_in_unsafe_fn)]
13-
#![cfg_attr(feature = "write-all-vectored", feature(io_slice_advance))]
1413
#![cfg_attr(docsrs, feature(doc_cfg))]
1514

1615
#[cfg(all(feature = "bilock", not(feature = "unstable")))]

futures-util/src/stream/select_with_strategy.rs

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ pin_project! {
7474
}
7575
}
7676

77+
#[allow(clippy::too_long_first_doc_paragraph)]
7778
/// This function will attempt to pull items from both streams. You provide a
7879
/// closure to tell [`SelectWithStrategy`] which stream to poll. The closure can
7980
/// store state on `SelectWithStrategy` to which it will receive a `&mut` on every

futures-util/src/stream/stream/flatten_unordered.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ impl SharedPollState {
119119
/// - `!WAKING` as
120120
/// * Wakers called during the `POLLING` phase won't propagate their calls
121121
/// * `POLLING` phase can't start if some of the wakers are active
122-
/// So no wrapped waker can touch the inner waker's cell, it's safe to poll again.
122+
/// So no wrapped waker can touch the inner waker's cell, it's safe to poll again.
123123
fn stop_polling(&self, to_poll: u8, will_be_woken: bool) -> u8 {
124124
self.state
125125
.fetch_update(Ordering::SeqCst, Ordering::SeqCst, |mut value| {

futures/tests/no-std/build.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use std::{env, process::Command};
22

33
fn main() {
4+
println!("cargo:rustc-check-cfg=cfg(nightly)");
45
if is_nightly() {
56
println!("cargo:rustc-cfg=nightly");
67
}

0 commit comments

Comments
 (0)