Skip to content

Commit 341313f

Browse files
committed
msrv: fix Jiff build on Windows for Rust 1.71
I think older Rust versions were more paranoid about leaking types with a more restricted scope. So just switch to `pub`. We test this in CI, but only the build. Since dev dependencies have much higher MSRVs. Fixes #566
1 parent 9533286 commit 341313f

2 files changed

Lines changed: 22 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,19 @@ jobs:
355355
# - name: Run integration tests
356356
# run: cargo test --test integration
357357

358+
# Same as above, but for Windows. The MSRV is technically higher because Jiff
359+
# inherits the MSRV of system-level dependencies (like `windows-link`).
360+
msrv-win:
361+
runs-on: windows-latest
362+
steps:
363+
- name: Checkout repository
364+
uses: actions/checkout@v5
365+
- name: Install Rust
366+
uses: dtolnay/rust-toolchain@master
367+
with:
368+
toolchain: 1.71.1
369+
- run: cargo build --verbose
370+
358371
# This job tests that examples outside the workspace build.
359372
#
360373
# These are outside the workspace because their dependency graphs are

src/tz/system/windows/ffi.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
1-
pub(super) const TIME_ZONE_ID_INVALID: u32 = 0xffffffff;
1+
pub const TIME_ZONE_ID_INVALID: u32 = 0xffffffff;
22

3+
// MSRV(??): Must be marked as public to avoid errors in older Rust compilers.
4+
// Rust 1.71 needs this. But Rust 1.95 does not. I'm not sure where the cross
5+
// over point is, but it'd be nice to tighten this up a bit. In any case, this
6+
// isn't actually re-exported anywhere in Jiff's public API, so it's fine.
7+
// ---AG
38
#[repr(C)]
4-
pub(super) struct DYNAMIC_TIME_ZONE_INFORMATION {
9+
pub struct DYNAMIC_TIME_ZONE_INFORMATION {
510
bias: i32,
611
standard_name: [u16; 32],
712
standard_date: SYSTEMTIME,
813
standard_bias: i32,
914
daylight_name: [u16; 32],
1015
daylight_date: SYSTEMTIME,
1116
daylight_bias: i32,
12-
/// This is the only field we actually need.
13-
pub(super) timezone_key_name: [u16; 128],
17+
// This is the only field we actually need.
18+
pub timezone_key_name: [u16; 128],
1419
dynamic_daylight_time_disabled: u8,
1520
}
1621

0 commit comments

Comments
 (0)