Skip to content

Commit e718a13

Browse files
committed
[Release] Prepare 1.0.0
Closes #1 by removing labeling limitation.
1 parent 2494104 commit e718a13

File tree

4 files changed

+59
-27
lines changed

4 files changed

+59
-27
lines changed

CHANGELOG.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,27 @@ The format is based on [Keep a Changelog] and this project adheres to
66

77
## [Unreleased]
88

9+
## [1.0.0]: - 2019-10-02
10+
### Added
11+
- `assert_eq_align!` macro
12+
13+
### Removed
14+
- **[breaking]** Labels from macros that needed them 🎉
15+
- Made possible by [`const _`] in Rust 1.37
16+
- **[breaking]** `assert_impl!` macro
17+
18+
### Fixed
19+
- `assert_fields!` now works for `enum` types with multiple variants
20+
21+
### Changed
22+
- **[breaking]** `const_assert!` macro to only take one expression
23+
- Reasoning: when custom error messages are added in the future (via
24+
[`assert!`]), having the macro allow for multiple comma-separated
25+
expressions may lead to ambiguity
26+
- **[breaking]** Trait assertions to use `Type: Trait` syntax
27+
- **[breaking]** Field assertions to use `Type: field1, field2` syntax
28+
- **[breaking]** Renamed `assert_{ne,eq}_type!` to `assert_type_{ne,eq}_all!`
29+
930
## [0.3.4] - 2019-06-12
1031
### Changed
1132
- Aliased `assert_impl!` to `assert_impl_all!` and deprecated `assert_impl!`
@@ -114,6 +135,9 @@ Initial release
114135

115136
[Simon Sapin]: https://github.com/SimonSapin
116137

138+
[`assert!`]: https://doc.rust-lang.org/stable/std/macro.assert.html
139+
[`const _`]: https://github.com/rust-lang/rfcs/blob/master/text/2526-const-wildcard.md
140+
117141
[#1]: https://github.com/nvzqz/static-assertions-rs/issues/1
118142
[#5]: https://github.com/nvzqz/static-assertions-rs/pull/5
119143

@@ -123,7 +147,8 @@ Initial release
123147
[Keep a Changelog]: http://keepachangelog.com/en/1.0.0/
124148
[Semantic Versioning]: http://semver.org/spec/v2.0.0.html
125149

126-
[Unreleased]: https://github.com/nvzqz/static-assertions-rs/compare/v0.3.4...HEAD
150+
[Unreleased]: https://github.com/nvzqz/static-assertions-rs/compare/v1.0.0...HEAD
151+
[1.0.0]: https://github.com/nvzqz/static-assertions-rs/compare/v0.3.4...v1.0.0
127152
[0.3.4]: https://github.com/nvzqz/static-assertions-rs/compare/v0.3.3...v0.3.4
128153
[0.3.3]: https://github.com/nvzqz/static-assertions-rs/compare/v0.3.2...v0.3.3
129154
[0.3.2]: https://github.com/nvzqz/static-assertions-rs/compare/v0.3.1...v0.3.2

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "static_assertions"
3-
version = "0.3.4"
3+
version = "1.0.0"
44
authors = ["Nikolai Vazquez"]
55
license = "MIT OR Apache-2.0"
66
readme = "README.md"

README.md

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<a href="https://travis-ci.org/nvzqz/static-assertions-rs">
99
<img src="https://travis-ci.org/nvzqz/static-assertions-rs.svg?branch=master" alt="Build Status">
1010
</a>
11-
<img src="https://img.shields.io/badge/rustc-^1.24.0-blue.svg" alt="rustc ^1.24.0">
11+
<img src="https://img.shields.io/badge/rustc-^1.37.0-blue.svg" alt="rustc ^1.37.0">
1212
<br>
1313
<a href="https://www.patreon.com/nvzqz">
1414
<img src="https://c5.patreon.com/external/logo/become_a_patron_button.png" alt="Become a Patron!" height="35">
@@ -31,7 +31,7 @@ adding the following to your project's
3131

3232
```toml
3333
[dependencies]
34-
static_assertions = "0.3.4"
34+
static_assertions = "1.0.0"
3535
```
3636

3737
and this to your crate root (`main.rs` or `lib.rs`):
@@ -44,24 +44,21 @@ extern crate static_assertions;
4444
## Usage
4545

4646
This crate exposes the following macros:
47-
- [`assert_cfg!`](https://docs.rs/static_assertions/0.3.4/static_assertions/macro.assert_cfg.html)
48-
- [`assert_eq_size!`](https://docs.rs/static_assertions/0.3.4/static_assertions/macro.assert_eq_size.html)
49-
- [`assert_eq_size_ptr!`](https://docs.rs/static_assertions/0.3.4/static_assertions/macro.assert_eq_size_ptr.html)
50-
- [`assert_eq_size_val!`](https://docs.rs/static_assertions/0.3.4/static_assertions/macro.assert_eq_size_val.html)
51-
- [`assert_eq_type!`](https://docs.rs/static_assertions/0.3.4/static_assertions/macro.assert_eq_type.html)
52-
- [`assert_ne_type!`](https://docs.rs/static_assertions/0.3.4/static_assertions/macro.assert_ne_type.html)
53-
- [`assert_fields!`](https://docs.rs/static_assertions/0.3.4/static_assertions/macro.assert_fields.html)
54-
- [`assert_impl_all!`](https://docs.rs/static_assertions/0.3.4/static_assertions/macro.assert_impl_all.html)
55-
- [`assert_not_impl_all!`](https://docs.rs/static_assertions/0.3.4/static_assertions/macro.assert_not_impl_all.html)
56-
- [`assert_not_impl_any!`](https://docs.rs/static_assertions/0.3.4/static_assertions/macro.assert_not_impl_any.html)
57-
- [`assert_obj_safe!`](https://docs.rs/static_assertions/0.3.4/static_assertions/macro.assert_obj_safe.html)
58-
- [`const_assert!`](https://docs.rs/static_assertions/0.3.4/static_assertions/macro.const_assert.html)
59-
- [`const_assert_eq!`](https://docs.rs/static_assertions/0.3.4/static_assertions/macro.const_assert_eq.html)
60-
61-
### Limitations
62-
63-
See [issue #1](https://github.com/nvzqz/static-assertions-rs/issues/1) to read
64-
up on current limitations of this crate and how to currently overcome them.
47+
- [`assert_cfg!`](https://docs.rs/static_assertions/1.0.0/static_assertions/macro.assert_cfg.html)
48+
- [`assert_eq_align!`](https://docs.rs/static_assertions/1.0.0/static_assertions/macro.assert_eq_align.html)
49+
- [`assert_eq_size!`](https://docs.rs/static_assertions/1.0.0/static_assertions/macro.assert_eq_size.html)
50+
- [`assert_eq_size_ptr!`](https://docs.rs/static_assertions/1.0.0/static_assertions/macro.assert_eq_size_ptr.html)
51+
- [`assert_eq_size_val!`](https://docs.rs/static_assertions/1.0.0/static_assertions/macro.assert_eq_size_val.html)
52+
- [`assert_fields!`](https://docs.rs/static_assertions/1.0.0/static_assertions/macro.assert_fields.html)
53+
- [`assert_impl_all!`](https://docs.rs/static_assertions/1.0.0/static_assertions/macro.assert_impl_all.html)
54+
- [`assert_not_impl_all!`](https://docs.rs/static_assertions/1.0.0/static_assertions/macro.assert_not_impl_all.html)
55+
- [`assert_not_impl_any!`](https://docs.rs/static_assertions/1.0.0/static_assertions/macro.assert_not_impl_any.html)
56+
- [`assert_obj_safe!`](https://docs.rs/static_assertions/1.0.0/static_assertions/macro.assert_obj_safe.html)
57+
- [`assert_type_eq_all!`](https://docs.rs/static_assertions/1.0.0/static_assertions/macro.assert_type_eq_all.html)
58+
- [`assert_type_ne_all!`](https://docs.rs/static_assertions/1.0.0/static_assertions/macro.assert_type_ne_all.html)
59+
- [`const_assert!`](https://docs.rs/static_assertions/1.0.0/static_assertions/macro.const_assert.html)
60+
- [`const_assert_eq!`](https://docs.rs/static_assertions/1.0.0/static_assertions/macro.const_assert_eq.html)
61+
- [`const_assert_ne!`](https://docs.rs/static_assertions/1.0.0/static_assertions/macro.const_assert_ne.html)
6562

6663
## Changes
6764

src/lib.rs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
//! [![Banner](https://raw.githubusercontent.com/nvzqz/static-assertions-rs/assets/Banner.png)](https://github.com/nvzqz/static-assertions-rs)
22
//!
3-
//! Compile-time assertions to ensure that invariants are met.
3+
//! Assertions to ensure correct assumptions about constants, types, and more.
44
//!
5-
//! _All_ assertions within this crate are performed at [compile-time]. This
5+
//! _All_ checks provided by this crate are performed at [compile-time]. This
66
//! allows for finding errors quickly and early when it comes to ensuring
77
//! certain features or aspects of a codebase. These macros are especially
88
//! important when exposing a public API that requires types to be the same size
@@ -15,7 +15,7 @@
1515
//!
1616
//! ```toml
1717
//! [dependencies]
18-
//! static_assertions = "0.3.4"
18+
//! static_assertions = "1.0.0"
1919
//! ```
2020
//!
2121
//! and this to your crate root (`main.rs` or `lib.rs`):
@@ -26,6 +26,15 @@
2626
//! # fn main() {}
2727
//! ```
2828
//!
29+
//! When using [Rust 2018 edition][2018], the following shorthand can help if
30+
//! having `#[macro_use]` is undesirable.
31+
//!
32+
//! ```edition2018
33+
//! extern crate static_assertions as sa;
34+
//!
35+
//! sa::const_assert!(true);
36+
//! ```
37+
//!
2938
//! # Examples
3039
//!
3140
//! Very thorough examples are provided in the docs for
@@ -50,12 +59,13 @@
5059
//! <img src="https://buymecoffee.intm.org/img/button-paypal-white.png" alt="Buy me a coffee" height="35">
5160
//! </a>
5261
//!
53-
//! [issue1]: https://github.com/nvzqz/static-assertions-rs/issues/1
62+
//! [Rust 1.37]: https://blog.rust-lang.org/2019/08/15/Rust-1.37.0.html
63+
//! [2018]: https://blog.rust-lang.org/2018/12/06/Rust-1.31-and-rust-2018.html#rust-2018
5464
//! [crate]: https://crates.io/crates/static_assertions
5565
//! [compile-time]: https://en.wikipedia.org/wiki/Compile_time
5666
//! [`Cargo.toml`]: https://doc.rust-lang.org/cargo/reference/manifest.html
5767
58-
#![doc(html_root_url = "https://docs.rs/static_assertions/0.3.4")]
68+
#![doc(html_root_url = "https://docs.rs/static_assertions/1.0.0")]
5969
#![doc(html_logo_url = "https://raw.githubusercontent.com/nvzqz/static-assertions-rs/assets/Icon.png")]
6070

6171
#![no_std]

0 commit comments

Comments
 (0)