Skip to content

Commit

Permalink
Merge pull request #555 from rust-lang/fix/build
Browse files Browse the repository at this point in the history
Use target_has_atomic instead of the old atomic_cas cfg
  • Loading branch information
KodrAus authored Apr 13, 2023
2 parents 11eda98 + ce9f217 commit 8e3e429
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1217,7 +1217,7 @@ where
///
/// Note that `Trace` is the maximum level, because it provides the maximum amount of detail in the emitted logs.
#[inline]
#[cfg(atomic_cas)]
#[cfg(target_has_atomic = "ptr")]
pub fn set_max_level(level: LevelFilter) {
MAX_LOG_LEVEL_FILTER.store(level as usize, Ordering::Relaxed);
}
Expand All @@ -1244,7 +1244,7 @@ pub fn set_max_level(level: LevelFilter) {
#[inline]
pub unsafe fn set_max_level_racy(level: LevelFilter) {
// `MAX_LOG_LEVEL_FILTER` uses a `Cell` as the underlying primitive when a
// platform doesn't support `atomic_cas`, so even though this looks the same
// platform doesn't support `target_has_atomic = "ptr"`, so even though this looks the same
// as `set_max_level` it may have different safety properties.
MAX_LOG_LEVEL_FILTER.store(level as usize, Ordering::Relaxed);
}
Expand Down

0 comments on commit 8e3e429

Please sign in to comment.