Skip to content

Commit

Permalink
use assert! in const
Browse files Browse the repository at this point in the history
  • Loading branch information
tesuji committed Sep 7, 2024
1 parent d93617d commit 4b28cfa
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ jobs:
runs-on: windows-latest
# needs: [build]
env:
# add_of_mut! requires for soundness
MSRV: 1.56.0
# assert! in consts
MSRV: 1.57.0
steps:
- uses: actions/checkout@v4
- run: |
Expand Down
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* `Fixed` for any bug fixes.
* `Security` in case of vulnerabilities.
-->
## [v1.2.0] - 2024-09-08
### Change MSRV from 1.56 to 1.57
Minor refactorings to abuse assertions in constants that Rust 1.57.0 allows.

## [v1.1.0] - 2024-04-30
### Change MSRV from 1.51 to 1.56

Expand Down Expand Up @@ -62,7 +66,8 @@ It signals that the API is mature enough to be stable for a long time.

First release

[v1.0.0]: https://github.com/lzutao/junction/compare/v1.0.0...v1.1.0
[v1.2.0]: https://github.com/lzutao/junction/compare/v1.1.0...v1.2.0
[v1.1.0]: https://github.com/lzutao/junction/compare/v1.0.0...v1.1.0
[v1.0.0]: https://github.com/lzutao/junction/compare/v0.2.1...v1.0.0
[v0.2.1]: https://github.com/lzutao/junction/compare/v0.2.0...v0.2.1
[v0.2.0]: https://github.com/lzutao/junction/compare/v0.1.0...v0.2.0
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
name = "junction"
version = "1.1.0" # Also update `html_root_url` in lib.rs
version = "1.2.0" # Also update `html_root_url` in lib.rs
authors = ["Lzu Tao <taolzu@gmail.com>"]
categories = ["api-bindings", "os::windows-apis"]
edition = "2021"
rust-version = "1.56"
rust-version = "1.57"
exclude = [
"/.github",
"/HOW-TO-RELEASE.md",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Quoted from [Computer Hope](https://www.computerhope.com/jargon/j/junction.htm):
### Minimal Supported Rust versions

1.56.0
1.57.0

## All relevant references

Expand Down
5 changes: 2 additions & 3 deletions src/internals/c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ pub use windows_sys::Win32::System::IO::DeviceIoControl;
const _: () = {
let std_layout = Layout::new::<RawHandle>();
let win_sys_layout = Layout::new::<HANDLE>();
// MSRV(Rust v1.57): use assert! instead
[(); 1][std_layout.size() - win_sys_layout.size()];
[(); 1][std_layout.align() - win_sys_layout.align()];
assert!(std_layout.size() == win_sys_layout.size());
assert!(std_layout.align() == win_sys_layout.align());
};

// NOTE: to use `size_of` operator, below structs should be packed.
Expand Down
2 changes: 1 addition & 1 deletion src/internals/c/nightly.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![allow(unused)]
#![expect(unused)]

use std::mem::offset_of;

Expand Down

0 comments on commit 4b28cfa

Please sign in to comment.