Coverage Report

Created: 2026-03-31 07:09

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/rust/registry/src/index.crates.io-1949cf8c6b5b557f/bytes-1.11.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
291
            fn with_mut<F, R>(&mut self, f: F) -> R
17
291
            where
18
291
                F: FnOnce(&mut *mut T) -> R,
19
            {
20
291
                f(self.get_mut())
21
291
            }
<core::sync::atomic::AtomicPtr<()> as bytes::loom::sync::atomic::AtomicMut<()>>::with_mut::<bytes::bytes::shared_drop::{closure#0}, ()>
Line
Count
Source
16
160
            fn with_mut<F, R>(&mut self, f: F) -> R
17
160
            where
18
160
                F: FnOnce(&mut *mut T) -> R,
19
            {
20
160
                f(self.get_mut())
21
160
            }
Unexecuted instantiation: <core::sync::atomic::AtomicPtr<()> as bytes::loom::sync::atomic::AtomicMut<()>>::with_mut::<bytes::bytes::promotable_odd_drop::{closure#0}, ()>
<core::sync::atomic::AtomicPtr<()> as bytes::loom::sync::atomic::AtomicMut<()>>::with_mut::<bytes::bytes::promotable_even_drop::{closure#0}, ()>
Line
Count
Source
16
131
            fn with_mut<F, R>(&mut self, f: F) -> R
17
131
            where
18
131
                F: FnOnce(&mut *mut T) -> R,
19
            {
20
131
                f(self.get_mut())
21
131
            }
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
}