Skip to content

Commit

Permalink
ci: Test loom under no-default-features
Browse files Browse the repository at this point in the history
This commit adds loom tests to CI with --no-default-features, then also
fixes a compile error that was introduced in a new version of loom.

Closes #64
  • Loading branch information
notgull committed Mar 31, 2024
1 parent c407467 commit 59e93fc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ jobs:
env:
RUSTFLAGS: "--cfg=loom"
LOOM_MAX_PREEMPTIONS: 4
- name: Loom tests without default features
run: cargo test --release --test loom --features loom --no-default-features
env:
RUSTFLAGS: "--cfg=loom"
LOOM_MAX_PREEMPTIONS: 4

security_audit:
permissions:
Expand Down
3 changes: 3 additions & 0 deletions src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ mod sync_impl {
pub(crate) use loom::sync::atomic::*;
}

#[cfg(not(feature = "std"))]
pub(crate) use loom::hint::spin_loop;
#[cfg(feature = "std")]
pub(crate) use loom::thread::yield_now;
}

Expand Down

0 comments on commit 59e93fc

Please sign in to comment.