diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b78d0f1..899d3be 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,7 +46,7 @@ jobs: toolchain: "1.70" # Test everything except experimental features. - - run: cargo test --features backtraces,lockapi,parkinglot + - run: cargo test --features backtraces,lock_api,parking_lot docs: name: Documentation build diff --git a/Cargo.toml b/Cargo.toml index 8a1fc88..2d6fabc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,9 +38,12 @@ required-features = ["parkinglot"] default = ["backtraces"] backtraces = [] experimental = [] -# Feature names do not match crate names pending namespaced features. +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"] +parkinglot = ["parking_lot"] [build-dependencies] autocfg = "1.4.0" diff --git a/src/lib.rs b/src/lib.rs index 6a446ea..a839565 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -84,11 +84,19 @@ use std::sync::MutexGuard; use std::sync::OnceLock; use std::sync::PoisonError; -#[cfg(feature = "lockapi")] -#[cfg_attr(docsrs, doc(cfg(feature = "lockapi")))] +#[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`" +)] pub use lock_api; -#[cfg(feature = "parkinglot")] -#[cfg_attr(docsrs, doc(cfg(feature = "parkinglot")))] +#[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`" +)] pub use parking_lot; use reporting::Dep; use reporting::Reportable; @@ -96,11 +104,19 @@ use reporting::Reportable; use crate::graph::DiGraph; mod graph; -#[cfg(feature = "lockapi")] -#[cfg_attr(docsrs, doc(cfg(feature = "lockapi")))] +#[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`" +)] pub mod lockapi; -#[cfg(feature = "parkinglot")] -#[cfg_attr(docsrs, doc(cfg(feature = "parkinglot")))] +#[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`" +)] pub mod parkinglot; mod reporting; pub mod stdsync;