diff -Nru rust-crossbeam-queue-0.1.2/Cargo.toml rust-crossbeam-queue-0.2.1/Cargo.toml --- rust-crossbeam-queue-0.1.2/Cargo.toml 1970-01-01 00:00:00.000000000 +0000 +++ rust-crossbeam-queue-0.2.1/Cargo.toml 2019-12-24 18:53:46.000000000 +0000 @@ -3,7 +3,7 @@ # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies -# to registry (e.g. crates.io) dependencies +# to registry (e.g., crates.io) dependencies # # If you believe there's an error in this file please file an # issue against the rust-lang/cargo repository. If you're @@ -12,7 +12,7 @@ [package] name = "crossbeam-queue" -version = "0.1.2" +version = "0.2.1" authors = ["The Crossbeam Project Developers"] description = "Concurrent queues" homepage = "https://github.com/crossbeam-rs/crossbeam/tree/master/crossbeam-utils" @@ -20,9 +20,18 @@ readme = "README.md" keywords = ["queue", "mpmc", "lock-free", "producer", "consumer"] categories = ["concurrency", "data-structures"] -license = "MIT/Apache-2.0" +license = "MIT/Apache-2.0 AND BSD-2-Clause" repository = "https://github.com/crossbeam-rs/crossbeam" +[dependencies.cfg-if] +version = "0.1.2" + [dependencies.crossbeam-utils] -version = "0.6.5" +version = "0.7" +default-features = false [dev-dependencies.rand] version = "0.6" + +[features] +alloc = ["crossbeam-utils/alloc"] +default = ["std"] +std = ["crossbeam-utils/std"] diff -Nru rust-crossbeam-queue-0.1.2/Cargo.toml.orig rust-crossbeam-queue-0.2.1/Cargo.toml.orig --- rust-crossbeam-queue-0.1.2/Cargo.toml.orig 2019-01-29 15:46:51.000000000 +0000 +++ rust-crossbeam-queue-0.2.1/Cargo.toml.orig 2019-12-24 18:49:07.000000000 +0000 @@ -4,9 +4,9 @@ # - Update CHANGELOG.md # - Update README.md # - Create "crossbeam-queue-X.Y.Z" git tag -version = "0.1.2" +version = "0.2.1" authors = ["The Crossbeam Project Developers"] -license = "MIT/Apache-2.0" +license = "MIT/Apache-2.0 AND BSD-2-Clause" readme = "README.md" repository = "https://github.com/crossbeam-rs/crossbeam" homepage = "https://github.com/crossbeam-rs/crossbeam/tree/master/crossbeam-utils" @@ -15,9 +15,18 @@ keywords = ["queue", "mpmc", "lock-free", "producer", "consumer"] categories = ["concurrency", "data-structures"] +[features] +default = ["std"] +std = ["crossbeam-utils/std"] +alloc = ["crossbeam-utils/alloc"] + +[dependencies] +cfg-if = "0.1.2" + [dependencies.crossbeam-utils] -version = "0.6.5" +version = "0.7" path = "../crossbeam-utils" +default-features = false [dev-dependencies] rand = "0.6" diff -Nru rust-crossbeam-queue-0.1.2/.cargo_vcs_info.json rust-crossbeam-queue-0.2.1/.cargo_vcs_info.json --- rust-crossbeam-queue-0.1.2/.cargo_vcs_info.json 1970-01-01 00:00:00.000000000 +0000 +++ rust-crossbeam-queue-0.2.1/.cargo_vcs_info.json 2019-12-24 18:53:46.000000000 +0000 @@ -1,5 +1,5 @@ { "git": { - "sha1": "3953368d98c598c864afb09be5558d780e2c9759" + "sha1": "752fe5225ecceaa674649b210cd5febb2a085f2c" } } diff -Nru rust-crossbeam-queue-0.1.2/CHANGELOG.md rust-crossbeam-queue-0.2.1/CHANGELOG.md --- rust-crossbeam-queue-0.1.2/CHANGELOG.md 2019-01-29 15:46:47.000000000 +0000 +++ rust-crossbeam-queue-0.2.1/CHANGELOG.md 2019-12-24 18:49:36.000000000 +0000 @@ -1,3 +1,12 @@ +# Version 0.2.1 + +- Add `no_std` support. + +# Version 0.2.0 + +- Bump the minimum required version to 1.28. +- Bump `crossbeam-utils` to `0.7`. + # Version 0.1.2 - Update `crossbeam-utils` to `0.6.5`. diff -Nru rust-crossbeam-queue-0.1.2/debian/cargo-checksum.json rust-crossbeam-queue-0.2.1/debian/cargo-checksum.json --- rust-crossbeam-queue-0.1.2/debian/cargo-checksum.json 2019-08-06 16:13:46.000000000 +0000 +++ rust-crossbeam-queue-0.2.1/debian/cargo-checksum.json 2020-04-14 13:26:41.000000000 +0000 @@ -1 +1 @@ -{"package":"7c979cd6cfe72335896575c6b5688da489e420d36a27a0b9eb0c73db574b4a4b","files":{}} +{"package":"Could not get crate checksum","files":{}} diff -Nru rust-crossbeam-queue-0.1.2/debian/changelog rust-crossbeam-queue-0.2.1/debian/changelog --- rust-crossbeam-queue-0.1.2/debian/changelog 2019-08-06 16:13:46.000000000 +0000 +++ rust-crossbeam-queue-0.2.1/debian/changelog 2020-04-14 13:26:41.000000000 +0000 @@ -1,3 +1,26 @@ +rust-crossbeam-queue (0.2.1-2) unstable; urgency=medium + + * Team upload. + * Package crossbeam-queue 0.2.1 from crates.io using debcargo 2.4.2 + * Set test_is_broken = true + + the tests fail when neither the std or alloc featureset is enabled, + from reading the code my understanding is that with neither + featureset enabled the package is essentially useless and this + is by-design. + + -- Peter Michael Green Tue, 14 Apr 2020 13:26:41 +0000 + +rust-crossbeam-queue (0.2.1-1) unstable; urgency=medium + + * Team upload. + * Combine all featuresets into a single package to avoid a trip through + new. The extra dependency load is fairly small. + + [ Wolfgang Silbermayr ] + * Package crossbeam-queue 0.2.1 from crates.io using debcargo 2.4.2 + + -- Peter Michael Green Mon, 13 Apr 2020 16:50:42 +0000 + rust-crossbeam-queue (0.1.2-3) unstable; urgency=medium * Team upload. diff -Nru rust-crossbeam-queue-0.1.2/debian/control rust-crossbeam-queue-0.2.1/debian/control --- rust-crossbeam-queue-0.1.2/debian/control 2019-08-06 16:13:46.000000000 +0000 +++ rust-crossbeam-queue-0.2.1/debian/control 2020-04-14 13:26:41.000000000 +0000 @@ -2,15 +2,17 @@ Section: rust Priority: optional Build-Depends: debhelper (>= 11), - dh-cargo (>= 15), + dh-cargo (>= 18), cargo:native , rustc:native , libstd-rust-dev , - librust-crossbeam-utils-0.6+default-dev (>= 0.6.5-~~) + librust-cfg-if-0.1+default-dev (>= 0.1.2-~~) , + librust-crossbeam-utils-0.7+std-dev , + librust-crossbeam-utils-0.7-dev Maintainer: Debian Rust Maintainers Uploaders: Wolfgang Silbermayr -Standards-Version: 4.2.0 +Standards-Version: 4.4.1 Vcs-Git: https://salsa.debian.org/rust-team/debcargo-conf.git [src/crossbeam-queue] Vcs-Browser: https://salsa.debian.org/rust-team/debcargo-conf/tree/master/src/crossbeam-queue Homepage: https://github.com/crossbeam-rs/crossbeam/tree/master/crossbeam-utils @@ -20,15 +22,24 @@ Multi-Arch: same Depends: ${misc:Depends}, - librust-crossbeam-utils-0.6+default-dev (>= 0.6.5-~~) + librust-cfg-if-0.1+default-dev (>= 0.1.2-~~), + librust-crossbeam-utils-0.7-dev, + librust-crossbeam-utils-0.7+alloc-dev, + librust-crossbeam-utils-0.7+std-dev Provides: - librust-crossbeam-queue+default-dev (= ${binary:Version}), librust-crossbeam-queue-0-dev (= ${binary:Version}), + librust-crossbeam-queue-0.2-dev (= ${binary:Version}), + librust-crossbeam-queue-0.2.1-dev (= ${binary:Version}), + librust-crossbeam-queue-0+alloc-dev (= ${binary:Version}), + librust-crossbeam-queue-0.2+alloc-dev (= ${binary:Version}), + librust-crossbeam-queue-0.2.1+alloc-dev (= ${binary:Version}), + librust-crossbeam-queue+default-dev (= ${binary:Version}), + librust-crossbeam-queue-0+std-dev (= ${binary:Version}), librust-crossbeam-queue-0+default-dev (= ${binary:Version}), - librust-crossbeam-queue-0.1-dev (= ${binary:Version}), - librust-crossbeam-queue-0.1+default-dev (= ${binary:Version}), - librust-crossbeam-queue-0.1.2-dev (= ${binary:Version}), - librust-crossbeam-queue-0.1.2+default-dev (= ${binary:Version}) + librust-crossbeam-queue-0.2+std-dev (= ${binary:Version}), + librust-crossbeam-queue-0.2+default-dev (= ${binary:Version}), + librust-crossbeam-queue-0.2.1+std-dev (= ${binary:Version}), + librust-crossbeam-queue-0.2.1+default-dev (= ${binary:Version}) Description: Concurrent queues - Rust source code This package contains the source for the Rust crossbeam-queue crate, packaged by debcargo for use with cargo and dh-cargo. diff -Nru rust-crossbeam-queue-0.1.2/debian/control.debcargo.hint rust-crossbeam-queue-0.2.1/debian/control.debcargo.hint --- rust-crossbeam-queue-0.1.2/debian/control.debcargo.hint 1970-01-01 00:00:00.000000000 +0000 +++ rust-crossbeam-queue-0.2.1/debian/control.debcargo.hint 2020-04-14 13:26:41.000000000 +0000 @@ -0,0 +1,73 @@ +Source: rust-crossbeam-queue +Section: rust +Priority: optional +Build-Depends: debhelper (>= 11), + dh-cargo (>= 18), + cargo:native , + rustc:native , + libstd-rust-dev , + librust-cfg-if-0.1+default-dev (>= 0.1.2-~~) , + librust-crossbeam-utils-0.7+std-dev , + librust-crossbeam-utils-0.7-dev +Maintainer: Debian Rust Maintainers +Uploaders: + Wolfgang Silbermayr +Standards-Version: 4.4.1 +Vcs-Git: https://salsa.debian.org/rust-team/debcargo-conf.git [src/crossbeam-queue] +Vcs-Browser: https://salsa.debian.org/rust-team/debcargo-conf/tree/master/src/crossbeam-queue +Homepage: https://github.com/crossbeam-rs/crossbeam/tree/master/crossbeam-utils + +Package: librust-crossbeam-queue-dev +Architecture: any +Multi-Arch: same +Depends: + ${misc:Depends}, + librust-cfg-if-0.1+default-dev (>= 0.1.2-~~), + librust-crossbeam-utils-0.7-dev +Recommends: + librust-crossbeam-queue+std-dev (= ${binary:Version}) +Suggests: + librust-crossbeam-queue+alloc-dev (= ${binary:Version}) +Provides: + librust-crossbeam-queue-0-dev (= ${binary:Version}), + librust-crossbeam-queue-0.2-dev (= ${binary:Version}), + librust-crossbeam-queue-0.2.1-dev (= ${binary:Version}) +Description: Concurrent queues - Rust source code + This package contains the source for the Rust crossbeam-queue crate, packaged + by debcargo for use with cargo and dh-cargo. + +Package: librust-crossbeam-queue+alloc-dev +Architecture: any +Multi-Arch: same +Depends: + ${misc:Depends}, + librust-crossbeam-queue-dev (= ${binary:Version}), + librust-crossbeam-utils-0.7+alloc-dev +Provides: + librust-crossbeam-queue-0+alloc-dev (= ${binary:Version}), + librust-crossbeam-queue-0.2+alloc-dev (= ${binary:Version}), + librust-crossbeam-queue-0.2.1+alloc-dev (= ${binary:Version}) +Description: Concurrent queues - feature "alloc" + This metapackage enables feature "alloc" for the Rust crossbeam-queue crate, by + pulling in any additional dependencies needed by that feature. + +Package: librust-crossbeam-queue+std-dev +Architecture: any +Multi-Arch: same +Depends: + ${misc:Depends}, + librust-crossbeam-queue-dev (= ${binary:Version}), + librust-crossbeam-utils-0.7+std-dev +Provides: + librust-crossbeam-queue+default-dev (= ${binary:Version}), + librust-crossbeam-queue-0+std-dev (= ${binary:Version}), + librust-crossbeam-queue-0+default-dev (= ${binary:Version}), + librust-crossbeam-queue-0.2+std-dev (= ${binary:Version}), + librust-crossbeam-queue-0.2+default-dev (= ${binary:Version}), + librust-crossbeam-queue-0.2.1+std-dev (= ${binary:Version}), + librust-crossbeam-queue-0.2.1+default-dev (= ${binary:Version}) +Description: Concurrent queues - feature "std" and 1 more + This metapackage enables feature "std" for the Rust crossbeam-queue crate, by + pulling in any additional dependencies needed by that feature. + . + Additionally, this package also provides the "default" feature. diff -Nru rust-crossbeam-queue-0.1.2/debian/copyright rust-crossbeam-queue-0.2.1/debian/copyright --- rust-crossbeam-queue-0.1.2/debian/copyright 2019-08-06 16:13:46.000000000 +0000 +++ rust-crossbeam-queue-0.2.1/debian/copyright 2020-04-14 13:26:41.000000000 +0000 @@ -4,7 +4,7 @@ Source: https://github.com/crossbeam-rs/crossbeam Files: * -Copyright: 2015-2019 The Crossbeam Project Developers +Copyright: 2015-2020 The Crossbeam Project Developers License: MIT or Apache-2.0 Files: ./src/array_queue.rs @@ -34,8 +34,8 @@ Files: debian/* Copyright: - 2019 Debian Rust Maintainers - 2019 Wolfgang Silbermayr + 2019-2020 Debian Rust Maintainers + 2019-2020 Wolfgang Silbermayr License: MIT or Apache-2.0 License: Apache-2.0 diff -Nru rust-crossbeam-queue-0.1.2/debian/copyright.debcargo.hint rust-crossbeam-queue-0.2.1/debian/copyright.debcargo.hint --- rust-crossbeam-queue-0.1.2/debian/copyright.debcargo.hint 2019-08-06 16:13:46.000000000 +0000 +++ rust-crossbeam-queue-0.2.1/debian/copyright.debcargo.hint 2020-04-14 13:26:41.000000000 +0000 @@ -5,13 +5,20 @@ Files: * Copyright: FIXME (overlay) UNKNOWN-YEARS The Crossbeam Project Developers -License: MIT or Apache-2.0 +License: MIT or Apache-2.0 and BSD-2-Clause Comment: FIXME (overlay): Since upstream copyright years are not available in Cargo.toml, they were extracted from the upstream Git repository. This may not be correct information so you should review and fix this before uploading to the archive. +Files: ./LICENSE-MIT +Copyright: 2019 The Crossbeam Project Developers +License: UNKNOWN-LICENSE; FIXME (overlay) +Comment: + FIXME (overlay): These notices are extracted from files. Please review them + before uploading to the archive. + Files: ./LICENSE-THIRD-PARTY Copyright: 2010-2011 Dmitry Vyukov. License: UNKNOWN-LICENSE; FIXME (overlay) @@ -28,14 +35,36 @@ Files: debian/* Copyright: - 2019 Debian Rust Maintainers - 2019 Wolfgang Silbermayr -License: MIT or Apache-2.0 + 2019-2020 Debian Rust Maintainers + 2019-2020 Wolfgang Silbermayr +License: MIT or Apache-2.0 and BSD-2-Clause License: Apache-2.0 Debian systems provide the Apache 2.0 license in /usr/share/common-licenses/Apache-2.0 +License: BSD-2-Clause + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + . + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + . + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + . + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + License: MIT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff -Nru rust-crossbeam-queue-0.1.2/debian/debcargo.toml rust-crossbeam-queue-0.2.1/debian/debcargo.toml --- rust-crossbeam-queue-0.1.2/debian/debcargo.toml 2019-08-06 16:13:46.000000000 +0000 +++ rust-crossbeam-queue-0.2.1/debian/debcargo.toml 2020-04-14 13:26:41.000000000 +0000 @@ -1,2 +1,9 @@ overlay = "." uploaders = ["Wolfgang Silbermayr "] + +[packages.lib] +# tests fail when neither the std or alloc featureset is enabled, +# from reading the code my understanding is that with neither +# featureset enabled the package is essentially useless and this +# is by-design. +test_is_broken = true diff -Nru rust-crossbeam-queue-0.1.2/debian/patches/relax-dep.diff rust-crossbeam-queue-0.2.1/debian/patches/relax-dep.diff --- rust-crossbeam-queue-0.1.2/debian/patches/relax-dep.diff 1970-01-01 00:00:00.000000000 +0000 +++ rust-crossbeam-queue-0.2.1/debian/patches/relax-dep.diff 2020-04-14 13:26:41.000000000 +0000 @@ -0,0 +1,11 @@ +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -29,7 +29,7 @@ + version = "0.7" + default-features = false + [dev-dependencies.rand] +-version = "0.6" ++version = ">= 0.6, < 0.8" + + [features] + alloc = ["crossbeam-utils/alloc"] diff -Nru rust-crossbeam-queue-0.1.2/debian/patches/series rust-crossbeam-queue-0.2.1/debian/patches/series --- rust-crossbeam-queue-0.1.2/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ rust-crossbeam-queue-0.2.1/debian/patches/series 2020-04-14 13:26:41.000000000 +0000 @@ -0,0 +1 @@ +relax-dep.diff diff -Nru rust-crossbeam-queue-0.1.2/debian/tests/control rust-crossbeam-queue-0.2.1/debian/tests/control --- rust-crossbeam-queue-0.1.2/debian/tests/control 1970-01-01 00:00:00.000000000 +0000 +++ rust-crossbeam-queue-0.2.1/debian/tests/control 2020-04-14 13:26:41.000000000 +0000 @@ -0,0 +1,19 @@ +Test-Command: /usr/share/cargo/bin/cargo-auto-test crossbeam-queue 0.2.1 --all-targets --all-features +Features: test-name=@ +Depends: dh-cargo (>= 18), librust-rand-0.7+default-dev | librust-rand-0.6+default-dev, @ +Restrictions: allow-stderr, skip-not-installable, flaky + +Test-Command: /usr/share/cargo/bin/cargo-auto-test crossbeam-queue 0.2.1 --all-targets --no-default-features +Features: test-name=librust-crossbeam-queue-dev +Depends: dh-cargo (>= 18), librust-rand-0.7+default-dev | librust-rand-0.6+default-dev, @ +Restrictions: allow-stderr, skip-not-installable, flaky + +Test-Command: /usr/share/cargo/bin/cargo-auto-test crossbeam-queue 0.2.1 --all-targets --features alloc +Features: test-name=librust-crossbeam-queue+alloc-dev +Depends: dh-cargo (>= 18), librust-rand-0.7+default-dev | librust-rand-0.6+default-dev, @ +Restrictions: allow-stderr, skip-not-installable, flaky + +Test-Command: /usr/share/cargo/bin/cargo-auto-test crossbeam-queue 0.2.1 --all-targets --features std +Features: test-name=librust-crossbeam-queue+std-dev +Depends: dh-cargo (>= 18), librust-rand-0.7+default-dev | librust-rand-0.6+default-dev, @ +Restrictions: allow-stderr, skip-not-installable, flaky diff -Nru rust-crossbeam-queue-0.1.2/debian/watch rust-crossbeam-queue-0.2.1/debian/watch --- rust-crossbeam-queue-0.1.2/debian/watch 2019-08-06 16:13:46.000000000 +0000 +++ rust-crossbeam-queue-0.2.1/debian/watch 2020-04-14 13:26:41.000000000 +0000 @@ -2,4 +2,3 @@ opts=filenamemangle=s/.*\/(.*)\/download/crossbeam-queue-$1\.tar\.gz/g,\ uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|beta|alpha)\d*)$/$1~$2/ \ https://qa.debian.org/cgi-bin/fakeupstream.cgi?upstream=crates.io/crossbeam-queue .*/crates/crossbeam-queue/@ANY_VERSION@/download - diff -Nru rust-crossbeam-queue-0.1.2/LICENSE-MIT rust-crossbeam-queue-0.2.1/LICENSE-MIT --- rust-crossbeam-queue-0.1.2/LICENSE-MIT 2019-01-28 18:37:47.000000000 +0000 +++ rust-crossbeam-queue-0.2.1/LICENSE-MIT 2019-09-04 17:31:55.000000000 +0000 @@ -1,3 +1,7 @@ +The MIT License (MIT) + +Copyright (c) 2019 The Crossbeam Project Developers + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the diff -Nru rust-crossbeam-queue-0.1.2/README.md rust-crossbeam-queue-0.2.1/README.md --- rust-crossbeam-queue-0.1.2/README.md 2019-01-28 20:25:29.000000000 +0000 +++ rust-crossbeam-queue-0.2.1/README.md 2019-11-06 23:40:41.000000000 +0000 @@ -8,8 +8,9 @@ https://crates.io/crates/crossbeam-queue) [![Documentation](https://docs.rs/crossbeam-queue/badge.svg)]( https://docs.rs/crossbeam-queue) -[![Rust 1.26+](https://img.shields.io/badge/rust-1.26+-lightgray.svg)]( +[![Rust 1.28+](https://img.shields.io/badge/rust-1.28+-lightgray.svg)]( https://www.rust-lang.org) +[![chat](https://img.shields.io/discord/569610676205781012.svg?logo=discord)](https://discord.gg/BBYwKq) This crate provides concurrent queues that can be shared among threads: @@ -25,7 +26,7 @@ ```toml [dependencies] -crossbeam-queue = "0.1" +crossbeam-queue = "0.2" ``` Next, add this to your crate: @@ -36,7 +37,7 @@ ## Compatibility -The minimum supported Rust version is 1.26. +The minimum supported Rust version is 1.28. Any change to this is considered a breaking change. ## License diff -Nru rust-crossbeam-queue-0.1.2/src/array_queue.rs rust-crossbeam-queue-0.2.1/src/array_queue.rs --- rust-crossbeam-queue-0.1.2/src/array_queue.rs 2019-01-28 18:37:47.000000000 +0000 +++ rust-crossbeam-queue-0.2.1/src/array_queue.rs 2019-12-24 18:48:56.000000000 +0000 @@ -8,12 +8,13 @@ //! - Simplified BSD License and Apache License, Version 2.0 //! - http://www.1024cores.net/home/code-license -use std::cell::UnsafeCell; -use std::fmt; -use std::marker::PhantomData; -use std::mem; -use std::ptr; -use std::sync::atomic::{self, AtomicUsize, Ordering}; +use alloc::vec::Vec; +use core::cell::UnsafeCell; +use core::fmt; +use core::marker::PhantomData; +use core::mem; +use core::ptr; +use core::sync::atomic::{self, AtomicUsize, Ordering}; use crossbeam_utils::{Backoff, CachePadded}; @@ -23,7 +24,7 @@ struct Slot { /// The current stamp. /// - /// If the stamp equals the tail, this node will be next written to. If it equals the head, + /// If the stamp equals the tail, this node will be next written to. If it equals head + 1, /// this node will be next read from. stamp: AtomicUsize, @@ -34,7 +35,7 @@ /// A bounded multi-producer multi-consumer queue. /// /// This queue allocates a fixed-capacity buffer on construction, which is used to store pushed -/// elements. The queue cannot hold more elements that the buffer allows. Attempting to push an +/// elements. The queue cannot hold more elements than the buffer allows. Attempting to push an /// element into a full queue will fail. Having a buffer allocated upfront makes this queue a bit /// faster than [`SegQueue`]. /// @@ -177,13 +178,17 @@ }; // Try moving the tail. - match self - .tail - .compare_exchange_weak(tail, new_tail, Ordering::SeqCst, Ordering::Relaxed) - { + match self.tail.compare_exchange_weak( + tail, + new_tail, + Ordering::SeqCst, + Ordering::Relaxed, + ) { Ok(_) => { // Write the value into the slot and update the stamp. - unsafe { slot.value.get().write(value); } + unsafe { + slot.value.get().write(value); + } slot.stamp.store(tail + 1, Ordering::Release); return Ok(()); } @@ -253,14 +258,17 @@ }; // Try moving the head. - match self - .head - .compare_exchange_weak(head, new, Ordering::SeqCst, Ordering::Relaxed) - { + match self.head.compare_exchange_weak( + head, + new, + Ordering::SeqCst, + Ordering::Relaxed, + ) { Ok(_) => { // Read the value from the slot and update the stamp. let msg = unsafe { slot.value.get().read() }; - slot.stamp.store(head.wrapping_add(self.one_lap), Ordering::Release); + slot.stamp + .store(head.wrapping_add(self.one_lap), Ordering::Release); return Ok(msg); } Err(h) => { diff -Nru rust-crossbeam-queue-0.1.2/src/err.rs rust-crossbeam-queue-0.2.1/src/err.rs --- rust-crossbeam-queue-0.1.2/src/err.rs 2019-01-28 18:37:47.000000000 +0000 +++ rust-crossbeam-queue-0.2.1/src/err.rs 2019-12-24 18:48:56.000000000 +0000 @@ -1,5 +1,4 @@ -use std::error; -use std::fmt; +use core::fmt; /// Error which occurs when popping from an empty queue. #[derive(Clone, Copy, Eq, PartialEq)] @@ -17,7 +16,8 @@ } } -impl error::Error for PopError { +#[cfg(features = "std")] +impl std::error::Error for PopError { fn description(&self) -> &str { "popping from an empty queue" } @@ -39,7 +39,8 @@ } } -impl error::Error for PushError { +#[cfg(features = "std")] +impl std::error::Error for PushError { fn description(&self) -> &str { "pushing into a full queue" } diff -Nru rust-crossbeam-queue-0.1.2/src/lib.rs rust-crossbeam-queue-0.2.1/src/lib.rs --- rust-crossbeam-queue-0.1.2/src/lib.rs 2019-01-28 20:25:29.000000000 +0000 +++ rust-crossbeam-queue-0.2.1/src/lib.rs 2019-12-24 18:48:56.000000000 +0000 @@ -10,13 +10,31 @@ #![warn(missing_docs)] #![warn(missing_debug_implementations)] +#![cfg_attr(not(feature = "std"), no_std)] + +#[macro_use] +extern crate cfg_if; +#[cfg(feature = "std")] +extern crate core; + +cfg_if! { + if #[cfg(feature = "alloc")] { + extern crate alloc; + } else if #[cfg(feature = "std")] { + extern crate std as alloc; + } +} extern crate crossbeam_utils; -mod array_queue; -mod err; -mod seg_queue; - -pub use self::array_queue::ArrayQueue; -pub use self::seg_queue::SegQueue; -pub use self::err::{PopError, PushError}; +cfg_if! { + if #[cfg(any(feature = "alloc", feature = "std"))] { + mod array_queue; + mod err; + mod seg_queue; + + pub use self::array_queue::ArrayQueue; + pub use self::err::{PopError, PushError}; + pub use self::seg_queue::SegQueue; + } +} diff -Nru rust-crossbeam-queue-0.1.2/src/seg_queue.rs rust-crossbeam-queue-0.2.1/src/seg_queue.rs --- rust-crossbeam-queue-0.1.2/src/seg_queue.rs 2019-01-28 18:37:47.000000000 +0000 +++ rust-crossbeam-queue-0.2.1/src/seg_queue.rs 2019-12-24 18:48:56.000000000 +0000 @@ -1,9 +1,10 @@ -use std::cell::UnsafeCell; -use std::fmt; -use std::marker::PhantomData; -use std::mem::{self, ManuallyDrop}; -use std::ptr; -use std::sync::atomic::{self, AtomicPtr, AtomicUsize, Ordering}; +use alloc::boxed::Box; +use core::cell::UnsafeCell; +use core::fmt; +use core::marker::PhantomData; +use core::mem::{self, ManuallyDrop}; +use core::ptr; +use core::sync::atomic::{self, AtomicPtr, AtomicUsize, Ordering}; use crossbeam_utils::{Backoff, CachePadded}; @@ -205,7 +206,12 @@ if block.is_null() { let new = Box::into_raw(Box::new(Block::::new())); - if self.tail.block.compare_and_swap(block, new, Ordering::Release) == block { + if self + .tail + .block + .compare_and_swap(block, new, Ordering::Release) + == block + { self.head.block.store(new, Ordering::Release); block = new; } else { @@ -219,14 +225,12 @@ let new_tail = tail + (1 << SHIFT); // Try advancing the tail forward. - match self.tail.index - .compare_exchange_weak( - tail, - new_tail, - Ordering::SeqCst, - Ordering::Acquire, - ) - { + match self.tail.index.compare_exchange_weak( + tail, + new_tail, + Ordering::SeqCst, + Ordering::Acquire, + ) { Ok(_) => unsafe { // If we've reached the end of the block, install the next one. if offset + 1 == BLOCK_CAP { @@ -244,7 +248,7 @@ slot.state.fetch_or(WRITE, Ordering::Release); return; - } + }, Err(t) => { tail = t; block = self.tail.block.load(Ordering::Acquire); @@ -313,14 +317,12 @@ } // Try moving the head index forward. - match self.head.index - .compare_exchange_weak( - head, - new_head, - Ordering::SeqCst, - Ordering::Acquire, - ) - { + match self.head.index.compare_exchange_weak( + head, + new_head, + Ordering::SeqCst, + Ordering::Acquire, + ) { Ok(_) => unsafe { // If we've reached the end of the block, move to the next one. if offset + 1 == BLOCK_CAP { @@ -349,7 +351,7 @@ } return Ok(value); - } + }, Err(h) => { head = h; block = self.head.block.load(Ordering::Acquire); diff -Nru rust-crossbeam-queue-0.1.2/tests/array_queue.rs rust-crossbeam-queue-0.2.1/tests/array_queue.rs --- rust-crossbeam-queue-0.1.2/tests/array_queue.rs 2019-01-28 18:37:47.000000000 +0000 +++ rust-crossbeam-queue-0.2.1/tests/array_queue.rs 2019-09-04 17:31:55.000000000 +0000 @@ -113,7 +113,8 @@ assert!(len <= CAP); } }); - }).unwrap(); + }) + .unwrap(); assert_eq!(q.len(), 0); } @@ -141,7 +142,8 @@ while q.push(i).is_err() {} } }); - }).unwrap(); + }) + .unwrap(); } #[test] @@ -172,7 +174,8 @@ } }); } - }).unwrap(); + }) + .unwrap(); for c in v { assert_eq!(c.load(Ordering::SeqCst), THREADS); @@ -217,7 +220,8 @@ } } }); - }).unwrap(); + }) + .unwrap(); for _ in 0..additional { q.push(DropCounter).unwrap(); @@ -245,5 +249,6 @@ } }); } - }).unwrap(); + }) + .unwrap(); } diff -Nru rust-crossbeam-queue-0.1.2/tests/seg_queue.rs rust-crossbeam-queue-0.2.1/tests/seg_queue.rs --- rust-crossbeam-queue-0.1.2/tests/seg_queue.rs 2019-01-28 18:37:47.000000000 +0000 +++ rust-crossbeam-queue-0.2.1/tests/seg_queue.rs 2019-09-04 17:31:55.000000000 +0000 @@ -79,7 +79,8 @@ q.push(i); } }); - }).unwrap(); + }) + .unwrap(); } #[test] @@ -110,7 +111,8 @@ } }); } - }).unwrap(); + }) + .unwrap(); for c in v { assert_eq!(c.load(Ordering::SeqCst), THREADS); @@ -151,7 +153,8 @@ q.push(DropCounter); } }); - }).unwrap(); + }) + .unwrap(); for _ in 0..additional { q.push(DropCounter);