From 4d14ff949098f7053b649dcf6b27b0c90865055d Mon Sep 17 00:00:00 2001 From: tower120 Date: Wed, 8 May 2024 07:18:29 +0300 Subject: [PATCH] CI update --- .github/workflows/ci.yml | 69 +++++++++++++++------------------------- src/element.rs | 4 +-- src/iter.rs | 26 ++++++++------- 3 files changed, 43 insertions(+), 56 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dcfc895..03c5aac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,7 @@ name: CI on: + workflow_dispatch: push: branches: [ main, dev ] pull_request: @@ -11,65 +12,47 @@ env: jobs: build: + name: Build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - #- uses: ATiltedTree/setup-rust@v1 - # with: - # rust-version: stable - - name: Build - run: RUSTFLAGS="--deny warnings" cargo build - - build-all-features: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - #- uses: ATiltedTree/setup-rust@v1 - # with: - # rust-version: stable - - name: Build with all features - run: RUSTFLAGS="--deny warnings" cargo build --all-features + - uses: actions/checkout@v4 + - run: RUSTFLAGS="--deny warnings" cargo build + - run: RUSTFLAGS="--deny warnings" cargo build --all-features tests: + name: Run careful tests runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - #- uses: ATiltedTree/setup-rust@v1 - # with: - # rust-version: stable - - name: Run tests - run: RUSTFLAGS="--deny warnings" cargo test --all-features + - uses: dtolnay/rust-toolchain@nightly + - uses: taiki-e/install-action@v2 + with: + tool: cargo-careful + - uses: actions/checkout@v4 + - run: RUSTFLAGS="--deny warnings" cargo +nightly careful test + - run: RUSTFLAGS="--deny warnings" cargo +nightly careful test --all-features miri: + name: Miri tests runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - #- uses: ATiltedTree/setup-rust@v1 - # with: - # rust-version: stable - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@nightly with: - toolchain: nightly - components: miri - - name: Miri tests - run: RUSTFLAGS="--deny warnings" cargo +nightly miri test + toolchain: nightly + components: miri + - uses: actions/checkout@v4 + - run: RUSTFLAGS="--deny warnings" cargo +nightly miri test + - run: RUSTFLAGS="--deny warnings" cargo +nightly miri test --all-features benches: + name: Build benchmarks runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - #- uses: ATiltedTree/setup-rust@v1 - # with: - # rust-version: stable - - name: Build benches - run: RUSTFLAGS="--deny warnings" cargo build --benches + - uses: actions/checkout@v4 + - run: RUSTFLAGS="--deny warnings" cargo build --benches doc: + name: Build doc runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - #- uses: ATiltedTree/setup-rust@v1 - # with: - # rust-version: stable - - name: Build doc - run: RUSTDOCFLAGS="--deny warnings" cargo doc --lib \ No newline at end of file + - uses: actions/checkout@v4 + - run: RUSTDOCFLAGS="--deny warnings" cargo doc --lib \ No newline at end of file diff --git a/src/element.rs b/src/element.rs index 355bcb5..4e07f84 100644 --- a/src/element.rs +++ b/src/element.rs @@ -22,12 +22,12 @@ use crate::traits::{Cloneable, None, Trait}; /// /// Whenever you have `ElementPointer` as a value (from destructive [`AnyVec`] operations), /// you can safely take pointed value, with [`AnyValue::downcast`] or [`any_value::move_out`]. -/// Otherwise, it will be destructed with destruction of `Element`. +/// Otherwise, it will be destructed with destruction of [`Element`]. /// /// # Notes /// /// `ElementPointer` have it's own implementation of `downcast_` family (which return `&'a T`, instead of `&T`). -/// This is done, so you don't have to keep `ElementRef`/`ElementMut` alive, while casting to concrete type. +/// This is done, so you don't have to keep [`ElementRef`]/[`ElementMut`] alive, while casting to concrete type. /// /// [`AnyVec`]: crate::AnyVec /// [`AnyVec::get`]: crate::AnyVec::get diff --git a/src/iter.rs b/src/iter.rs index fe93116..8e9acf2 100644 --- a/src/iter.rs +++ b/src/iter.rs @@ -134,34 +134,40 @@ impl<'a, AnyVecPtr: IAnyVecRawPtr, IterItem: IteratorItem<'a, AnyVecPtr>> FusedI {} -// According to https://github.com/rust-lang/rust/issues/93367#issuecomment-1154832012 -#[allow(suspicious_auto_trait_impls)] -unsafe impl<'a, Traits: ?Sized + Trait, M: MemBuilder, IterItem: IteratorItem<'a, AnyVecPtr>> Send +unsafe impl<'a, Traits, M, IterItem> Send for Iter<'a, AnyVecPtr, IterItem> where + Traits: ?Sized + Trait, + M: MemBuilder, + IterItem: IteratorItem<'a, AnyVecPtr>, AnyVec: Send {} -#[allow(suspicious_auto_trait_impls)] -unsafe impl<'a, T, M: MemBuilder, IterItem: IteratorItem<'a, AnyVecRawPtr>> Send +unsafe impl<'a, T, M, IterItem> Send for Iter<'a, AnyVecRawPtr, IterItem> where + M: MemBuilder, + IterItem: IteratorItem<'a, AnyVecRawPtr>, AnyVecTyped<'a, T, M>: Send {} -#[allow(suspicious_auto_trait_impls)] -unsafe impl<'a, Traits: ?Sized + Trait, M: MemBuilder, IterItem: IteratorItem<'a, AnyVecPtr>> Sync +unsafe impl<'a, Traits, M, IterItem> Sync for Iter<'a, AnyVecPtr, IterItem> where + Traits: ?Sized + Trait, + M: MemBuilder, + IterItem: IteratorItem<'a, AnyVecPtr>, AnyVec: Sync {} -#[allow(suspicious_auto_trait_impls)] -unsafe impl<'a, T: Sync, M: MemBuilder, IterItem: IteratorItem<'a, AnyVecRawPtr>> Sync +unsafe impl<'a, T, M, IterItem> Sync for Iter<'a, AnyVecRawPtr, IterItem> where + T: Sync, + M: MemBuilder, + IterItem: IteratorItem<'a, AnyVecRawPtr>, AnyVecTyped<'a, T, M>: Sync {} @@ -222,8 +228,6 @@ impl<'a, Traits: ?Sized + Trait, M: MemBuilder> Clone for ElementMutIterItem<'a, } -//pub type Iter<'a, Traits> = IterBase<'a, Traits, ElementIterItem<'a, Traits>>; - /// Reference [`AnyVec`] iterator. Return [`ElementRef`] items. /// /// [`AnyVec`]: crate::AnyVec