Reorganise features

Now the features do not directly enable each other, which should silence
extraneous deprecation warnings while running tests. This can be cleaned
up in the next BC break when the old features are removed.
This commit is contained in:
2025-04-10 19:12:33 +02:00
parent ccc4c98791
commit 8ec32bdf16
3 changed files with 13 additions and 18 deletions

View File

@@ -42,8 +42,8 @@ lock_api = ["dep:lock_api"]
parking_lot = ["dep:parking_lot", "lock_api"] parking_lot = ["dep:parking_lot", "lock_api"]
# Deprecated feature names from when cargo couldn't distinguish between dep and feature # Deprecated feature names from when cargo couldn't distinguish between dep and feature
lockapi = ["lock_api"] lockapi = ["dep:lock_api"]
parkinglot = ["parking_lot"] parkinglot = ["dep:parking_lot", "lock_api"]
[build-dependencies] [build-dependencies]
autocfg = "1.4.0" autocfg = "1.4.0"

View File

@@ -85,36 +85,30 @@ use std::sync::OnceLock;
use std::sync::PoisonError; use std::sync::PoisonError;
#[cfg(feature = "lock_api")] #[cfg(feature = "lock_api")]
#[cfg_attr(docsrs, doc(cfg(feature = "lock_api")))] #[cfg_attr(docsrs, doc(cfg(feature = "lockapi")))]
#[cfg_attr( #[deprecated = "The top-level re-export `lock_api` is deprecated. Use `tracing_mutex::lockapi::raw` instead"]
all(not(docsrs), feature = "lockapi"),
deprecated = "The `lockapi` feature has been renamed `lock_api`"
)]
pub use lock_api; pub use lock_api;
#[cfg(feature = "parking_lot")] #[cfg(feature = "parking_lot")]
#[cfg_attr(docsrs, doc(cfg(feature = "parking_lot")))] #[cfg_attr(docsrs, doc(cfg(feature = "parkinglot")))]
#[cfg_attr( #[deprecated = "The top-level re-export `parking_lot` is deprecated. Use `tracing_mutex::parkinglot::raw` instead"]
all(not(docsrs), feature = "parkinglot"),
deprecated = "The `parkinglot` feature has been renamed `parking_lot`"
)]
pub use parking_lot; pub use parking_lot;
use graph::DiGraph;
use reporting::Dep; use reporting::Dep;
use reporting::Reportable; use reporting::Reportable;
use crate::graph::DiGraph;
mod graph; mod graph;
#[cfg(feature = "lock_api")] #[cfg(any(feature = "lock_api", feature = "lockapi"))]
#[cfg_attr(docsrs, doc(cfg(feature = "lock_api")))] #[cfg_attr(docsrs, doc(cfg(feature = "lock_api")))]
#[cfg_attr( #[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`" deprecated = "The `lockapi` feature has been renamed `lock_api`"
)] )]
pub mod lockapi; pub mod lockapi;
#[cfg(feature = "parking_lot")] #[cfg(any(feature = "parking_lot", feature = "parkinglot"))]
#[cfg_attr(docsrs, doc(cfg(feature = "parking_lot")))] #[cfg_attr(docsrs, doc(cfg(feature = "parking_lot")))]
#[cfg_attr( #[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`" deprecated = "The `parkinglot` feature has been renamed `parking_lot`"
)] )]
pub mod parkinglot; pub mod parkinglot;

View File

@@ -8,6 +8,7 @@
//! Wrapped mutexes are at least one `usize` larger than the types they wrapped, and must be aligned //! 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 //! to `usize` boundaries. As such, libraries with many mutexes may want to consider the additional
//! required memory. //! required memory.
pub use lock_api as raw;
use lock_api::GuardNoSend; use lock_api::GuardNoSend;
use lock_api::RawMutex; use lock_api::RawMutex;
use lock_api::RawMutexFair; use lock_api::RawMutexFair;