Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,17 @@ jobs:
steps:
- uses: actions/checkout@v5

- uses: dtolnay/rust-toolchain@v1
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
components: rustfmt, clippy
components: clippy

# Make sure we test with recent deps
- run: cargo update
# Note: some crates broke BC with 1.74 so we use the locked deps
if: "${{ matrix.rust != '1.74' }}"
- run: cargo build --all-features --all-targets
- run: cargo test --all-features
- run: cargo fmt --all -- --check
# Note: Rust 1.74 doesn't understand edition 2024 formatting so no point
if: "${{ matrix.rust != '1.74' }}"
- run: cargo clippy --all-features --all-targets -- -D warnings
Expand All @@ -45,26 +44,35 @@ jobs:
steps:
- uses: actions/checkout@v5

- uses: dtolnay/rust-toolchain@v1
- uses: dtolnay/rust-toolchain@1.74
with:
toolchain: "1.70"

# Test everything except experimental features.
- run: cargo test --features backtraces,lock_api,parking_lot

formatting:
name: Formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
# Use nightly formatting options
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- run: cargo fmt --check

docs:
name: Documentation build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v5

- uses: dtolnay/rust-toolchain@v1
with:
toolchain: nightly
- uses: dtolnay/rust-toolchain@nightly

- name: Build documentation
env:
# Build the docs like docs.rs builds it
RUSTDOCFLAGS: --cfg docsrs
run: cargo doc --all-features
run: cargo doc --all-features --no-deps
1 change: 1 addition & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
style_edition="2024"
imports_granularity="Item"
3 changes: 3 additions & 0 deletions src/parkinglot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ pub use parking_lot::WaitTimeoutResult;

pub mod tracing;

// Skip reformatting the combined imports as it duplicates the guards
#[rustfmt::skip]
#[cfg(debug_assertions)]
pub use tracing::{
FairMutex, FairMutexGuard, MappedFairMutexGuard, MappedMutexGuard, MappedReentrantMutexGuard,
Expand All @@ -56,6 +58,7 @@ pub use tracing::{
const_reentrant_mutex, const_rwlock,
};

#[rustfmt::skip]
#[cfg(not(debug_assertions))]
pub use parking_lot::{
FairMutex, FairMutexGuard, MappedFairMutexGuard, MappedMutexGuard, MappedReentrantMutexGuard,
Expand Down
3 changes: 3 additions & 0 deletions src/stdsync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@
//! ```
pub use std::sync as raw;

// Skip reformatting the combined imports as it duplicates the guards
#[rustfmt::skip]
#[cfg(not(debug_assertions))]
pub use std::sync::{
Condvar, Mutex, MutexGuard, Once, OnceLock, RwLock, RwLockReadGuard, RwLockWriteGuard,
};

#[rustfmt::skip]
#[cfg(debug_assertions)]
pub use tracing::{
Condvar, Mutex, MutexGuard, Once, OnceLock, RwLock, RwLockReadGuard, RwLockWriteGuard,
Expand Down
Loading