Skip to content

Commit

Permalink
Uncollide tokio's docsrs feature
Browse files Browse the repository at this point in the history
tokio fails to compile with `--cfg docsrs` under latest nightly.
  • Loading branch information
oxalica committed Nov 5, 2023
1 parent 4568bd6 commit 2e4a088
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,5 @@ debug = 1

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
# Workaround: https://github.com/rust-lang/rust/issues/117622
rustdoc-args = ["--cfg", "docsrs_"]
12 changes: 6 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
//! *Disabled by default.*
//! - `tokio`: Enable compatible methods for [`tokio`](https://crates.io/crates/tokio) runtime.
//! *Disabled by default.*
#![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(docsrs_, feature(doc_cfg))]
#![warn(missing_docs)]
use std::any::{type_name, Any, TypeId};
use std::collections::HashMap;
Expand Down Expand Up @@ -109,25 +109,25 @@ pub mod router;
pub mod server;

#[cfg(feature = "forward")]
#[cfg_attr(docsrs, doc(cfg(feature = "forward")))]
#[cfg_attr(docsrs_, doc(cfg(feature = "forward")))]
mod forward;

#[cfg(feature = "client-monitor")]
#[cfg_attr(docsrs, doc(cfg(feature = "client-monitor")))]
#[cfg_attr(docsrs_, doc(cfg(feature = "client-monitor")))]
pub mod client_monitor;

#[cfg(all(feature = "stdio", unix))]
#[cfg_attr(docsrs, doc(cfg(all(feature = "stdio", unix))))]
#[cfg_attr(docsrs_, doc(cfg(all(feature = "stdio", unix))))]
pub mod stdio;

#[cfg(feature = "tracing")]
#[cfg_attr(docsrs, doc(cfg(feature = "tracing")))]
#[cfg_attr(docsrs_, doc(cfg(feature = "tracing")))]
pub mod tracing;

#[cfg(feature = "omni-trait")]
mod omni_trait;
#[cfg(feature = "omni-trait")]
#[cfg_attr(docsrs, doc(cfg(feature = "omni-trait")))]
#[cfg_attr(docsrs_, doc(cfg(feature = "omni-trait")))]
pub use omni_trait::{LanguageClient, LanguageServer};

/// A convenient type alias for `Result` with `E` = [`enum@crate::Error`].
Expand Down
2 changes: 1 addition & 1 deletion src/stdio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ impl Write for PipeStdout {
// Tokio compatibility.
// We can simplify these if we have https://github.com/tokio-rs/tokio/issues/5785
#[cfg(feature = "tokio")]
#[cfg_attr(docsrs, doc(cfg(feature = "tokio")))]
#[cfg_attr(docsrs_, doc(cfg(feature = "tokio")))]
mod tokio_impl {
use std::pin::Pin;
use std::task::{Context, Poll};
Expand Down

0 comments on commit 2e4a088

Please sign in to comment.