Skip to content

Commit 89a975b

Browse files
committed
Release v1.0.0
Pin down rust 1.51 as MSRV
1 parent 0ddc572 commit 89a975b

File tree

6 files changed

+43
-14
lines changed

6 files changed

+43
-14
lines changed

.github/workflows/ci.yml

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,17 @@ on:
77
- '!gh-pages'
88
pull_request:
99

10+
env:
11+
SPARSE_TOOLCHAIN: nightly-2023-02-25
12+
1013
jobs:
1114
build:
15+
if: false
1216
runs-on: windows-latest
1317
env:
1418
RUST_BACKTRACE: 1
1519
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
1620
MINGW_URL: https://ci-mirrors.rust-lang.org/rustc
17-
RUSTC_TOOLCHAIN: nightly-2023-02-25
1821
MIRIFLAGS: -Zmiri-disable-isolation
1922
strategy:
2023
matrix:
@@ -29,9 +32,8 @@ jobs:
2932
steps:
3033
- uses: actions/checkout@v3
3134
- run: |
32-
echo "${RUSTC_TOOLCHAIN}"
33-
rustup toolchain install "nightly-2023-02-25-${{ matrix.target }}"
34-
rustup default "nightly-2023-02-25-${{ matrix.target }}"
35+
rustup toolchain install "${{ env.SPARSE_TOOLCHAIN }}-${{ matrix.target }}"
36+
rustup default "${{ env.SPARSE_TOOLCHAIN }}-${{ matrix.target }}"
3537
- name: Check out MinGW toolchain
3638
run: |
3739
set -x
@@ -63,6 +65,27 @@ jobs:
6365
dir /aL C:\Users
6466
shell: cmd
6567

68+
msrv:
69+
runs-on: windows-latest
70+
# needs: [build]
71+
env:
72+
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
73+
# add_of_mut! requires for soundness
74+
MSRV: 1.51.0
75+
steps:
76+
- uses: actions/checkout@v3
77+
- run: |
78+
rustup toolchain install ${{ env.MSRV }}
79+
rustup toolchain install ${{ env.SPARSE_TOOLCHAIN }}
80+
rustup default ${{ env.MSRV }}
81+
- run: |
82+
rustup run ${{ env.SPARSE_TOOLCHAIN }} cargo generate-lockfile
83+
rustup run ${{ env.SPARSE_TOOLCHAIN }} cargo fetch
84+
- run: |
85+
cargo build --all-targets --locked
86+
- run: |
87+
cargo test
88+
6689
rustfmt:
6790
runs-on: ubuntu-latest
6891
steps:

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2626
* `Security` in case of vulnerabilities.
2727
-->
2828

29+
## [v1.0.0] - 2023-02-26
30+
### First major version
31+
The public API of this crate has been unchanged around 3 years without complains.
32+
It signals that the API is mature enough to be stable for a long time.
33+
2934
## [v0.2.1] - 2023-02-25
3035
### Fixed
3136
* Fix weird build failure when cross-compiling from non-Windows hosts
@@ -52,6 +57,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5257

5358
First release
5459

60+
[v1.0.0]: https://github.com/lzutao/junction/compare/v0.2.1...v1.0.0
61+
[v0.2.1]: https://github.com/lzutao/junction/compare/v0.2.0...v0.2.1
5562
[v0.2.0]: https://github.com/lzutao/junction/compare/v0.1.0...v0.2.0
5663
[v0.1.5]: https://github.com/lzutao/junction/compare/v0.1.4...v0.1.5
5764
[v0.1.4]: https://github.com/lzutao/junction/compare/v0.1.3...v0.1.4

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "junction"
3-
version = "0.2.1" # Also update `html_root_url` in lib.rs
3+
version = "1.0.0" # Also update `html_root_url` in lib.rs
44
authors = ["Lzu Tao <taolzu@gmail.com>"]
55
categories = ["api-bindings", "os::windows-apis"]
66
documentation = "https://docs.rs/junction/*/x86_64-pc-windows-msvc/junction/"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ Library for working with NTFS junctions.
66
[![Documentation](https://docs.rs/junction/badge.svg)](https://docs.rs/junction)
77
[![Crates.io](https://img.shields.io/crates/v/junction.svg)](https://crates.io/crates/junction)
88

9-
### Supported Rust versions
9+
### Minimal Supported Rust versions
1010

11-
Latest stable
11+
1.48.0
1212

1313
## All relevant references
1414

src/internals.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ const _: () = {
2020
use std::alloc::Layout;
2121
let std_layout = Layout::new::<std::os::windows::io::RawHandle>();
2222
let winapi_layout = Layout::new::<winapi::um::winnt::HANDLE>();
23-
assert!(std_layout.size() == winapi_layout.size());
24-
assert!(std_layout.align() == winapi_layout.align());
23+
// MSVR(Rust v1.57): use assert! instead
24+
[(); 1][!(std_layout.size() == winapi_layout.size()) as usize];
25+
[(); 1][!(std_layout.align() == winapi_layout.align()) as usize];
2526
};
2627

2728
/// This prefix indicates to NTFS that the path is to be treated as a non-interpreted
@@ -141,14 +142,12 @@ pub fn get_target(junction: &Path) -> io::Result<PathBuf> {
141142
if rdb.reparse_tag == IO_REPARSE_TAG_MOUNT_POINT {
142143
let offset = rdb.reparse_buffer.substitute_name_offset / WCHAR_SIZE;
143144
let len = rdb.reparse_buffer.substitute_name_length / WCHAR_SIZE;
144-
let mut wide = unsafe {
145+
let wide = unsafe {
145146
let buf = rdb.reparse_buffer.path_buffer.as_ptr().add(offset as usize);
146147
slice::from_raw_parts(buf, len as usize)
147148
};
148149
// In case of "\??\C:\foo\bar"
149-
if wide.starts_with(&NON_INTERPRETED_PATH_PREFIX) {
150-
wide = &wide[(NON_INTERPRETED_PATH_PREFIX.len())..];
151-
}
150+
let wide = wide.strip_prefix(&NON_INTERPRETED_PATH_PREFIX).unwrap_or(wide);
152151
Ok(PathBuf::from(OsString::from_wide(wide)))
153152
} else {
154153
Err(io::Error::new(io::ErrorKind::Other, "not a reparse tag mount point"))

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if the directory `D:\SYMLINK` specified `C:\WINNT\SYSTEM32` as its target, then
1010
an application accessing `D:\SYMLINK\DRIVERS` would in reality be accessing
1111
`C:\WINNT\SYSTEM32\DRIVERS`.
1212
*/
13-
#![doc(html_root_url = "https://docs.rs/junction/0.2.1")]
13+
#![doc(html_root_url = "https://docs.rs/junction/~1")]
1414
#![cfg(windows)]
1515
#![deny(rust_2018_idioms)]
1616

0 commit comments

Comments
 (0)