diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bf456b33a..c91411875 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: - crossbeam-skiplist - crossbeam-utils rust: - - 1.28.0 + - 1.36.0 - nightly steps: - uses: actions/checkout@master @@ -36,12 +36,6 @@ jobs: run: | rustup target add thumbv7m-none-eabi rustup target add thumbv6m-none-eabi - # cfg-if 0.1.10 requires Rust 1.31+ so downgrade it. - - name: Downgrade dependencies - if: matrix.rust == '1.28.0' - run: | - cargo generate-lockfile - cargo update -p cfg-if --precise 0.1.9 - name: Test run: ./ci/${{ matrix.crates }}.sh diff --git a/README.md b/README.md index 912764186..528afb4fa 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ https://github.com/crossbeam-rs/crossbeam) https://crates.io/crates/crossbeam) [![Documentation](https://docs.rs/crossbeam/badge.svg)]( https://docs.rs/crossbeam) -[![Rust 1.28+](https://img.shields.io/badge/rust-1.28+-lightgray.svg)]( +[![Rust 1.36+](https://img.shields.io/badge/rust-1.36+-lightgray.svg)]( https://www.rust-lang.org) [![chat](https://img.shields.io/discord/569610676205781012.svg?logo=discord)](https://discordapp.com/invite/JXYwgWZ) @@ -98,7 +98,9 @@ extern crate crossbeam; ## Compatibility -The minimum supported Rust version is 1.28. Any change to this is considered a breaking change. +Crossbeam supports stable Rust releases going back at least six months, +and every time the minimum supported Rust version is increased, a new minor +version is released. Currently, the minimum supported Rust version is 1.36. ## Contributing diff --git a/bors.toml b/bors.toml index 483988da3..21bb0c31f 100644 --- a/bors.toml +++ b/bors.toml @@ -1,17 +1,17 @@ status = [ - "test (crossbeam, 1.28.0)", + "test (crossbeam, 1.36.0)", "test (crossbeam, nightly)", - "test (crossbeam-channel, 1.28.0)", + "test (crossbeam-channel, 1.36.0)", "test (crossbeam-channel, nightly)", - "test (crossbeam-deque, 1.28.0)", + "test (crossbeam-deque, 1.36.0)", "test (crossbeam-deque, nightly)", - "test (crossbeam-epoch, 1.28.0)", + "test (crossbeam-epoch, 1.36.0)", "test (crossbeam-epoch, nightly)", - "test (crossbeam-queue, 1.28.0)", + "test (crossbeam-queue, 1.36.0)", "test (crossbeam-queue, nightly)", - "test (crossbeam-skiplist, 1.28.0)", + "test (crossbeam-skiplist, 1.36.0)", "test (crossbeam-skiplist, nightly)", - "test (crossbeam-utils, 1.28.0)", + "test (crossbeam-utils, 1.36.0)", "test (crossbeam-utils, nightly)", "dependencies", "rustfmt", diff --git a/crossbeam-channel/Cargo.toml b/crossbeam-channel/Cargo.toml index c16e03397..c3de222cf 100644 --- a/crossbeam-channel/Cargo.toml +++ b/crossbeam-channel/Cargo.toml @@ -15,9 +15,6 @@ description = "Multi-producer multi-consumer channels for message passing" keywords = ["channel", "mpmc", "select", "golang", "message"] categories = ["algorithms", "concurrency", "data-structures"] -[dependencies] -maybe-uninit = "2.0.0" - [dependencies.crossbeam-utils] version = "0.7" path = "../crossbeam-utils" diff --git a/crossbeam-channel/README.md b/crossbeam-channel/README.md index be2e0b8f3..914965135 100644 --- a/crossbeam-channel/README.md +++ b/crossbeam-channel/README.md @@ -8,7 +8,7 @@ https://github.com/crossbeam-rs/crossbeam-channel) https://crates.io/crates/crossbeam-channel) [![Documentation](https://docs.rs/crossbeam-channel/badge.svg)]( https://docs.rs/crossbeam-channel) -[![Rust 1.28+](https://img.shields.io/badge/rust-1.28+-lightgray.svg)]( +[![Rust 1.36+](https://img.shields.io/badge/rust-1.36+-lightgray.svg)]( https://www.rust-lang.org) [![chat](https://img.shields.io/discord/569610676205781012.svg?logo=discord)](https://discord.gg/BBYwKq) @@ -53,7 +53,9 @@ extern crate crossbeam_channel; ## Compatibility -The minimum supported Rust version is 1.28. Any change to this is considered a breaking change. +Crossbeam Channel supports stable Rust releases going back at least six months, +and every time the minimum supported Rust version is increased, a new minor +version is released. Currently, the minimum supported Rust version is 1.36. ## License diff --git a/crossbeam-channel/src/flavors/array.rs b/crossbeam-channel/src/flavors/array.rs index 29aa6a129..8d9bf7f9b 100644 --- a/crossbeam-channel/src/flavors/array.rs +++ b/crossbeam-channel/src/flavors/array.rs @@ -15,15 +15,13 @@ use std::cell::UnsafeCell; use std::marker::PhantomData; -use std::mem; +use std::mem::{self, MaybeUninit}; use std::ptr; use std::sync::atomic::{self, AtomicUsize, Ordering}; use std::time::Instant; use crossbeam_utils::{Backoff, CachePadded}; -use maybe_uninit::MaybeUninit; - use context::Context; use err::{RecvTimeoutError, SendTimeoutError, TryRecvError, TrySendError}; use select::{Operation, SelectHandle, Selected, Token}; diff --git a/crossbeam-channel/src/flavors/list.rs b/crossbeam-channel/src/flavors/list.rs index f2ae8cfd1..a4ecbe753 100644 --- a/crossbeam-channel/src/flavors/list.rs +++ b/crossbeam-channel/src/flavors/list.rs @@ -2,14 +2,13 @@ use std::cell::UnsafeCell; use std::marker::PhantomData; +use std::mem::MaybeUninit; use std::ptr; use std::sync::atomic::{self, AtomicPtr, AtomicUsize, Ordering}; use std::time::Instant; use crossbeam_utils::{Backoff, CachePadded}; -use maybe_uninit::MaybeUninit; - use context::Context; use err::{RecvTimeoutError, SendTimeoutError, TryRecvError, TrySendError}; use select::{Operation, SelectHandle, Selected, Token}; diff --git a/crossbeam-channel/src/lib.rs b/crossbeam-channel/src/lib.rs index 898239632..1d5160056 100644 --- a/crossbeam-channel/src/lib.rs +++ b/crossbeam-channel/src/lib.rs @@ -348,7 +348,6 @@ #![warn(missing_debug_implementations)] extern crate crossbeam_utils; -extern crate maybe_uninit; mod channel; mod context; diff --git a/crossbeam-deque/Cargo.toml b/crossbeam-deque/Cargo.toml index ea63fb608..f632b9665 100644 --- a/crossbeam-deque/Cargo.toml +++ b/crossbeam-deque/Cargo.toml @@ -15,9 +15,6 @@ description = "Concurrent work-stealing deque" keywords = ["chase-lev", "lock-free", "scheduler", "scheduling"] categories = ["algorithms", "concurrency", "data-structures"] -[dependencies] -maybe-uninit = "2.0.0" - [dependencies.crossbeam-epoch] version = "0.8" path = "../crossbeam-epoch" diff --git a/crossbeam-deque/README.md b/crossbeam-deque/README.md index a5ef93a92..28c88d47b 100644 --- a/crossbeam-deque/README.md +++ b/crossbeam-deque/README.md @@ -8,7 +8,7 @@ https://github.com/crossbeam-rs/crossbeam-deque) https://crates.io/crates/crossbeam-deque) [![Documentation](https://docs.rs/crossbeam-deque/badge.svg)]( https://docs.rs/crossbeam-deque) -[![Rust 1.28+](https://img.shields.io/badge/rust-1.28+-lightgray.svg)]( +[![Rust 1.36+](https://img.shields.io/badge/rust-1.36+-lightgray.svg)]( https://www.rust-lang.org) [![chat](https://img.shields.io/discord/569610676205781012.svg?logo=discord)](https://discord.gg/BBYwKq) @@ -32,7 +32,9 @@ extern crate crossbeam_deque; ## Compatibility -The minimum supported Rust version is 1.28. Any change to this is considered a breaking change. +Crossbeam Deque supports stable Rust releases going back at least six months, +and every time the minimum supported Rust version is increased, a new minor +version is released. Currently, the minimum supported Rust version is 1.36. ## License diff --git a/crossbeam-deque/src/lib.rs b/crossbeam-deque/src/lib.rs index cdab3cbec..8ade7b72f 100644 --- a/crossbeam-deque/src/lib.rs +++ b/crossbeam-deque/src/lib.rs @@ -92,14 +92,12 @@ extern crate crossbeam_epoch as epoch; extern crate crossbeam_utils as utils; -extern crate maybe_uninit; - use std::cell::{Cell, UnsafeCell}; use std::cmp; use std::fmt; use std::iter::FromIterator; use std::marker::PhantomData; -use std::mem; +use std::mem::{self, MaybeUninit}; use std::ptr; use std::sync::atomic::{self, AtomicIsize, AtomicPtr, AtomicUsize, Ordering}; use std::sync::Arc; @@ -107,8 +105,6 @@ use std::sync::Arc; use epoch::{Atomic, Owned}; use utils::{Backoff, CachePadded}; -use maybe_uninit::MaybeUninit; - // Minimum buffer capacity. const MIN_CAP: usize = 64; // Maximum number of tasks that can be stolen in `steal_batch()` and `steal_batch_and_pop()`. diff --git a/crossbeam-epoch/Cargo.toml b/crossbeam-epoch/Cargo.toml index a1a056f5e..14a9ac50b 100644 --- a/crossbeam-epoch/Cargo.toml +++ b/crossbeam-epoch/Cargo.toml @@ -24,7 +24,6 @@ sanitize = [] # Makes it more likely to trigger any potential data races. [dependencies] cfg-if = "0.1.2" -maybe-uninit = "2.0.0" memoffset = "0.5" [dependencies.crossbeam-utils] @@ -40,8 +39,5 @@ optional = true version = "1" default-features = false -[build-dependencies] -autocfg = "1" - [dev-dependencies] rand = "0.6" diff --git a/crossbeam-epoch/README.md b/crossbeam-epoch/README.md index 79b4c773e..fd6dba778 100644 --- a/crossbeam-epoch/README.md +++ b/crossbeam-epoch/README.md @@ -8,7 +8,7 @@ https://github.com/crossbeam-rs/crossbeam-epoch) https://crates.io/crates/crossbeam-epoch) [![Documentation](https://docs.rs/crossbeam-epoch/badge.svg)]( https://docs.rs/crossbeam-epoch) -[![Rust 1.28+](https://img.shields.io/badge/rust-1.28+-lightgray.svg)]( +[![Rust 1.36+](https://img.shields.io/badge/rust-1.36+-lightgray.svg)]( https://www.rust-lang.org) [![chat](https://img.shields.io/discord/569610676205781012.svg?logo=discord)](https://discord.gg/BBYwKq) @@ -39,7 +39,9 @@ extern crate crossbeam_epoch as epoch; ## Compatibility -The minimum supported Rust version is 1.28. Any change to this is considered a breaking change. +Crossbeam Epoch supports stable Rust releases going back at least six months, +and every time the minimum supported Rust version is increased, a new minor +version is released. Currently, the minimum supported Rust version is 1.36. ## License diff --git a/crossbeam-epoch/build.rs b/crossbeam-epoch/build.rs deleted file mode 100644 index d451c24b2..000000000 --- a/crossbeam-epoch/build.rs +++ /dev/null @@ -1,8 +0,0 @@ -extern crate autocfg; - -fn main() { - let cfg = autocfg::new(); - if cfg.probe_rustc_version(1, 31) { - println!("cargo:rustc-cfg=has_min_const_fn"); - } -} diff --git a/crossbeam-epoch/src/atomic.rs b/crossbeam-epoch/src/atomic.rs index a2044740b..69107e695 100644 --- a/crossbeam-epoch/src/atomic.rs +++ b/crossbeam-epoch/src/atomic.rs @@ -150,24 +150,6 @@ impl Atomic { /// /// let a = Atomic::::null(); /// ``` - #[cfg(not(has_min_const_fn))] - pub fn null() -> Atomic { - Self { - data: AtomicUsize::new(0), - _marker: PhantomData, - } - } - - /// Returns a new null atomic pointer. - /// - /// # Examples - /// - /// ``` - /// use crossbeam_epoch::Atomic; - /// - /// let a = Atomic::::null(); - /// ``` - #[cfg(has_min_const_fn)] pub const fn null() -> Atomic { Self { data: AtomicUsize::new(0), diff --git a/crossbeam-epoch/src/deferred.rs b/crossbeam-epoch/src/deferred.rs index a0970f115..4f620de92 100644 --- a/crossbeam-epoch/src/deferred.rs +++ b/crossbeam-epoch/src/deferred.rs @@ -1,11 +1,9 @@ use alloc::boxed::Box; use core::fmt; use core::marker::PhantomData; -use core::mem; +use core::mem::{self, MaybeUninit}; use core::ptr; -use maybe_uninit::MaybeUninit; - /// Number of words a piece of `Data` can hold. /// /// Three words should be enough for the majority of cases. For example, you can fit inside it the diff --git a/crossbeam-epoch/src/lib.rs b/crossbeam-epoch/src/lib.rs index 282bbe90f..2498f9dd8 100644 --- a/crossbeam-epoch/src/lib.rs +++ b/crossbeam-epoch/src/lib.rs @@ -64,8 +64,6 @@ extern crate cfg_if; #[cfg(feature = "std")] extern crate core; -extern crate maybe_uninit; - cfg_if! { if #[cfg(feature = "alloc")] { extern crate alloc; diff --git a/crossbeam-epoch/src/sync/queue.rs b/crossbeam-epoch/src/sync/queue.rs index 99fb6a1c4..71257b293 100644 --- a/crossbeam-epoch/src/sync/queue.rs +++ b/crossbeam-epoch/src/sync/queue.rs @@ -8,12 +8,11 @@ //! Simon Doherty, Lindsay Groves, Victor Luchangco, and Mark Moir. 2004b. Formal Verification of a //! Practical Lock-Free Queue Algorithm. https://doi.org/10.1007/978-3-540-30232-2_7 +use core::mem::MaybeUninit; use core::sync::atomic::Ordering::{Acquire, Relaxed, Release}; use crossbeam_utils::CachePadded; -use maybe_uninit::MaybeUninit; - use {unprotected, Atomic, Guard, Owned, Shared}; // The representation here is a singly-linked list, with a sentinel node at the front. In general diff --git a/crossbeam-queue/Cargo.toml b/crossbeam-queue/Cargo.toml index 28a22c8c2..df62887af 100644 --- a/crossbeam-queue/Cargo.toml +++ b/crossbeam-queue/Cargo.toml @@ -23,7 +23,6 @@ nightly = [] [dependencies] cfg-if = "0.1.2" -maybe-uninit = "2.0.0" [dependencies.crossbeam-utils] version = "0.7" diff --git a/crossbeam-queue/README.md b/crossbeam-queue/README.md index 646f9cfaa..2735aca0b 100644 --- a/crossbeam-queue/README.md +++ b/crossbeam-queue/README.md @@ -8,7 +8,7 @@ https://github.com/crossbeam-rs/crossbeam-queue/tree/master/src) https://crates.io/crates/crossbeam-queue) [![Documentation](https://docs.rs/crossbeam-queue/badge.svg)]( https://docs.rs/crossbeam-queue) -[![Rust 1.28+](https://img.shields.io/badge/rust-1.28+-lightgray.svg)]( +[![Rust 1.36+](https://img.shields.io/badge/rust-1.36+-lightgray.svg)]( https://www.rust-lang.org) [![chat](https://img.shields.io/discord/569610676205781012.svg?logo=discord)](https://discord.gg/BBYwKq) @@ -37,7 +37,9 @@ extern crate crossbeam_queue; ## Compatibility -The minimum supported Rust version is 1.28. Any change to this is considered a breaking change. +Crossbeam Queue supports stable Rust releases going back at least six months, +and every time the minimum supported Rust version is increased, a new minor +version is released. Currently, the minimum supported Rust version is 1.36. ## License diff --git a/crossbeam-queue/src/array_queue.rs b/crossbeam-queue/src/array_queue.rs index bce9d2d69..b3b354187 100644 --- a/crossbeam-queue/src/array_queue.rs +++ b/crossbeam-queue/src/array_queue.rs @@ -12,13 +12,11 @@ use alloc::vec::Vec; use core::cell::UnsafeCell; use core::fmt; use core::marker::PhantomData; -use core::mem; +use core::mem::{self, MaybeUninit}; use core::sync::atomic::{self, AtomicUsize, Ordering}; use crossbeam_utils::{Backoff, CachePadded}; -use maybe_uninit::MaybeUninit; - use err::{PopError, PushError}; /// A slot in a queue. diff --git a/crossbeam-queue/src/lib.rs b/crossbeam-queue/src/lib.rs index 31ad80414..0bf12fb01 100644 --- a/crossbeam-queue/src/lib.rs +++ b/crossbeam-queue/src/lib.rs @@ -18,8 +18,6 @@ extern crate cfg_if; #[cfg(feature = "std")] extern crate core; -extern crate maybe_uninit; - cfg_if! { if #[cfg(feature = "alloc")] { extern crate alloc; diff --git a/crossbeam-queue/src/seg_queue.rs b/crossbeam-queue/src/seg_queue.rs index 85725f9b7..f32e8dd6c 100644 --- a/crossbeam-queue/src/seg_queue.rs +++ b/crossbeam-queue/src/seg_queue.rs @@ -2,13 +2,12 @@ use alloc::boxed::Box; use core::cell::UnsafeCell; use core::fmt; use core::marker::PhantomData; +use core::mem::MaybeUninit; use core::ptr; use core::sync::atomic::{self, AtomicPtr, AtomicUsize, Ordering}; use crossbeam_utils::{Backoff, CachePadded}; -use maybe_uninit::MaybeUninit; - use err::PopError; // Bits indicating the state of a slot: diff --git a/crossbeam-skiplist/README.md b/crossbeam-skiplist/README.md index 7b6e4e76f..288b9bc26 100644 --- a/crossbeam-skiplist/README.md +++ b/crossbeam-skiplist/README.md @@ -8,7 +8,7 @@ https://github.com/crossbeam-rs/crossbeam-skiplist) https://crates.io/crates/crossbeam-skiplist) [![Documentation](https://docs.rs/crossbeam-skiplist/badge.svg)]( https://docs.rs/crossbeam-skiplist) -[![Rust 1.28+](https://img.shields.io/badge/rust-1.28+-lightgray.svg)]( +[![Rust 1.36+](https://img.shields.io/badge/rust-1.36+-lightgray.svg)]( https://www.rust-lang.org) [![chat](https://img.shields.io/discord/569610676205781012.svg?logo=discord)](https://discord.gg/BBYwKq) @@ -35,7 +35,9 @@ extern crate crossbeam_skiplist; ## Compatibility -The minimum supported Rust version is 1.28. Any change to this is considered a breaking change. +Crossbeam Skiplist supports stable Rust releases going back at least six months, +and every time the minimum supported Rust version is increased, a new minor +version is released. Currently, the minimum supported Rust version is 1.36. ## License diff --git a/crossbeam-utils/README.md b/crossbeam-utils/README.md index ffb1ab424..39b82c862 100644 --- a/crossbeam-utils/README.md +++ b/crossbeam-utils/README.md @@ -8,7 +8,7 @@ https://github.com/crossbeam-rs/crossbeam-utils/tree/master/src) https://crates.io/crates/crossbeam-utils) [![Documentation](https://docs.rs/crossbeam-utils/badge.svg)]( https://docs.rs/crossbeam-utils) -[![Rust 1.28+](https://img.shields.io/badge/rust-1.28+-lightgray.svg)]( +[![Rust 1.36+](https://img.shields.io/badge/rust-1.36+-lightgray.svg)]( https://www.rust-lang.org) [![chat](https://img.shields.io/discord/569610676205781012.svg?logo=discord)](https://discord.gg/BBYwKq) @@ -59,7 +59,9 @@ extern crate crossbeam_utils; ## Compatibility -The minimum supported Rust version is 1.28. Any change to this is considered a breaking change. +Crossbeam Utils supports stable Rust releases going back at least six months, +and every time the minimum supported Rust version is increased, a new minor +version is released. Currently, the minimum supported Rust version is 1.36. ## License diff --git a/crossbeam-utils/build.rs b/crossbeam-utils/build.rs index 2f5012ad7..6bd8d3109 100644 --- a/crossbeam-utils/build.rs +++ b/crossbeam-utils/build.rs @@ -2,10 +2,6 @@ extern crate autocfg; fn main() { let cfg = autocfg::new(); - if cfg.probe_rustc_version(1, 31) { - autocfg::emit("has_min_const_fn"); - } - cfg.emit_type_cfg("core::sync::atomic::AtomicU8", "has_atomic_u8"); cfg.emit_type_cfg("core::sync::atomic::AtomicU16", "has_atomic_u16"); cfg.emit_type_cfg("core::sync::atomic::AtomicU32", "has_atomic_u32"); diff --git a/crossbeam-utils/src/atomic/atomic_cell.rs b/crossbeam-utils/src/atomic/atomic_cell.rs index cf0658aad..4cc9f8091 100644 --- a/crossbeam-utils/src/atomic/atomic_cell.rs +++ b/crossbeam-utils/src/atomic/atomic_cell.rs @@ -51,23 +51,6 @@ impl AtomicCell { /// /// let a = AtomicCell::new(7); /// ``` - #[cfg(not(has_min_const_fn))] - pub fn new(val: T) -> AtomicCell { - AtomicCell { - value: UnsafeCell::new(val), - } - } - - /// Creates a new atomic cell initialized with `val`. - /// - /// # Examples - /// - /// ``` - /// use crossbeam_utils::atomic::AtomicCell; - /// - /// let a = AtomicCell::new(7); - /// ``` - #[cfg(has_min_const_fn)] pub const fn new(val: T) -> AtomicCell { AtomicCell { value: UnsafeCell::new(val), diff --git a/crossbeam-utils/tests/atomic_cell.rs b/crossbeam-utils/tests/atomic_cell.rs index e0b7db525..f2cc0dae2 100644 --- a/crossbeam-utils/tests/atomic_cell.rs +++ b/crossbeam-utils/tests/atomic_cell.rs @@ -223,7 +223,6 @@ fn garbage_padding() { println!(); } -#[cfg(has_min_const_fn)] #[test] fn const_atomic_cell_new() { static CELL: AtomicCell = AtomicCell::new(0);