summaryrefslogtreecommitdiffstats
path: root/vendor/futures-core
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:39 +0000
commit1376c5a617be5c25655d0d7cb63e3beaa5a6e026 (patch)
tree3bb8d61aee02bc7a15eab3f36e3b921afc2075d0 /vendor/futures-core
parentReleasing progress-linux version 1.69.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.tar.xz
rustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.zip
Merging upstream version 1.70.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/futures-core')
-rw-r--r--vendor/futures-core/.cargo-checksum.json2
-rw-r--r--vendor/futures-core/Cargo.toml18
-rw-r--r--vendor/futures-core/build.rs21
-rw-r--r--vendor/futures-core/no_atomic_cas.rs6
-rw-r--r--vendor/futures-core/src/task/__internal/atomic_waker.rs18
5 files changed, 45 insertions, 20 deletions
diff --git a/vendor/futures-core/.cargo-checksum.json b/vendor/futures-core/.cargo-checksum.json
index 77e16eb62..5fdcdf265 100644
--- a/vendor/futures-core/.cargo-checksum.json
+++ b/vendor/futures-core/.cargo-checksum.json
@@ -1 +1 @@
-{"files":{"Cargo.toml":"a167cc2eb28add765dbe69220643c977744f206230321ac071e4bbb39981c8b9","LICENSE-APACHE":"275c491d6d1160553c32fd6127061d7f9606c3ea25abfad6ca3f6ed088785427","LICENSE-MIT":"6652c868f35dfe5e8ef636810a4e576b9d663f3a17fb0f5613ad73583e1b88fd","README.md":"e8258273fed6f1796485777655118f2369fd3f000191e9d8cdbd10bf052946a9","build.rs":"f6e21c09f18cc405bd7048cb7a2958f92d5414b9ca6b301d137e120a84fa020a","no_atomic_cas.rs":"ff8be002b49a5cd9e4ca0db17b1c9e6b98e55f556319eb6b953dd6ff52c397a6","src/future.rs":"0cb559fad0d43566dab959e929c4631c25cf749e2e29a5444fbcad464c9262ae","src/lib.rs":"eacd5816fbb914ca061d49ff6203723ebbe639eb7c45ebfa8a0613069d174111","src/stream.rs":"f1c7ab84161c5d5b424655b257fc3183eb6f2ed5324ba4006a70f9a4b0dc8872","src/task/__internal/atomic_waker.rs":"4ca94b25d3bcf4db863f008224cc4797dbbe7c93495a1abb232048846694a716","src/task/__internal/mod.rs":"7d0d297f58987b05ffa152605feb78ddc9b6e5168e7d621ec36dfbee558e4bec","src/task/mod.rs":"e213602a2fe5ae78ad5f1ca20e6d32dcbab17aba5b6b072fb927a72da99b4a11","src/task/poll.rs":"74c2717c1f9a37587a367da1b690d1cd2312e95dbaffca42be4755f1cd164bb8"},"package":"d0c8ff0461b82559810cdccfde3215c3f373807f5e5232b71479bff7bb2583d7"} \ No newline at end of file
+{"files":{"Cargo.toml":"b7e1e0d8df044b3ebc034f0028807c51a13321fe2eeef99fbb7153b874b9158d","LICENSE-APACHE":"275c491d6d1160553c32fd6127061d7f9606c3ea25abfad6ca3f6ed088785427","LICENSE-MIT":"6652c868f35dfe5e8ef636810a4e576b9d663f3a17fb0f5613ad73583e1b88fd","README.md":"e8258273fed6f1796485777655118f2369fd3f000191e9d8cdbd10bf052946a9","build.rs":"5b263bd2bd587511a9c8daef580b05e0613c15a6c5f800b1e5bc145fa013d99e","no_atomic_cas.rs":"7ae747b83b08dd926c1696faf4ecab9399c652ae77d5179221258c73b8eecb6f","src/future.rs":"0cb559fad0d43566dab959e929c4631c25cf749e2e29a5444fbcad464c9262ae","src/lib.rs":"eacd5816fbb914ca061d49ff6203723ebbe639eb7c45ebfa8a0613069d174111","src/stream.rs":"f1c7ab84161c5d5b424655b257fc3183eb6f2ed5324ba4006a70f9a4b0dc8872","src/task/__internal/atomic_waker.rs":"e5184bcc772c1472a2f0f9899bd3e388b74b771d327d801a5ea7e4aca6e57715","src/task/__internal/mod.rs":"7d0d297f58987b05ffa152605feb78ddc9b6e5168e7d621ec36dfbee558e4bec","src/task/mod.rs":"e213602a2fe5ae78ad5f1ca20e6d32dcbab17aba5b6b072fb927a72da99b4a11","src/task/poll.rs":"74c2717c1f9a37587a367da1b690d1cd2312e95dbaffca42be4755f1cd164bb8"},"package":"4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c"} \ No newline at end of file
diff --git a/vendor/futures-core/Cargo.toml b/vendor/futures-core/Cargo.toml
index 69deea9fe..a38bc1eef 100644
--- a/vendor/futures-core/Cargo.toml
+++ b/vendor/futures-core/Cargo.toml
@@ -13,16 +13,26 @@
edition = "2018"
rust-version = "1.36"
name = "futures-core"
-version = "0.3.19"
-description = "The core traits and types in for the `futures` library.\n"
+version = "0.3.28"
+description = """
+The core traits and types in for the `futures` library.
+"""
homepage = "https://rust-lang.github.io/futures-rs"
+readme = "README.md"
license = "MIT OR Apache-2.0"
repository = "https://github.com/rust-lang/futures-rs"
+
[package.metadata.docs.rs]
all-features = true
-rustdoc-args = ["--cfg", "docsrs"]
+rustdoc-args = [
+ "--cfg",
+ "docsrs",
+]
-[dependencies]
+[dependencies.portable-atomic]
+version = "1"
+optional = true
+default-features = false
[dev-dependencies]
diff --git a/vendor/futures-core/build.rs b/vendor/futures-core/build.rs
index 07b50bd55..05e0496d9 100644
--- a/vendor/futures-core/build.rs
+++ b/vendor/futures-core/build.rs
@@ -1,9 +1,3 @@
-#![warn(rust_2018_idioms, single_use_lifetimes)]
-
-use std::env;
-
-include!("no_atomic_cas.rs");
-
// The rustc-cfg listed below are considered public API, but it is *unstable*
// and outside of the normal semver guarantees:
//
@@ -13,10 +7,15 @@ include!("no_atomic_cas.rs");
// need to enable it manually when building for custom targets or using
// non-cargo build systems that don't run the build script.
//
-// With the exceptions mentioned above, the rustc-cfg strings below are
-// *not* public API. Please let us know by opening a GitHub issue if your build
-// environment requires some way to enable these cfgs other than by executing
-// our build script.
+// With the exceptions mentioned above, the rustc-cfg emitted by the build
+// script are *not* public API.
+
+#![warn(rust_2018_idioms, single_use_lifetimes)]
+
+use std::env;
+
+include!("no_atomic_cas.rs");
+
fn main() {
let target = match env::var("TARGET") {
Ok(target) => target,
@@ -34,7 +33,7 @@ fn main() {
// `cfg(target_has_atomic = "ptr")` as true when the build script doesn't
// run. This is needed for compatibility with non-cargo build systems that
// don't run the build script.
- if NO_ATOMIC_CAS_TARGETS.contains(&&*target) {
+ if NO_ATOMIC_CAS.contains(&&*target) {
println!("cargo:rustc-cfg=futures_no_atomic_cas");
}
diff --git a/vendor/futures-core/no_atomic_cas.rs b/vendor/futures-core/no_atomic_cas.rs
index 4708bf853..16ec628cd 100644
--- a/vendor/futures-core/no_atomic_cas.rs
+++ b/vendor/futures-core/no_atomic_cas.rs
@@ -1,13 +1,17 @@
// This file is @generated by no_atomic_cas.sh.
// It is not intended for manual editing.
-const NO_ATOMIC_CAS_TARGETS: &[&str] = &[
+const NO_ATOMIC_CAS: &[&str] = &[
+ "armv4t-none-eabi",
+ "armv5te-none-eabi",
"avr-unknown-gnu-atmega328",
"bpfeb-unknown-none",
"bpfel-unknown-none",
"msp430-none-elf",
"riscv32i-unknown-none-elf",
+ "riscv32im-unknown-none-elf",
"riscv32imc-unknown-none-elf",
"thumbv4t-none-eabi",
+ "thumbv5te-none-eabi",
"thumbv6m-none-eabi",
];
diff --git a/vendor/futures-core/src/task/__internal/atomic_waker.rs b/vendor/futures-core/src/task/__internal/atomic_waker.rs
index d49d04361..2fc594b8a 100644
--- a/vendor/futures-core/src/task/__internal/atomic_waker.rs
+++ b/vendor/futures-core/src/task/__internal/atomic_waker.rs
@@ -1,9 +1,16 @@
use core::cell::UnsafeCell;
use core::fmt;
-use core::sync::atomic::AtomicUsize;
-use core::sync::atomic::Ordering::{AcqRel, Acquire, Release};
use core::task::Waker;
+use atomic::AtomicUsize;
+use atomic::Ordering::{AcqRel, Acquire, Release};
+
+#[cfg(feature = "portable-atomic")]
+use portable_atomic as atomic;
+
+#[cfg(not(feature = "portable-atomic"))]
+use core::sync::atomic;
+
/// A synchronization primitive for task wakeup.
///
/// Sometimes the task interested in a given event will change over time.
@@ -264,7 +271,12 @@ impl AtomicWaker {
WAITING => {
unsafe {
// Locked acquired, update the waker cell
- *self.waker.get() = Some(waker.clone());
+
+ // Avoid cloning the waker if the old waker will awaken the same task.
+ match &*self.waker.get() {
+ Some(old_waker) if old_waker.will_wake(waker) => (),
+ _ => *self.waker.get() = Some(waker.clone()),
+ }
// Release the lock. If the state transitioned to include
// the `WAKING` bit, this means that at least one wake has