Coverage Report

Created: 2025-10-12 06:35

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/rust/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.10.1/src/loom.rs
Line
Count
Source
1
#[cfg(not(all(test, loom)))]
2
pub(crate) mod sync {
3
    pub(crate) mod atomic {
4
        #[cfg(not(feature = "extra-platforms"))]
5
        pub(crate) use core::sync::atomic::{AtomicPtr, AtomicUsize, Ordering};
6
        #[cfg(feature = "extra-platforms")]
7
        pub(crate) use extra_platforms::{AtomicPtr, AtomicUsize, Ordering};
8
9
        pub(crate) trait AtomicMut<T> {
10
            fn with_mut<F, R>(&mut self, f: F) -> R
11
            where
12
                F: FnOnce(&mut *mut T) -> R;
13
        }
14
15
        impl<T> AtomicMut<T> for AtomicPtr<T> {
16
0
            fn with_mut<F, R>(&mut self, f: F) -> R
17
0
            where
18
0
                F: FnOnce(&mut *mut T) -> R,
19
            {
20
0
                f(self.get_mut())
21
0
            }
Unexecuted instantiation: <core::sync::atomic::AtomicPtr<()> as bytes::loom::sync::atomic::AtomicMut<()>>::with_mut::<bytes::bytes::shared_drop::{closure#0}, ()>
Unexecuted instantiation: <core::sync::atomic::AtomicPtr<()> as bytes::loom::sync::atomic::AtomicMut<()>>::with_mut::<bytes::bytes::promotable_odd_drop::{closure#0}, ()>
Unexecuted instantiation: <core::sync::atomic::AtomicPtr<()> as bytes::loom::sync::atomic::AtomicMut<()>>::with_mut::<bytes::bytes::promotable_even_drop::{closure#0}, ()>
Unexecuted instantiation: <core::sync::atomic::AtomicPtr<()> as bytes::loom::sync::atomic::AtomicMut<()>>::with_mut::<bytes::bytes_mut::shared_v_drop::{closure#0}, ()>
22
        }
23
    }
24
}
25
26
#[cfg(all(test, loom))]
27
pub(crate) mod sync {
28
    pub(crate) mod atomic {
29
        pub(crate) use loom::sync::atomic::{AtomicPtr, AtomicUsize, Ordering};
30
31
        pub(crate) trait AtomicMut<T> {}
32
    }
33
}