diff --git a/Cargo.toml b/Cargo.toml index dd1d17446..d7ef2ceb4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,14 +21,14 @@ categories = ["network-programming", "data-structures"] [features] default = ["std"] std = [] -# Use portable-atomic crate to support platforms without atomic CAS. -# See https://docs.rs/portable-atomic for more information. -extra-platforms = ["portable-atomic"] [dependencies] serde = { version = "1.0.60", optional = true, default-features = false, features = ["alloc"] } +# Use portable-atomic crate to support platforms without atomic CAS. +# See "no_std support" section in readme for more information. +# # Enable require-cas feature to provide a better error message if the end user forgets to use the cfg or feature. -portable-atomic = { version = "1.3", optional = true, default-features = false, features = ["require-cas"] } +extra-platforms = { package = "portable-atomic", version = "1.3", optional = true, default-features = false, features = ["require-cas"] } [dev-dependencies] serde_test = "1.0" diff --git a/README.md b/README.md index 03017890d..90d631c97 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,8 @@ To use `bytes` with no_std environment without atomic CAS, such as thumbv6m, you the `extra-platforms` feature. See the [documentation for the `portable-atomic` crate](https://docs.rs/portable-atomic) for more information. +The MSRV when `extra-platforms` feature is enabled depends on the MSRV of `portable-atomic`. + ## Serde support Serde support is optional and disabled by default. To enable use the feature `serde`. @@ -49,6 +51,8 @@ Serde support is optional and disabled by default. To enable use the feature `se bytes = { version = "1", features = ["serde"] } ``` +The MSRV when `serde` feature is enabled depends on the MSRV of `serde`. + ## Building documentation When building the `bytes` documentation the `docsrs` option should be used, otherwise diff --git a/src/loom.rs b/src/loom.rs index 7d83b90ea..c80929092 100644 --- a/src/loom.rs +++ b/src/loom.rs @@ -4,7 +4,7 @@ pub(crate) mod sync { #[cfg(not(feature = "extra-platforms"))] pub(crate) use core::sync::atomic::{AtomicPtr, AtomicUsize, Ordering}; #[cfg(feature = "extra-platforms")] - pub(crate) use portable_atomic::{AtomicPtr, AtomicUsize, Ordering}; + pub(crate) use extra_platforms::{AtomicPtr, AtomicUsize, Ordering}; pub(crate) trait AtomicMut { fn with_mut(&mut self, f: F) -> R