mirror of
https://github.com/bertptrs/tracing-mutex.git
synced 2025-12-25 12:40:31 +01:00
Rework CI for experimental features
This commit is contained in:
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@@ -15,6 +15,7 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
rust:
|
||||
- "1.74" # Current minimum for experimental features
|
||||
- stable
|
||||
- beta
|
||||
- nightly
|
||||
@@ -44,7 +45,8 @@ jobs:
|
||||
with:
|
||||
toolchain: "1.70"
|
||||
|
||||
- run: cargo test --all-features
|
||||
# Test everything except experimental features.
|
||||
- run: cargo test --features backtraces,lockapi,parkinglot
|
||||
|
||||
docs:
|
||||
name: Documentation build
|
||||
|
||||
@@ -37,6 +37,7 @@ required-features = ["parkinglot"]
|
||||
[features]
|
||||
default = ["backtraces"]
|
||||
backtraces = []
|
||||
experimental = []
|
||||
# Feature names do not match crate names pending namespaced features.
|
||||
lockapi = ["lock_api"]
|
||||
parkinglot = ["parking_lot", "lockapi"]
|
||||
|
||||
@@ -37,6 +37,8 @@ use crate::MutexId;
|
||||
/// let _second_lock = second.lock().unwrap();
|
||||
/// first.lock().unwrap();
|
||||
/// ```
|
||||
#[cfg(feature = "experimental")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "experimental")))]
|
||||
pub unsafe fn reset_dependencies<T: Traced>(traced: &T) {
|
||||
crate::get_dependency_graph().remove_node(traced.get_id().value());
|
||||
}
|
||||
@@ -45,14 +47,19 @@ pub unsafe fn reset_dependencies<T: Traced>(traced: &T) {
|
||||
///
|
||||
/// This trait is a public marker trait and is automatically implemented fore all types that
|
||||
/// implement the internal dependency tracking features.
|
||||
#[cfg(feature = "experimental")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "experimental")))]
|
||||
#[allow(private_bounds)]
|
||||
pub trait Traced: PrivateTraced {}
|
||||
|
||||
#[cfg(feature = "experimental")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "experimental")))]
|
||||
impl<T: PrivateTraced> Traced for T {}
|
||||
|
||||
/// Private implementation of the traced marker.
|
||||
///
|
||||
/// This trait is private (and seals the outer trait) to avoid exposing the MutexId type.
|
||||
#[cfg_attr(not(feature = "experimental"), allow(unused))]
|
||||
pub(crate) trait PrivateTraced {
|
||||
/// Get the mutex id associated with this traced item.
|
||||
fn get_id(&self) -> &MutexId;
|
||||
|
||||
Reference in New Issue
Block a user