Skip to content

v0.3.0

Compare
Choose a tag to compare
@thomcc thomcc released this 03 Jun 09:58
· 2 commits to master since this release
v0.3.0
a1e66e5

Version 0.3.0

Improvements

The internals of this crate have been rewritten and modernized to avoid a few problems in the previous implementation. Please file bugs if you notice issues.

  • The macros now properly reference things using $crate::, so that they may be called as more_asserts::some_macro! without first pulling them into scope with use.

  • The documentation has been overhauled. Rather than suggesting #[macro_use] extern crate more_asserts;, we now suggest a pattern of importing with use more_asserts as ma; and invoking as ma::assert_gt! and similar.

    Of course, pulling the macros in via #[macro_use] extern crate more_asserts; will still work.

  • The macros now are implemented by calling outlined #[track_caller] functions to perform formatting and invoke the panic rather than directly panicking inside the macro body.

    This reduces the amount of code bloat produced by calls to the macros, and can improve the success-path performance of code which uses the macros (generally by allowing the compiler to inline functions that it would otherwise consider too large).

    In pathological cases, it may improve compile time as well.

Breaking changes

Due to the use of #[track_caller], this release increases the MSRV (the required version of the Rust compiler) to 1.46.0. This is the only breaking change.

1.46.0 is several years old now (even Debian stable has it), so hopefully1 this is fine.

  1. If it is not, let me know (file an issue), and I can consider doing compiler version detection in a build script, but I would rather not do this.