1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//! The one `UnsafeCell` shape, so that loom can check both users of it.
//!
//! `loom::cell::UnsafeCell` and `std::cell::UnsafeCell` do not have the same
//! API: loom hands out access through a closure so that it can bracket the
//! access, notice two overlapping ones and fail the model. `std` hands out a
//! raw pointer and checks nothing. Presenting loom's shape on both means the
//! code that uses a cell is written once and is the code loom checks, rather
//! than a `cfg`-selected variant of it.
//!
//! Deliberately the smallest surface that serves its users: one constructor
//! and one accessor. A shared read would need `with`, and nothing here does.
//! Every access is a move in or a move out, under a lock the caller holds.
/// A cell whose accesses loom can see.
pub ;
type Inner<T> = UnsafeCell;
type Inner<T> = UnsafeCell;