From c5a2826e8e9b0bc307c45349a052cbe792221924 Mon Sep 17 00:00:00 2001 From: Jack Wrenn Date: Tue, 6 Feb 2024 15:49:02 +0000 Subject: [PATCH] don't set MSRV and only run doctests on nightly We have too many dependencies to actually guarantee our MSRV. We only run doctests on nightly so we don't have to generalize doctests for slightly different line numbers across different Rust versions. Our integration tests do generalize in this way, so we still run those on both stable and nightly. --- .github/workflows/ci.yml | 42 +++++++++++++++------------------------ attributes/Cargo.toml | 1 - backtrace/Cargo.toml | 1 - backtrace/src/frame.rs | 4 ++-- backtrace/src/location.rs | 7 +++---- bors.toml | 2 -- 6 files changed, 21 insertions(+), 36 deletions(-) delete mode 100644 bors.toml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 41df7da..82fcc2f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,7 +43,7 @@ env: # `CRATE_NIGHTLY_XXX` are flags that we add to `XXX` only on the nightly # toolchain. CRATE_NIGHTLY_RUSTFLAGS: -Zrandomize-layout - CRATE_NIGHTLY_MIRIFLAGS: "-Zmiri-disable-isolation -Zmiri-symbolic-alignment-check" + CRATE_NIGHTLY_MIRIFLAGS: "-Zmiri-disable-isolation" jobs: build_test: @@ -51,7 +51,7 @@ jobs: strategy: matrix: - toolchain: [ "msrv", "stable", "nightly" ] + toolchain: [ "stable", "nightly" ] target: [ "i686-unknown-linux-gnu", "x86_64-unknown-linux-gnu" ] name: Build & Test (toolchain:${{ matrix.toolchain }}, target:${{ matrix.target }}) @@ -138,23 +138,27 @@ jobs: - name: Check lib run: cargo +${{ env.CRATE_TOOLCHAIN }} check --target ${{ matrix.target }} --lib --verbose - if: ${{ matrix.toolchain == 'msrv' }} - name: Check extras run: cargo +${{ env.CRATE_TOOLCHAIN }} check --target ${{ matrix.target }} --all-targets --verbose - if: ${{ matrix.toolchain != 'msrv' }} - - name: Test - run: cargo +${{ env.CRATE_TOOLCHAIN }} test --target ${{ matrix.target }} --verbose + - name: Test (doc) + run: cargo +${{ env.CRATE_TOOLCHAIN }} test --target ${{ matrix.target }} --verbose --doc # Only run tests when targetting x86 (32- or 64-bit) - we're executing on # x86_64, so we can't run tests for any non-x86 target. - if: ${{ matrix.toolchain != 'msrv' && (contains(matrix.target, 'x86_64') || contains(matrix.target, 'i686')) }} + if: ${{ matrix.toolchain == 'nightly' && (contains(matrix.target, 'x86_64') || contains(matrix.target, 'i686')) }} + + - name: Test (integration) + run: cargo +${{ env.CRATE_TOOLCHAIN }} test --target ${{ matrix.target }} --verbose --tests + # Only run tests when targetting x86 (32- or 64-bit) - we're executing on + # x86_64, so we can't run tests for any non-x86 target. + if: ${{ (contains(matrix.target, 'x86_64') || contains(matrix.target, 'i686')) }} - name: Test (loom) run: cargo +${{ env.CRATE_TOOLCHAIN }} test --target ${{ matrix.target }} --verbose --release --tests # Only run tests when targetting x86 (32- or 64-bit) - we're executing on # x86_64, so we can't run tests for any non-x86 target. - if: ${{ matrix.toolchain != 'msrv' && (contains(matrix.target, 'x86_64') || contains(matrix.target, 'aarch64')) }} + if: ${{ (contains(matrix.target, 'x86_64') || contains(matrix.target, 'aarch64')) }} env: RUSTFLAGS: --cfg loom ${{ env.RUSTFLAGS }} @@ -198,19 +202,6 @@ jobs: set -e cargo clippy --all-targets - check_msrv: - runs-on: ubuntu-latest - name: Check MSRVs match - steps: - - uses: actions/checkout@v3 - - name: Rust Cache - uses: Swatinem/rust-cache@v2.0.0 - - uses: extractions/setup-just@v1 - # Make sure that the MSRV in async-backtrace's and async-backtrace-attributes's - # `Cargo.toml` files are the same. - - name: Check MSRVs match - run: just check-msrv - check_readme: runs-on: ubuntu-latest name: Check README is correctly generated. @@ -219,7 +210,7 @@ jobs: - name: Rust Cache uses: Swatinem/rust-cache@v2.0.0 - uses: extractions/setup-just@v1 - - name: Check MSRVs match + - name: Check README matches run: | set -e cargo install cargo-readme --version 3.2.0 @@ -228,14 +219,13 @@ jobs: ci-success: name: ci - if: ${{ success() }} + if: failure() needs: - build_test - check_fmt - check_clippy - - check_msrv - check_readme runs-on: ubuntu-latest steps: - - name: CI succeeded - run: exit 0 \ No newline at end of file + - name: CI failed + run: exit 1 diff --git a/attributes/Cargo.toml b/attributes/Cargo.toml index 9656849..398d134 100644 --- a/attributes/Cargo.toml +++ b/attributes/Cargo.toml @@ -3,7 +3,6 @@ name = "async-backtrace-attributes" version = "0.2.6" edition = "2018" license = "MIT" -rust-version = "1.59" description = "Procedural macros for the `async-backtrace` crate." repository = "https://github.com/tokio-rs/async-backtrace" diff --git a/backtrace/Cargo.toml b/backtrace/Cargo.toml index df91e6e..ce1be6a 100644 --- a/backtrace/Cargo.toml +++ b/backtrace/Cargo.toml @@ -4,7 +4,6 @@ version = "0.2.6" edition = "2018" license = "MIT" readme = "../README.md" -rust-version = "1.59" description = "Efficient, logical 'backtraces' of async tasks." repository = "https://github.com/tokio-rs/async-backtrace" categories = ["asynchronous", "development-tools::debugging"] diff --git a/backtrace/src/frame.rs b/backtrace/src/frame.rs index 02ddfa4..15821d6 100644 --- a/backtrace/src/frame.rs +++ b/backtrace/src/frame.rs @@ -364,7 +364,7 @@ impl Frame { } /// Produces an iterator over this frame's ancestors. - pub fn backtrace(&self) -> impl Iterator + FusedIterator { + pub fn backtrace(&self) -> impl FusedIterator { /// An iterator that traverses up the tree of [`Frame`]s from a leaf. #[derive(Clone)] pub(crate) struct Backtrace<'a> { @@ -399,7 +399,7 @@ impl Frame { /// The caller must ensure that the corresponding Kind::Root{mutex} is /// locked. The caller must also ensure that the returned iterator is /// dropped before the mutex is dropped. - pub(crate) unsafe fn subframes(&self) -> impl Iterator + FusedIterator { + pub(crate) unsafe fn subframes(&self) -> impl FusedIterator { pub(crate) struct Subframes<'a> { iter: linked_list::Iter<'a, Frame>, } diff --git a/backtrace/src/location.rs b/backtrace/src/location.rs index b2cebd8..84a1053 100644 --- a/backtrace/src/location.rs +++ b/backtrace/src/location.rs @@ -9,15 +9,14 @@ use futures::Future; /// /// #[tokio::main] /// async fn main() { -/// # macro_rules! assert_eq { ($l:expr, $r:expr) => { debug_assert_eq!($l.len(), $r.len()); } } -/// assert_eq!(location!().to_string(), "rust_out::main::{{closure}} at src/location.rs:8:16"); +/// assert_eq!(location!().to_string(), "rust_out::main::{{closure}} at backtrace/src/location.rs:8:16"); /// /// async { -/// assert_eq!(location!().to_string(), "rust_out::main::{{closure}}::{{closure}} at src/location.rs:11:20"); +/// assert_eq!(location!().to_string(), "rust_out::main::{{closure}}::{{closure}} at backtrace/src/location.rs:11:20"); /// }.await; /// /// (|| async { -/// assert_eq!(location!().to_string(), "rust_out::main::{{closure}}::{{closure}}::{{closure}} at src/location.rs:15:20"); +/// assert_eq!(location!().to_string(), "rust_out::main::{{closure}}::{{closure}}::{{closure}} at backtrace/src/location.rs:15:20"); /// })().await; /// } /// ``` diff --git a/bors.toml b/bors.toml deleted file mode 100644 index 91d701e..0000000 --- a/bors.toml +++ /dev/null @@ -1,2 +0,0 @@ -status = ["ci"] -