1 | [package] |
2 | name = "portable-atomic" |
3 | version = "1.6.0" #publish:version |
4 | edition = "2018" |
5 | rust-version = "1.34" |
6 | license = "Apache-2.0 OR MIT" |
7 | repository = "https://github.com/taiki-e/portable-atomic" |
8 | keywords = ["atomic" ] |
9 | categories = ["concurrency" , "embedded" , "hardware-support" , "no-std" , "no-std::no-alloc" ] |
10 | exclude = ["/.*" , "/tools" , "/target-specs" , "/DEVELOPMENT.md" ] |
11 | description = "" " |
12 | Portable atomic types including support for 128-bit atomics, atomic float, etc. |
13 | " "" |
14 | |
15 | [package.metadata.docs.rs] |
16 | # NB: sync with: |
17 | # - env.TEST_FEATURES in .github/workflows/ci.yml. |
18 | # - test_features list in tools/build.sh and tools/test.sh. |
19 | features = ["float" , "std" , "serde" , "critical-section" ] |
20 | rustdoc-args = ["--cfg" , "portable_atomic_doc_cfg" ] |
21 | targets = ["x86_64-unknown-linux-gnu" ] |
22 | |
23 | [package.metadata.cargo_check_external_types] |
24 | # The following are external types that are allowed to be exposed in our public API. |
25 | allowed_external_types = [ |
26 | "serde::*" , |
27 | ] |
28 | |
29 | [lib] |
30 | doc-scrape-examples = false |
31 | |
32 | [features] |
33 | default = ["fallback" ] |
34 | |
35 | # (enabled by default) Enable fallback implementations. |
36 | # |
37 | # Disabling this allows only atomic types for which the platform natively supports atomic operations. |
38 | fallback = [] |
39 | |
40 | # Provide `AtomicF{32,64}`. |
41 | # |
42 | # See documentation for more: https://github.com/taiki-e/portable-atomic#optional-features-float |
43 | float = [] |
44 | |
45 | # Use `std`. |
46 | std = [] |
47 | |
48 | # Emit compile error if atomic CAS is not available. |
49 | # |
50 | # See documentation for more: https://github.com/taiki-e/portable-atomic#optional-features-require-cas |
51 | require-cas = [] |
52 | |
53 | # Assume the target is single core, to enable implementations based on disabling interrupts. |
54 | # IMPORTANT: This feature is unsafe. See the documentation for the safety contract: |
55 | # https://github.com/taiki-e/portable-atomic#optional-features-unsafe-assume-single-core |
56 | unsafe-assume-single-core = [] |
57 | |
58 | # The following are sub-features of the unsafe-assume-single-core feature and if enabled without |
59 | # the unsafe-assume-single-core feature will result in a compile error. |
60 | # There is no explicit "unsafe-" prefix because the user has already opted in to "unsafe" by |
61 | # enabling the unsafe-assume-single-core feature, but misuse of these features is also usually |
62 | # considered unsound. |
63 | # See the interrupt module's readme for more: https://github.com/taiki-e/portable-atomic/blob/HEAD/src/imp/interrupt/README.md |
64 | |
65 | # For RISC-V targets, generate code for S mode to disable interrupts. |
66 | s-mode = [] |
67 | # For RISC-V targets, use AMO instructions even if A-extension is disabled. |
68 | # This feature requires Rust 1.72+. |
69 | force-amo = [] |
70 | # For ARM targets, also disable FIQs when disabling interrupts. |
71 | disable-fiq = [] |
72 | |
73 | # Note: serde and critical-section are public dependencies. |
74 | [dependencies] |
75 | # Implements serde::{Serialize,Deserialize} for atomic types. |
76 | # |
77 | # See documentation for more: https://github.com/taiki-e/portable-atomic#optional-features-serde |
78 | serde = { version = "1.0.103" , optional = true, default-features = false } |
79 | |
80 | # Use `critical-section`. |
81 | # |
82 | # See documentation for more: https://github.com/taiki-e/portable-atomic#optional-features-critical-section |
83 | critical-section = { version = "1" , optional = true } |
84 | |
85 | [dev-dependencies] |
86 | test-helper = { path = "tests/helper" , features = ["std" ] } |
87 | |
88 | build-context = "0.1" |
89 | crossbeam-utils = "0.8" |
90 | fastrand = "2" |
91 | paste = "1" |
92 | quickcheck = { default-features = false, git = "https://github.com/taiki-e/quickcheck.git" , branch = "dev" } # https://github.com/BurntSushi/quickcheck/pull/304 + https://github.com/BurntSushi/quickcheck/pull/282 + lower MSRV |
93 | sptr = "0.3" |
94 | static_assertions = "1" |
95 | |
96 | [lints] |
97 | workspace = true |
98 | |
99 | [workspace] |
100 | members = [ |
101 | "bench" , |
102 | "portable-atomic-util" , |
103 | "tests/api-test" , |
104 | "tests/helper" , |
105 | "tools/codegen" , |
106 | ] |
107 | |
108 | # This table is shared by projects under https://github.com/taiki-e. |
109 | # It is not intended for manual editing. |
110 | [workspace.lints.rust] |
111 | improper_ctypes = "warn" |
112 | improper_ctypes_definitions = "warn" |
113 | non_ascii_idents = "warn" |
114 | rust_2018_idioms = "warn" |
115 | single_use_lifetimes = "warn" |
116 | unreachable_pub = "warn" |
117 | # unsafe_op_in_unsafe_fn = "warn" # Set at crate-level instead since https://github.com/rust-lang/rust/pull/100081 is not available on MSRV |
118 | [workspace.lints.clippy] |
119 | all = "warn" # Downgrade deny-by-default lints |
120 | pedantic = "warn" |
121 | as_ptr_cast_mut = "warn" |
122 | default_union_representation = "warn" |
123 | inline_asm_x86_att_syntax = "warn" |
124 | trailing_empty_array = "warn" |
125 | transmute_undefined_repr = "warn" |
126 | undocumented_unsafe_blocks = "warn" |
127 | # Suppress buggy or noisy clippy lints |
128 | borrow_as_ptr = { level = "allow" , priority = 1 } # https://github.com/rust-lang/rust-clippy/issues/8286 |
129 | doc_markdown = { level = "allow" , priority = 1 } |
130 | float_cmp = { level = "allow" , priority = 1 } # https://github.com/rust-lang/rust-clippy/issues/7725 |
131 | manual_assert = { level = "allow" , priority = 1 } |
132 | manual_range_contains = { level = "allow" , priority = 1 } # https://github.com/rust-lang/rust-clippy/issues/6455#issuecomment-1225966395 |
133 | missing_errors_doc = { level = "allow" , priority = 1 } |
134 | module_name_repetitions = { level = "allow" , priority = 1 } |
135 | similar_names = { level = "allow" , priority = 1 } |
136 | single_match = { level = "allow" , priority = 1 } |
137 | single_match_else = { level = "allow" , priority = 1 } |
138 | struct_excessive_bools = { level = "allow" , priority = 1 } |
139 | too_many_arguments = { level = "allow" , priority = 1 } |
140 | too_many_lines = { level = "allow" , priority = 1 } |
141 | type_complexity = { level = "allow" , priority = 1 } |
142 | |