Skip to content

Commit

Permalink
Merge pull request #63 from Imberflur/CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Imberflur authored Sep 16, 2023
2 parents 058e13c + f83f215 commit 02d85de
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 23 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
on:
push:
branches:
- master
pull_request:
branches:
- "**"

name: CI

jobs:
build_and_test:
name: Build and Test (Linux)
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- nightly
- stable

timeout-minutes: 10

env:
RUST_BACKTRACE: 1
steps:
- uses: actions/checkout@v3

- name: Setup rust toolchain (stable)
if: matrix.rust == 'stable'
run: |
rustup update
rustup override set stable
- name: Setup rust toolchain (nightly)
if: matrix.rust == 'nightly'
run: |
rustup toolchain install nightly
rustup override set nightly
- name: Build
run: cargo build --verbose
- name: Doc
run: cargo doc --verbose
- name: Test
run: cargo test --verbose
- name: Build (no-default-features)
run: cargo build --verbose --no-default-features
- name: Test (no-default-features)
run: cargo test --verbose --no-default-features

- name: Bench
if: matrix.rust == 'nightly'
run: cargo bench --verbose --no-default-features


# TODO: some tests take a while

# miri:
# name: "Miri"
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Install Miri
# run: |
# rustup toolchain install nightly --component miri
# rustup override set nightly
# cargo miri setup
# - name: Test with Miri
# run: cargo miri test
20 changes: 0 additions & 20 deletions .travis.yml

This file was deleted.

9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## Unreleased

## 0.6.4 (2023-07-16)

* Fix UB reported by Miri and remove unmaintained `atom` dependency which has open soundness
issues. ([#61])

[#61]: https://github.com/amethyst/hibitset/pull/61

## 0.6.3 (2020-02-17)

* `BitSetAnd`, `BitSetOr`, `BitSetNot`, `BitSetXor`, `BitSetAll` now implement `Clone`. ([#52])
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "hibitset"
version = "0.6.3"
version = "0.6.4"
description = "Hierarchical bit set structure"
documentation = "https://docs.rs/hibitset"
repository = "https://github.com/slide-rs/hibitset"
Expand Down
4 changes: 2 additions & 2 deletions src/atomic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ impl Drop for OnceAtom {
if !ptr.is_null() {
// SAFETY: If the pointer is not null, we created it from
// `Box::into_raw` in `Self::atom_get_or_init`.
unsafe { Box::from_raw(ptr) };
drop(unsafe { Box::from_raw(ptr) });
}
}
}
Expand Down Expand Up @@ -240,7 +240,7 @@ impl OnceAtom {
) {
// SAFETY: We obtained this pointer from `Box::into_raw` above
// and failed to publish it to the `AtomicPtr`.
unsafe { Box::from_raw(new_ptr) };
drop(unsafe { Box::from_raw(new_ptr) });
existing_ptr
} else {
new_ptr
Expand Down

0 comments on commit 02d85de

Please sign in to comment.