You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# ..headers omitted
[dependencies]
tokio = { version = "=1.33.0", features = ["net"] }
src/lib.rs is empty.
Run RUSTDOCFLAGS='--cfg=docsrs' cargo doc.
I expected to see this happen: success without any error.
Instead, this happened:
[..]
Documenting tokio v1.33.0
error[E0277]: the trait bound `doc::NotDefinedHere: mio::event::Source` is not satisfied
--> <whatever>/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.33.0/src/net/windows/named_pipe.rs:104:9
|
104 | io: PollEvented<mio_windows::NamedPipe>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `mio::event::Source` is not implemented for `doc::NotDefinedHere`
|
= help: the following other types implement trait `mio::event::Source`:
std::boxed::Box<T>
mio::unix::SourceFd<'a>
mio::unix::pipe::Sender
mio::unix::pipe::Receiver
mio::io_source::IoSource<T>
mio::net::TcpListener
mio::net::TcpStream
mio::net::UdpSocket
and 3 others
note: required by a bound in `io::poll_evented::PollEvented`
--> <whatever>/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.33.0/src/io/poll_evented.rs:65:38
|
65 | pub(crate) struct PollEvented<E: Source> {
| ^^^^^^ required by this bound in `PollEvented`
error[E0277]: the trait bound `doc::NotDefinedHere: mio::event::Source` is not satisfied
--> <whatever>/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.33.0/src/net/windows/named_pipe.rs:977:9
|
977 | io: PollEvented<mio_windows::NamedPipe>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `mio::event::Source` is not implemented for `doc::NotDefinedHere`
|
= help: the following other types implement trait `mio::event::Source`:
std::boxed::Box<T>
mio::unix::SourceFd<'a>
mio::unix::pipe::Sender
mio::unix::pipe::Receiver
mio::io_source::IoSource<T>
mio::net::TcpListener
mio::net::TcpStream
mio::net::UdpSocket
and 3 others
note: required by a bound in `io::poll_evented::PollEvented`
--> <whatever>/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.33.0/src/io/poll_evented.rs:65:38
|
65 | pub(crate) struct PollEvented<E: Source> {
| ^^^^^^ required by this bound in `PollEvented`
For more information about this error, try `rustc --explain E0277`.
error: could not document `tokio`
Caused by:
process didn't exit successfully: `rustdoc --edition=2021 --crate-type lib --crate-name tokio <whatever>/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.33.0/src/lib.rs --cap-lints allow -o <whatever>/target/doc --cfg 'feature="default"' --cfg 'feature="libc"' --cfg 'feature="mio"' --cfg 'feature="net"' --cfg 'feature="socket2"' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=127 -C metadata=6d4124359ab93408 -L dependency=<whatever>/target/debug/deps --extern libc=<whatever>/target/debug/deps/liblibc-02ca9efcb1ab59f3.rmeta --extern mio=<whatever>/target/debug/deps/libmio-de01690419bd3c4f.rmeta --extern pin_project_lite=<whatever>/target/debug/deps/libpin_project_lite-6c4ee879e3ffa189.rmeta --extern socket2=<whatever>/target/debug/deps/libsocket2-c2e9deaac3e208ee.rmeta --cfg=docsrs --crate-version 1.33.0` (exit status: 1)
Code
Cargo.toml:src/lib.rsis empty.Run
RUSTDOCFLAGS='--cfg=docsrs' cargo doc.I expected to see this happen: success without any error.
Instead, this happened:
Version it worked on
It most recently worked on:
Version with regression
Context
I'm initially using
--cfg docsrsmainly for my own crate, but it's also accidentally used bytokio, which enablesdoc(cfg(..))usage rustdoc: Tracking issue for#[doc(cfg)]and automatically documented#[cfg]s #43781. I guess it's related.I'm not fully sure this is an intended failure or not. But intuitively,
rustdocshould not check trait bounds in private fields of private types.This failure is caught by CI in https://github.com/oxalica/async-lsp/actions/runs/6714596487/job/18248066086.