diff --git a/Cargo.toml b/Cargo.toml index 2d6fabc..5936c39 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,8 +42,8 @@ lock_api = ["dep:lock_api"] parking_lot = ["dep:parking_lot", "lock_api"] # Deprecated feature names from when cargo couldn't distinguish between dep and feature -lockapi = ["lock_api"] -parkinglot = ["parking_lot"] +lockapi = ["dep:lock_api"] +parkinglot = ["dep:parking_lot", "lock_api"] [build-dependencies] autocfg = "1.4.0" diff --git a/src/lib.rs b/src/lib.rs index a839565..185da76 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -85,36 +85,30 @@ use std::sync::OnceLock; use std::sync::PoisonError; #[cfg(feature = "lock_api")] -#[cfg_attr(docsrs, doc(cfg(feature = "lock_api")))] -#[cfg_attr( - all(not(docsrs), feature = "lockapi"), - deprecated = "The `lockapi` feature has been renamed `lock_api`" -)] +#[cfg_attr(docsrs, doc(cfg(feature = "lockapi")))] +#[deprecated = "The top-level re-export `lock_api` is deprecated. Use `tracing_mutex::lockapi::raw` instead"] pub use lock_api; #[cfg(feature = "parking_lot")] -#[cfg_attr(docsrs, doc(cfg(feature = "parking_lot")))] -#[cfg_attr( - all(not(docsrs), feature = "parkinglot"), - deprecated = "The `parkinglot` feature has been renamed `parking_lot`" -)] +#[cfg_attr(docsrs, doc(cfg(feature = "parkinglot")))] +#[deprecated = "The top-level re-export `parking_lot` is deprecated. Use `tracing_mutex::parkinglot::raw` instead"] pub use parking_lot; + +use graph::DiGraph; use reporting::Dep; use reporting::Reportable; -use crate::graph::DiGraph; - mod graph; -#[cfg(feature = "lock_api")] +#[cfg(any(feature = "lock_api", feature = "lockapi"))] #[cfg_attr(docsrs, doc(cfg(feature = "lock_api")))] #[cfg_attr( - all(not(docsrs), feature = "lockapi"), + all(not(docsrs), feature = "lockapi", not(feature = "lock_api")), deprecated = "The `lockapi` feature has been renamed `lock_api`" )] pub mod lockapi; -#[cfg(feature = "parking_lot")] +#[cfg(any(feature = "parking_lot", feature = "parkinglot"))] #[cfg_attr(docsrs, doc(cfg(feature = "parking_lot")))] #[cfg_attr( - all(not(docsrs), feature = "parkinglot"), + all(not(docsrs), feature = "parkinglot", not(feature = "parking_lot")), deprecated = "The `parkinglot` feature has been renamed `parking_lot`" )] pub mod parkinglot; diff --git a/src/lockapi.rs b/src/lockapi.rs index 5565d53..afd4fa7 100644 --- a/src/lockapi.rs +++ b/src/lockapi.rs @@ -8,6 +8,7 @@ //! Wrapped mutexes are at least one `usize` larger than the types they wrapped, and must be aligned //! to `usize` boundaries. As such, libraries with many mutexes may want to consider the additional //! required memory. +pub use lock_api as raw; use lock_api::GuardNoSend; use lock_api::RawMutex; use lock_api::RawMutexFair;