Skip to content

Commit

Permalink
Merge pull request #2 from asynchronics/feature/unexpected-cfgs
Browse files Browse the repository at this point in the history
Add `unexpected_cfgs` flag and increase MSRV
  • Loading branch information
sbarral authored Jun 3, 2024
2 parents 2473aeb + a3ef4f0 commit e657af1
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 23 deletions.
14 changes: 3 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,15 @@ env:
RUSTFLAGS: -Dwarnings

jobs:
check:
name: Check
check-msrv:
name: Check MSRV
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust:
- stable
- 1.77.1
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
uses: dtolnay/rust-toolchain@1.64.0

- name: Run cargo check
run: cargo check
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/loom.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: Loom

on:
workflow_dispatch:
pull_request:
push:
branches: [ main ]

jobs:
loom:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# [Unreleased]
* Add `unexpected_cfgs` flag in `Cargo.toml` and accordingly decrease MSRV to
1.64 (???).

# 0.2.0 (2024-05-15)

* Make it possible to specify a deadline when waiting for an event ([#1]).
Expand Down
9 changes: 6 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ name = "async-event"
version = "0.2.0"
authors = ["Serge Barral <serge.barral@asynchronics.com>"]
edition = "2021"
rust-version = "1.77"
rust-version = "1.64"
license = "MIT OR Apache-2.0"
repository = "https://github.com/asynchronics/async-event"
readme = "README.md"
Expand All @@ -22,11 +22,14 @@ keywords = ["async", "event", "atomic", "futures"]
pin-project-lite = "0.2"

[dev-dependencies]
tokio = { version = "1", features = ["full"] }
tokio = { version = "1.0", features = ["full"] }
futures-executor = "0.3"

[target.'cfg(async_event_loom)'.dependencies]
loom = "0.5"

[target.'cfg(async_event_loom)'.dev-dependencies]
waker-fn = "1.1"
waker-fn = "1.1"

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(async_event_loom)'] }
10 changes: 2 additions & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,6 @@
//! assert_eq!(v, 42);
//! });
//! ```
// Temporary workaround until the `async_event_loom` flag can be whitelisted
// without a `build.rs` [1].
//
// [1]: (https://github.com/rust-lang/rust/issues/124800).
#![allow(unexpected_cfgs)]

mod loom_exports;

use std::future::Future;
Expand Down Expand Up @@ -1141,6 +1134,7 @@ mod tests {
/// When the future is still in a `Polled` state, this future is moved into
/// the enum so as to extend its lifetime and allow it to be further
/// notified.
#[allow(dead_code)]
enum FutureState {
Completed,
Polled(Pin<Box<WaitUntilClosure>>),
Expand Down Expand Up @@ -1371,7 +1365,7 @@ mod tests {
loom_notify(2, 2, 1, 1, 1, true, DEFAULT_PREEMPTION_BOUND);
}
#[test]
fn loom_two_consumers_three_AVAILABLE_TOKENS() {
fn loom_two_consumers_three_tokens() {
const DEFAULT_PREEMPTION_BOUND: usize = 3;
loom_notify(3, 2, 1, 0, 0, false, DEFAULT_PREEMPTION_BOUND);
}
Expand Down

0 comments on commit e657af1

Please sign in to comment.