Skip to content

Commit

Permalink
CI update
Browse files Browse the repository at this point in the history
  • Loading branch information
tower120 committed May 8, 2024
1 parent 4e73d03 commit 4d14ff9
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 56 deletions.
69 changes: 26 additions & 43 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: CI

on:
workflow_dispatch:
push:
branches: [ main, dev ]
pull_request:
Expand All @@ -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
- uses: actions/checkout@v4
- run: RUSTDOCFLAGS="--deny warnings" cargo doc --lib
4 changes: 2 additions & 2 deletions src/element.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 15 additions & 11 deletions src/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Traits, M>>> Send
unsafe impl<'a, Traits, M, IterItem> Send
for
Iter<'a, AnyVecPtr<Traits, M>, IterItem>
where
Traits: ?Sized + Trait,
M: MemBuilder,
IterItem: IteratorItem<'a, AnyVecPtr<Traits, M>>,
AnyVec<Traits, M>: Send
{}
#[allow(suspicious_auto_trait_impls)]
unsafe impl<'a, T, M: MemBuilder, IterItem: IteratorItem<'a, AnyVecRawPtr<T, M>>> Send
unsafe impl<'a, T, M, IterItem> Send
for
Iter<'a, AnyVecRawPtr<T, M>, IterItem>
where
M: MemBuilder,
IterItem: IteratorItem<'a, AnyVecRawPtr<T, M>>,
AnyVecTyped<'a, T, M>: Send
{}

#[allow(suspicious_auto_trait_impls)]
unsafe impl<'a, Traits: ?Sized + Trait, M: MemBuilder, IterItem: IteratorItem<'a, AnyVecPtr<Traits, M>>> Sync
unsafe impl<'a, Traits, M, IterItem> Sync
for
Iter<'a, AnyVecPtr<Traits, M>, IterItem>
where
Traits: ?Sized + Trait,
M: MemBuilder,
IterItem: IteratorItem<'a, AnyVecPtr<Traits, M>>,
AnyVec<Traits, M>: Sync
{}
#[allow(suspicious_auto_trait_impls)]
unsafe impl<'a, T: Sync, M: MemBuilder, IterItem: IteratorItem<'a, AnyVecRawPtr<T, M>>> Sync
unsafe impl<'a, T, M, IterItem> Sync
for
Iter<'a, AnyVecRawPtr<T, M>, IterItem>
where
T: Sync,
M: MemBuilder,
IterItem: IteratorItem<'a, AnyVecRawPtr<T, M>>,
AnyVecTyped<'a, T, M>: Sync
{}

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4d14ff9

Please sign in to comment.