Compare commits
4 Commits
Author | SHA1 | Date |
---|---|---|
John Nunley | cd159e6a1c | |
John Nunley | eb54e95aca | |
John Nunley | 2493d3c595 | |
John Nunley | c56420dcf4 |
|
@ -63,6 +63,27 @@ jobs:
|
|||
- run: wasm-pack test --node
|
||||
- run: wasm-pack test --node --no-default-features
|
||||
- run: wasm-pack test --node --no-default-features --features portable-atomic
|
||||
- name: Clone some dependent crates
|
||||
run: |
|
||||
git clone https://github.com/smol-rs/event-listener-strategy.git
|
||||
git clone https://github.com/smol-rs/async-channel.git
|
||||
git clone https://github.com/smol-rs/async-lock.git
|
||||
- name: Patch dependent crates
|
||||
run: |
|
||||
echo '[patch.crates-io]' >> event-listener-strategy/Cargo.toml
|
||||
echo 'event-listener = { path = ".." }' >> event-listener-strategy/Cargo.toml
|
||||
echo '[patch.crates-io]' >> async-channel/Cargo.toml
|
||||
echo 'event-listener = { path = ".." }' >> async-channel/Cargo.toml
|
||||
echo 'event-listener-strategy = { path = "../event-listener-strategy" }' >> async-channel/Cargo.toml
|
||||
echo '[patch.crates-io]' >> async-lock/Cargo.toml
|
||||
echo 'event-listener = { path = ".." }' >> async-lock/Cargo.toml
|
||||
echo 'event-listener-strategy = { path = "../event-listener-strategy" }' >> async-lock/Cargo.toml
|
||||
echo 'async-channel = { path = "../async-channel" }' >> async-lock/Cargo.toml
|
||||
- name: Test dependent crates
|
||||
run: |
|
||||
cargo test --manifest-path=event-listener-strategy/Cargo.toml
|
||||
cargo test --manifest-path=async-channel/Cargo.toml
|
||||
cargo test --manifest-path=async-lock/Cargo.toml
|
||||
|
||||
msrv:
|
||||
runs-on: ubuntu-latest
|
||||
|
@ -101,6 +122,28 @@ jobs:
|
|||
- run: cargo miri test --all
|
||||
- run: cargo miri test --no-default-features --tests
|
||||
- run: cargo miri test --no-default-features --features portable-atomic --tests
|
||||
- name: Clone some dependent crates
|
||||
run: |
|
||||
git clone https://github.com/smol-rs/event-listener-strategy.git
|
||||
git clone https://github.com/smol-rs/async-channel.git
|
||||
git clone https://github.com/smol-rs/async-lock.git
|
||||
- name: Patch dependent crates
|
||||
run: |
|
||||
echo '[patch.crates-io]' >> event-listener-strategy/Cargo.toml
|
||||
echo 'event-listener = { path = ".." }' >> event-listener-strategy/Cargo.toml
|
||||
echo '[patch.crates-io]' >> async-channel/Cargo.toml
|
||||
echo 'event-listener = { path = ".." }' >> async-channel/Cargo.toml
|
||||
echo 'event-listener-strategy = { path = "../event-listener-strategy" }' >> async-channel/Cargo.toml
|
||||
echo '[patch.crates-io]' >> async-lock/Cargo.toml
|
||||
echo 'event-listener = { path = ".." }' >> async-lock/Cargo.toml
|
||||
echo 'event-listener-strategy = { path = "../event-listener-strategy" }' >> async-lock/Cargo.toml
|
||||
echo 'async-channel = { path = "../async-channel" }' >> async-lock/Cargo.toml
|
||||
- name: Test dependent crates
|
||||
# async-channel isn't included here as it appears to be broken on MIRI.
|
||||
# See https://github.com/smol-rs/async-channel/issues/85
|
||||
run: |
|
||||
cargo miri test --manifest-path=event-listener-strategy/Cargo.toml
|
||||
cargo miri test --manifest-path=async-lock/Cargo.toml
|
||||
|
||||
security_audit:
|
||||
permissions:
|
||||
|
|
|
@ -20,6 +20,9 @@ std = ["concurrent-queue/std", "parking"]
|
|||
portable-atomic = ["portable-atomic-util", "portable_atomic_crate"]
|
||||
loom = ["concurrent-queue/loom", "parking?/loom", "dep:loom"]
|
||||
|
||||
[lints.rust]
|
||||
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(loom)'] }
|
||||
|
||||
[dependencies]
|
||||
concurrent-queue = { version = "2.4.0", default-features = false }
|
||||
pin-project-lite = "0.2.12"
|
||||
|
|
|
@ -68,6 +68,7 @@
|
|||
//! [`portable-atomic`]: https://crates.io/crates/portable-atomic
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
#![allow(clippy::multiple_bound_locations)] // This is a WONTFIX issue with pin-project-lite
|
||||
#![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)]
|
||||
#![doc(
|
||||
html_favicon_url = "https://raw.githubusercontent.com/smol-rs/smol/master/assets/images/logo_fullsize_transparent.png"
|
||||
|
@ -131,7 +132,7 @@ struct Inner<T> {
|
|||
impl<T> Inner<T> {
|
||||
fn new() -> Self {
|
||||
Self {
|
||||
notified: AtomicUsize::new(core::usize::MAX),
|
||||
notified: AtomicUsize::new(usize::MAX),
|
||||
list: sys::List::new(),
|
||||
}
|
||||
}
|
||||
|
@ -438,7 +439,7 @@ impl<T> Event<T> {
|
|||
|
||||
if let Some(inner) = self.try_inner() {
|
||||
let limit = if notify.is_additional(Internal::new()) {
|
||||
core::usize::MAX
|
||||
usize::MAX
|
||||
} else {
|
||||
notify.count(Internal::new())
|
||||
};
|
||||
|
|
|
@ -307,7 +307,7 @@ impl<T> Drop for ListGuard<'_, T> {
|
|||
let notified = if list.notified < list.len {
|
||||
list.notified
|
||||
} else {
|
||||
core::usize::MAX
|
||||
usize::MAX
|
||||
};
|
||||
|
||||
self.inner.notified.store(notified, Ordering::Release);
|
||||
|
|
|
@ -306,7 +306,7 @@ impl<T> Drop for ListLock<'_, '_, T> {
|
|||
let notified = if list.notified < list.len {
|
||||
list.notified
|
||||
} else {
|
||||
core::usize::MAX
|
||||
usize::MAX
|
||||
};
|
||||
|
||||
self.inner.notified.store(notified, Ordering::Release);
|
||||
|
|
|
@ -3,7 +3,6 @@ use std::future::Future;
|
|||
use std::pin::Pin;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::task::Context;
|
||||
use std::usize;
|
||||
|
||||
use event_listener::{Event, EventListener};
|
||||
use waker_fn::waker_fn;
|
||||
|
|
|
@ -2,7 +2,6 @@ use std::future::Future;
|
|||
use std::pin::Pin;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::task::Context;
|
||||
use std::usize;
|
||||
|
||||
use event_listener::{Event, EventListener};
|
||||
use waker_fn::waker_fn;
|
||||
|
|
Loading…
Reference in New Issue