1[package]
2name = "once_cell"
3version = "1.19.0"
4authors = ["Aleksey Kladov <aleksey.kladov@gmail.com>"]
5license = "MIT OR Apache-2.0"
6edition = "2021"
7rust-version = "1.60"
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.3", optional = true, default_features = false }
24portable-atomic = { version = "1", optional = true }
25critical-section = { version = "1", optional = true }
26
27[dev-dependencies]
28regex = "1.2.0"
29critical-section = { version = "1.1.1", 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 `critical-section` to implement `sync` and `race` modules. in
49# `#![no_std]` mode. Please read `critical-section` docs carefully
50# before enabling this feature.
51critical-section = ["dep:critical-section", "portable-atomic" ]
52
53# Enables semver-exempt APIs of this crate.
54# At the moment, this feature is unused.
55unstable = []
56
57# Only for backwards compatibility.
58atomic-polyfill = ["critical-section"]
59
60[[example]]
61name = "bench"
62required-features = ["std"]
63
64[[example]]
65name = "bench_acquire"
66required-features = ["std"]
67
68[[example]]
69name = "lazy_static"
70required-features = ["std"]
71
72[[example]]
73name = "reentrant_init_deadlocks"
74required-features = ["std"]
75
76[[example]]
77name = "regex"
78required-features = ["std"]
79
80[[example]]
81name = "test_synchronization"
82required-features = ["std"]
83
84[package.metadata.docs.rs]
85all-features = true
86rustdoc-args = ["--generate-link-to-definition"]
87