Skip to content

Commit

Permalink
Version 0.12.0 (#22)
Browse files Browse the repository at this point in the history
* remove some transmutes to preclude technical UB

* medium term ci test for const support

* first step of upgrading to `triple_arena` v0.10

* Replace bimap with `OrdArena`, add `Bits::total_cmp` and `OrdBits`

* Update Cargo.toml

* Update consts.rs

* Use the "custom" DST hack

* fix bugs

* remove old issues

* ci fixes

* implement `Error` for `EvalError`

* fix doc links

* triple_arena 0.11

* Version 0.12.0
  • Loading branch information
AaronKutch authored Aug 29, 2023
1 parent 6b1263d commit 74f41a5
Show file tree
Hide file tree
Showing 43 changed files with 1,040 additions and 988 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,29 @@ jobs:
cargo test $ALL_FEATURES,u64_digits
cargo test $ALL_FEATURES,u128_digits
# FIXME fix features when we can compile const_support again
const_test:
name: Test suite
runs-on: ubuntu-latest
env:
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@v2
- name: Install Rust components
run: |
rustup set profile minimal
rustup install nightly-2023-04-14
- name: Run test suite
run: |
cargo +nightly-2023-04-14 t $ALL_FEATURES,const_support
miri:
name: Miri
runs-on: ubuntu-latest
# note: we have turned on this Miri flag
env:
RUSTFLAGS: -D warnings
MIRIFLAGS: -Zmiri-tree-borrows
MIRIFLAGS: -Zmiri-tree-borrows -Zmiri-strict-provenance
steps:
- uses: actions/checkout@v2
- name: Install most recent Miri
Expand Down Expand Up @@ -78,7 +94,7 @@ jobs:
- name: Install Rust components
run: |
rustup set profile minimal
rustup install 1.66.1
rustup install 1.70.0
# In the past I have had problems with features not being orthogonal due to configuration
# mistakes, so we test several combinations here
- name: Run `cargo build`
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Changelog

## [0.12.0] - 2023-08-29
### Crate
- bumped MSRV to 1.70.0
- `triple_arena` 0.12

### Fixes
- Replaced some usages of transmutation with fat pointer `as` casts to prevent a technical subtlety
that could lead to UB (even if it wouldn't occur with `-Zrandomize-layout` in practice)
- Finally found a "custom" DST workaround to store the bitwidth inline and derive the slice length
from that instead of using the metadata hack. Note that this currently requires
`-Zmiri-tree-borrows` for Miri to accept it.

### Additions
- Added `Bits::total_cmp`
- Added `OrdBits`
- Added `Error` impl for `EvalError`

## [0.11.0] - 2023-06-04
### Crate
- Updated "zeroize_support" to use `zeroize` 1.6
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ system depending on these feature flags:
Note: By default, "const_support" and "std" are turned on, use `default-features = false` and
select specific features to avoid requiring nightly.

NOTE: As of Rust 1.66, if you try to use "const_support" with the macros you may get strange
NOTE: As of Rust 1.70, if you try to use "const_support" with the macros you may get strange
"erroneous constant used" and "deref_mut" errors unless you add all of
```
#![feature(const_trait_impl)]
Expand Down
12 changes: 6 additions & 6 deletions awint/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "awint"
# note: when bumping versions, update `rust-version` in `awint_internals/Cargo.toml` and in
# `ci.yml`, and add date to changelog
version = "0.11.0" # no 1.0 at least until `const_support` is all stabilized
version = "0.12.0" # no 1.0 at least until `const_support` is all stabilized
edition = "2021"
authors = ["Aaron Kutch <[email protected]>"]
license = "MIT OR Apache-2.0"
Expand All @@ -14,11 +14,11 @@ keywords = ["int", "integer", "big", "math", "no_std"]
categories = ["data-structures", "mathematics", "algorithms", "no-std"]

[dependencies]
awint_core = { version = "0.11.0", path = "../awint_core", default-features = false }
awint_dag = { version = "0.11.0", path = "../awint_dag", default-features = false, optional = true }
awint_ext = { version = "0.11.0", path = "../awint_ext", default-features = false, optional = true }
awint_macro_internals = { version = "0.11.0", path = "../awint_macro_internals", default-features = false, optional = true }
awint_macros = { version = "0.11.0", path = "../awint_macros" }
awint_core = { version = "0.12.0", path = "../awint_core", default-features = false }
awint_dag = { version = "0.12.0", path = "../awint_dag", default-features = false, optional = true }
awint_ext = { version = "0.12.0", path = "../awint_ext", default-features = false, optional = true }
awint_macro_internals = { version = "0.12.0", path = "../awint_macro_internals", default-features = false, optional = true }
awint_macros = { version = "0.12.0", path = "../awint_macros" }

# note: running the tests requires `--all-features`
[features]
Expand Down
2 changes: 1 addition & 1 deletion awint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub use awint_core::{bw, Bits, InlAwi, SerdeError};
#[cfg(feature = "dag")]
pub use awint_dag;
#[cfg(feature = "alloc")]
pub use awint_ext::{ExtAwi, FPType, FP};
pub use awint_ext::{ExtAwi, FPType, OrdBits, FP};
#[doc(hidden)]
#[cfg(feature = "std")]
pub use awint_macro_internals;
Expand Down
6 changes: 3 additions & 3 deletions awint_core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "awint_core"
version = "0.11.0"
version = "0.12.0"
edition = "2021"
authors = ["Aaron Kutch <[email protected]>"]
license = "MIT OR Apache-2.0"
Expand All @@ -12,7 +12,7 @@ keywords = ["int", "integer", "big", "math", "no_std"]
categories = ["data-structures", "mathematics", "algorithms", "no-std"]

[dependencies]
awint_internals = { version = "0.11.0", path = "../awint_internals", default-features = false }
awint_internals = { version = "0.12.0", path = "../awint_internals", default-features = false }
const_fn = "0.4"
rand_core = { version = "0.6", default-features = false, optional = true }
serde = { version = "1.0", default-features = false, optional = true }
Expand All @@ -27,7 +27,7 @@ ron = "0.8"
[features]
default = []
# Turns on nightly features required for many functions to be marked `const`
const_support = []
const_support = ["awint_internals/const_support"]
# Turns on `rand` support
rand_support = ["rand_core"]
# Turns on `serde` support
Expand Down
Loading

0 comments on commit 74f41a5

Please sign in to comment.