| 1 | [package] |
| 2 | name = "portable-atomic" |
| 3 | version = "1.11.0" #publish:version |
| 4 | edition = "2018" |
| 5 | rust-version = "1.34" # For Atomic{I,U}{8,16,32,64} |
| 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_unstable_f16" , "--cfg" , "portable_atomic_unstable_f128" ] |
| 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.60" , 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 | build-context = "0.1" |
| 87 | crossbeam-utils = "=0.8.16" # The latest crossbeam-utils requires Rust 1.60 |
| 88 | fastrand = "2" |
| 89 | paste = "1" |
| 90 | quickcheck = { version = "1" , default-features = false, git = "https://github.com/taiki-e/quickcheck.git" , rev = "83b1d59" } # https://github.com/BurntSushi/quickcheck/pull/304 + https://github.com/BurntSushi/quickcheck/pull/282 + https://github.com/BurntSushi/quickcheck/pull/296 + f16/f128 support + lower MSRV |
| 91 | serde_test = { git = "https://github.com/taiki-e/serde_test.git" , rev = "f35c385" } # support {i,u}128 |
| 92 | sptr = "0.3" |
| 93 | static_assertions = "1" |
| 94 | test-helper = { features = ["sys" , "cpuinfo" , "critical-section-std" ], git = "https://github.com/taiki-e/test-helper.git" , rev = "d2272e8" } |
| 95 | |
| 96 | [target.'cfg(unix)'.dev-dependencies] |
| 97 | libc = "=0.2.163" # newer libc requires Rust 1.63 |
| 98 | |
| 99 | [target.'cfg(windows)'.dev-dependencies] |
| 100 | windows-sys = { version = "0.59" , features = [ |
| 101 | "Win32_Foundation" , |
| 102 | "Win32_System_Threading" , |
| 103 | ] } |
| 104 | |
| 105 | [lints] |
| 106 | workspace = true |
| 107 | |
| 108 | [workspace] |
| 109 | members = [ |
| 110 | "bench" , |
| 111 | "portable-atomic-util" , |
| 112 | "tests/api-test" , |
| 113 | ] |
| 114 | |
| 115 | # This table is shared by projects under github.com/taiki-e. |
| 116 | # Expect for unexpected_cfgs.check-cfg, it is not intended for manual editing. |
| 117 | [workspace.lints.rust] |
| 118 | deprecated_safe = "warn" |
| 119 | improper_ctypes = "warn" |
| 120 | improper_ctypes_definitions = "warn" |
| 121 | non_ascii_idents = "warn" |
| 122 | rust_2018_idioms = "warn" |
| 123 | single_use_lifetimes = "warn" |
| 124 | unexpected_cfgs = { level = "warn" , check-cfg = [ |
| 125 | 'cfg(target_arch,values("xtensa"))' , # 1.81+ https://github.com/rust-lang/rust/pull/125141 |
| 126 | 'cfg(target_arch,values("amdgpu"))' , # 1.86+ https://github.com/rust-lang/rust/pull/134740 |
| 127 | 'cfg(target_os,values("psx"))' , # 1.84+ https://github.com/rust-lang/rust/pull/131168 |
| 128 | 'cfg(target_env,values("psx"))' , # pre-1.84 https://github.com/rust-lang/rust/pull/131168 |
| 129 | 'cfg(target_feature,values("lse2","lse128","rcpc3"))' , # 1.82+ https://github.com/rust-lang/rust/pull/128192 |
| 130 | 'cfg(target_feature,values("quadword-atomics"))' , # 1.83+ https://github.com/rust-lang/rust/pull/130873 |
| 131 | 'cfg(target_feature,values("zaamo","zabha"))' , # 1.83+ https://github.com/rust-lang/rust/pull/130877 |
| 132 | 'cfg(target_pointer_width,values("128"))' , |
| 133 | # Known custom cfgs, excluding those that may be set by build script. |
| 134 | # Not public API. |
| 135 | 'cfg(portable_atomic_test_outline_atomics_detect_false,qemu,valgrind)' , |
| 136 | # Public APIs, considered unstable unless documented as stable in readme. |
| 137 | 'cfg(portable_atomic_no_outline_atomics,portable_atomic_outline_atomics,portable_atomic_unstable_f16,portable_atomic_unstable_f128)' , |
| 138 | # Public unstable API(s) - portable-atomic-util |
| 139 | 'cfg(portable_atomic_unstable_coerce_unsized)' , |
| 140 | ] } |
| 141 | unnameable_types = "warn" |
| 142 | unreachable_pub = "warn" |
| 143 | # unsafe_op_in_unsafe_fn = "warn" # Set at crate-level instead since https://github.com/rust-lang/rust/pull/100081 merged in Rust 1.65 is not available on MSRV |
| 144 | [workspace.lints.clippy] |
| 145 | all = "warn" # Downgrade deny-by-default lints |
| 146 | pedantic = "warn" |
| 147 | as_ptr_cast_mut = "warn" |
| 148 | as_underscore = "warn" |
| 149 | default_union_representation = "warn" |
| 150 | inline_asm_x86_att_syntax = "warn" |
| 151 | trailing_empty_array = "warn" |
| 152 | transmute_undefined_repr = "warn" |
| 153 | undocumented_unsafe_blocks = "warn" |
| 154 | unused_trait_names = "warn" |
| 155 | # Suppress buggy or noisy clippy lints |
| 156 | bool_assert_comparison = { level = "allow" , priority = 1 } |
| 157 | borrow_as_ptr = { level = "allow" , priority = 1 } # https://github.com/rust-lang/rust-clippy/issues/8286 |
| 158 | cast_lossless = { level = "allow" , priority = 1 } # https://godbolt.org/z/Pv6vbGG6E |
| 159 | declare_interior_mutable_const = { level = "allow" , priority = 1 } # https://github.com/rust-lang/rust-clippy/issues/7665 |
| 160 | doc_markdown = { level = "allow" , priority = 1 } |
| 161 | float_cmp = { level = "allow" , priority = 1 } # https://github.com/rust-lang/rust-clippy/issues/7725 |
| 162 | incompatible_msrv = { level = "allow" , priority = 1 } # buggy: doesn't consider cfg, https://github.com/rust-lang/rust-clippy/issues/12280, https://github.com/rust-lang/rust-clippy/issues/12257#issuecomment-2093667187 |
| 163 | lint_groups_priority = { level = "allow" , priority = 1 } # https://github.com/rust-lang/rust-clippy/issues/12920 |
| 164 | manual_assert = { level = "allow" , priority = 1 } |
| 165 | manual_range_contains = { level = "allow" , priority = 1 } # https://github.com/rust-lang/rust-clippy/issues/6455#issuecomment-1225966395 |
| 166 | missing_errors_doc = { level = "allow" , priority = 1 } |
| 167 | module_name_repetitions = { level = "allow" , priority = 1 } # buggy: https://github.com/rust-lang/rust-clippy/issues?q=is%3Aissue+is%3Aopen+module_name_repetitions |
| 168 | naive_bytecount = { level = "allow" , priority = 1 } |
| 169 | nonminimal_bool = { level = "allow" , priority = 1 } # buggy: https://github.com/rust-lang/rust-clippy/issues?q=is%3Aissue+is%3Aopen+nonminimal_bool |
| 170 | range_plus_one = { level = "allow" , priority = 1 } # buggy: https://github.com/rust-lang/rust-clippy/issues?q=is%3Aissue+is%3Aopen+range_plus_one |
| 171 | similar_names = { level = "allow" , priority = 1 } |
| 172 | single_match = { level = "allow" , priority = 1 } |
| 173 | single_match_else = { level = "allow" , priority = 1 } |
| 174 | struct_excessive_bools = { level = "allow" , priority = 1 } |
| 175 | struct_field_names = { level = "allow" , priority = 1 } |
| 176 | too_many_arguments = { level = "allow" , priority = 1 } |
| 177 | too_many_lines = { level = "allow" , priority = 1 } |
| 178 | type_complexity = { level = "allow" , priority = 1 } |
| 179 | unreadable_literal = { level = "allow" , priority = 1 } |
| 180 | |