1[package]
2name = "once_cell"
3version = "1.21.3"
4authors = ["Aleksey Kladov <aleksey.kladov@gmail.com>"]
5license = "MIT OR Apache-2.0"
6edition = "2021"
7rust-version = "1.65"
8
9description = "Single assignment cells and lazy values."
10readme = "README.md"
11documentation = "https://docs.rs/once_cell"
12
13repository = "https://github.com/matklad/once_cell"
14keywords = ["lazy", "static"]
15categories = ["rust-patterns", "memory-management"]
16
17exclude = ["*.png", "*.svg", "/Cargo.lock.msrv", "rustfmt.toml"]
18
19[workspace]
20members = ["xtask"]
21
22[dependencies]
23parking_lot_core = { version = "0.9.10", optional = true, default-features = false }
24portable-atomic = { version = "1.8", optional = true, default-features = false }
25critical-section = { version = "1.1.3", optional = true }
26
27[dev-dependencies]
28regex = "1.10.6"
29critical-section = { version = "1.1.3", features = ["std"] }
30
31[features]
32default = ["std"]
33
34# Enables `once_cell::sync` module.
35std = ["alloc"]
36
37# Enables `once_cell::race::OnceBox` type.
38alloc = ["race"]
39
40# Enables `once_cell::race` module.
41race = []
42
43# Uses parking_lot to implement once_cell::sync::OnceCell.
44# This makes no speed difference, but makes each OnceCell<T>
45# up to 16 bytes smaller, depending on the size of the T.
46parking_lot = ["dep:parking_lot_core"]
47
48# Uses `portable-atomic` to implement `race` module. in
49# `#![no_std]` mode. Please read `portable-atomic` docs carefully
50# before enabling this feature.
51portable-atomic = ["dep:portable-atomic"]
52
53# Uses `critical-section` to implement `sync` module. in
54# `#![no_std]` mode. Please read `critical-section` docs carefully
55# before enabling this feature.
56# `portable-atomic` feature is enabled for backwards compatibility.
57critical-section = ["dep:critical-section", "portable-atomic"]
58
59# Enables semver-exempt APIs of this crate.
60# At the moment, this feature is unused.
61unstable = []
62
63# Only for backwards compatibility.
64atomic-polyfill = ["critical-section"]
65
66[[example]]
67name = "bench"
68required-features = ["std"]
69
70[[example]]
71name = "bench_acquire"
72required-features = ["std"]
73
74[[example]]
75name = "lazy_static"
76required-features = ["std"]
77
78[[example]]
79name = "reentrant_init_deadlocks"
80required-features = ["std"]
81
82[[example]]
83name = "regex"
84required-features = ["std"]
85
86[[example]]
87name = "test_synchronization"
88required-features = ["std"]
89
90[package.metadata.docs.rs]
91all-features = true
92rustdoc-args = ["--generate-link-to-definition"]
93