error: calling `set_len()` immediately after reserving a buffer creates uninitialized values
--> futures-util/src/io/buf_reader.rs:52:13
|
52 | let mut buffer = Vec::with_capacity(capacity);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
53 | buffer.set_len(capacity);
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[deny(clippy::uninit_vec)]` on by default
= help: initialize the buffer or wrap the content in `MaybeUninit`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninit_vec
Fixes the following issues in `AsyncBufRead::read_line`:
* When the future is dropped the previous string contents are not restored so the string is empty.
* If invalid UTF-8 is encountered the previous string contents are not restored.
* If an IO error occurs after `read_until_internal` already read a couple of bytes a debug assertion fails.
* Performance: The whole string to which read contents are appended is check for UTF-8 validity instead of just the added bytes.
Fixes the following issues in `AsyncBufRead::read_line`:
* If an IO error occurs after `read_until_internal` already read a couple of bytes a debug assertion fails. (#2862)
Fixes#2862
* 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 https://github.com/rust-lang/rust-clippy/issues/12404)
* clippy: fixes for "doc list item without indentation" lint
* clippy: ignore incorrect "first doc comment paragraph is too long" warning
see https://github.com/rust-lang/rust-clippy/issues/13315
* clippy: allow long first paragraphs in select... fn doc comments
* use workspace level setting to ignore error about the futures_sanitizer unexpected config
```
error: redundant explicit link target
--> futures-executor/src/local_pool.rs:314:25
|
314 | /// Use a [`LocalPool`](LocalPool) if you need finer-grained control over
| ----------- ^^^^^^^^^ explicit target is redundant
| |
| because label contains path that resolves to same destination
|
= note: when a link's destination is not specified,
the label is used to resolve intra-doc links
= note: `-D rustdoc::redundant-explicit-links` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(rustdoc::redundant_explicit_links)]`
help: remove explicit link target
|
314 | /// Use a [`LocalPool`] if you need finer-grained control over
| ~~~~~~~~~~~~~
error: redundant explicit link target
--> futures-executor/src/local_pool.rs:37:33
|
37 | /// A handle to a [`LocalPool`](LocalPool) that implements
| ----------- ^^^^^^^^^ explicit target is redundant
| |
| because label contains path that resolves to same destination
|
= note: when a link's destination is not specified,
the label is used to resolve intra-doc links
help: remove explicit link target
|
37 | /// A handle to a [`LocalPool`] that implements
| ~~~~~~~~~~~~~
```
```
error: the item `Box` is imported redundantly
--> futures-core/src/future.rs:89:9
|
89 | use alloc::boxed::Box;
| ^^^^^^^^^^^^^^^^^
--> /rustc/381d69953bb7c3390cec0fee200f24529cb6320f/library/std/src/prelude/mod.rs:115:13
|
= note: the item `Box` is already defined here
|
= note: `-D unused-imports` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(unused_imports)]`
error: the item `Box` is imported redundantly
--> futures-core/src/stream.rs:203:9
|
203 | use alloc::boxed::Box;
| ^^^^^^^^^^^^^^^^^
--> /rustc/381d69953bb7c3390cec0fee200f24529cb6320f/library/std/src/prelude/mod.rs:115:13
|
= note: the item `Box` is already defined here
```
```
error: field `0` is never read
--> futures-executor/tests/local_pool.rs:13:16
|
13 | struct Pending(Rc<()>);
| ------- ^^^^^^
| |
| field in this struct
|
= note: `-D dead-code` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(dead_code)]`
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
|
13 | struct Pending(());
| ~~
```
This makes them show up on the documentation page for the `stream`
module. It also makes the return types on the `TryStreamExt`
documentation page link to the adapter types.
There is no hard guarantee that polling a second time will return
Poll::Ready, and this is particularly likely to break in the EOF case,
which is precisely where we don't need to do so at all.
Both tokio::io::BufReader and futures::io::BufReader always attempt to
read from the underlying reader when the buffer is empty, rather than
fusing EOF.