Skip to content

Commit 5aa272b

Browse files
authored
Merge pull request #91 from CAD97/rustup
update msrv, fix fallout
2 parents 2f698df + 03c5885 commit 5aa272b

File tree

23 files changed

+167
-227
lines changed

23 files changed

+167
-227
lines changed

.github/workflows/ci.yaml

Lines changed: 29 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,114 +1,76 @@
11
name: CI
22
on:
33
pull_request:
4-
push: # bors
5-
branches:
6-
- staging
7-
- trying
4+
merge_group:
85

96
env:
10-
CI: 1
11-
CARGO_INCREMENTAL: 0
12-
CARGO_PROFILE_DEV_DEBUG: false
13-
CARGO_PROFILE_RELEASE_DEBUG: false
147
RUSTFLAGS: -D warnings -W unreachable-pub
15-
MIRIFLAGS: -Zmiri-check-number-validity -Zmiri-symbolic-alignment-check -Zmiri-tag-raw-pointers
8+
MIRIFLAGS: -Zmiri-strict-provenance -Zmiri-symbolic-alignment-check
169

1710
jobs:
1811
cargo-test:
1912
name: Tests
20-
if: ${{ github.event.pusher.name == 'bors[bot]' }}
2113
runs-on: ubuntu-latest
2214
steps:
2315

2416
- name: Checkout repository
25-
uses: actions/checkout@v2
17+
uses: actions/checkout@v4
2618

2719
- name: Install toolchain
28-
uses: actions-rs/toolchain@v1
29-
with:
30-
toolchain: 1.59.0
31-
profile: minimal
32-
override: true
20+
uses: dtolnay/[email protected]
3321

3422
- name: Enable caching
35-
uses: Swatinem/rust-cache@v1.3.0
23+
uses: Swatinem/rust-cache@v2
3624

3725
- name: Compile
38-
uses: actions-rs/cargo@v1
39-
with:
40-
command: test
41-
args: --all --all-targets --examples --no-run
26+
run: cargo test --all --all-targets --examples --no-run
4227

4328
- name: Run tests
44-
uses: actions-rs/cargo@v1
45-
with:
46-
command: test
47-
args: --all --all-targets --examples
29+
run: cargo test --all --all-targets --examples
4830

4931
cargo-test-msrv:
50-
name: Tests (1.41.0)
32+
name: Tests (1.80.0)
5133
runs-on: ubuntu-latest
5234
steps:
5335

5436
- name: Checkout repository
55-
uses: actions/checkout@v2
37+
uses: actions/checkout@v4
5638

5739
- name: Install arbitrary nightly toolchain
58-
uses: actions-rs/toolchain@v1
40+
uses: dtolnay/rust-toolchain@master
5941
with:
60-
toolchain: nightly-2022-01-01
61-
profile: minimal
42+
toolchain: nightly-2025-01-01
6243

6344
- name: Install msrv toolchain
64-
uses: actions-rs/toolchain@v1
65-
with:
66-
toolchain: 1.41.0
67-
profile: minimal
68-
override: true
45+
uses: dtolnay/[email protected]
6946

7047
- name: Generate minimal-versions lockfile
71-
uses: actions-rs/cargo@v1
72-
with:
73-
command: +nightly-2022-01-01
74-
args: -Z minimal-versions generate-lockfile
48+
run: cargo +nightly-2025-01-01 -Zminimal-versions generate-lockfile
7549

7650
- name: Enable caching
77-
uses: Swatinem/rust-cache@v1.3.0
51+
uses: Swatinem/rust-cache@v2
7852

7953
- name: Compile
80-
uses: actions-rs/cargo@v1
81-
with:
82-
command: test
83-
args: --locked --all --all-targets --examples --no-run
54+
run: cargo test --locked --all --all-targets --examples --no-run
8455

8556
- name: Run tests
86-
uses: actions-rs/cargo@v1
87-
with:
88-
command: test
89-
args: --locked --all --all-targets --examples
57+
run: cargo test --locked --all --all-targets --examples
9058

9159
cargo-fmt:
9260
name: Formatting
9361
runs-on: ubuntu-latest
9462
steps:
9563

9664
- name: Checkout repository
97-
uses: actions/checkout@v2
65+
uses: actions/checkout@v4
9866

99-
- name: Instal toolchain
100-
uses: actions-rs/toolchain@v1
67+
- name: Install toolchain
68+
uses: dtolnay/rust-toolchain@1.84
10169
with:
102-
profile: minimal
103-
toolchain: 1.59.0
104-
override: true
10570
components: rustfmt
10671

10772
- name: Check formatting
108-
uses: actions-rs/cargo@v1
109-
with:
110-
command: fmt
111-
args: --all -- --check
73+
run: cargo fmt --all -- --check
11274

11375
cargo-clippy:
11476
name: Lints
@@ -118,47 +80,32 @@ jobs:
11880
- name: Checkout repository
11981
uses: actions/checkout@v2
12082

121-
- name: Install beta toolchain
122-
uses: actions-rs/toolchain@v1
83+
- name: Install toolchain
84+
uses: dtolnay/rust-toolchain@1.84
12385
with:
124-
profile: minimal
125-
toolchain: 1.59.0
126-
override: true
12786
components: clippy
12887

129-
- name: Check style
130-
uses: actions-rs/cargo@v1
131-
with:
132-
command: clippy
133-
args: --all --all-targets
88+
- name: Check clippy
89+
run: cargo clippy --all --all-targets
13490

13591
cargo-miri:
13692
name: Miri
13793
runs-on: ubuntu-latest
13894
steps:
13995

14096
- name: Checkout repository
141-
uses: actions/checkout@v2
97+
uses: actions/checkout@v4
14298

14399
- name: Install nightly toolchain
144-
uses: actions-rs/toolchain@v1
100+
uses: dtolnay/rust-toolchain@nightly
145101
with:
146-
profile: minimal
147-
toolchain: nightly
148-
override: true
149102
components: miri
150103

151104
- name: Enable caching
152-
uses: Swatinem/rust-cache@v1.3.0
105+
uses: Swatinem/rust-cache@v2
153106

154107
- name: Miri setup
155-
uses: actions-rs/cargo@v1
156-
with:
157-
command: miri
158-
args: setup
108+
run: cargo miri setup
159109

160110
- name: Miri test
161-
uses: actions-rs/cargo@v1
162-
with:
163-
command: miri
164-
args: test --workspace --all-features
111+
run: cargo miri test --workspace --all-features

Cargo.lock

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[workspace]
2+
resolver = "2"
23
members = [
34
"crates/erasable",
45
"crates/ptr-union",

crates/erasable/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[package]
22
name = "erasable"
3-
version = "1.2.1"
4-
edition = "2018"
3+
version = "1.3.0"
4+
edition = "2021"
5+
rust-version = "1.80"
56

6-
authors = ["Christopher Durham (cad97) <[email protected]>"]
77
description = "Type-erased thin pointers."
88
repository = "https://github.com/CAD97/pointer-utils/tree/master/crates/erasable"
99
readme = "README.md"
10-
keywords = ["thin","pointer","type","erasure"]
11-
categories = ["data-structures","no-std","rust-patterns"]
10+
keywords = ["thin", "pointer", "type", "erasure"]
11+
categories = ["data-structures", "no-std", "rust-patterns"]
1212
license = "MIT OR Apache-2.0"
1313

1414
[package.metadata.workspaces]

crates/erasable/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use std::env;
22

33
fn main() {
4+
println!("cargo:rustc-check-cfg=cfg(has_extern_type, has_never, enforce_1_1_0_semantics)");
5+
46
let cfg = autocfg::new();
57

68
cfg.emit_expression_cfg("{ extern { type T; } () }", "has_extern_type");
7-
// NB: Requires this impl to cover `T: ?Sized`, which is not the case as of 2020-09-01.
8-
// cfg.emit_type_cfg("std::sync::Weak::into_raw", "has_Weak__into_raw");
99
cfg.emit_type_cfg("!", "has_never");
1010

1111
if let Ok(var) = env::var("ERASABLE_ENFORCE_1_1_0_SEMANTICS") {

crates/erasable/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -720,13 +720,11 @@ macro_rules! impl_erasable {
720720
}
721721

722722
#[cfg(feature = "alloc")]
723-
impl_erasable!(for<T>
724-
Box<T>,
723+
impl_erasable!(
724+
for<T> Box<T>,
725725
sync::Arc<T>,
726-
#[cfg(has_Weak__into_raw)]
727726
sync::Weak<T>,
728727
rc::Rc<T>,
729-
#[cfg(has_Weak__into_raw)]
730728
rc::Weak<T>,
731729
);
732730

@@ -749,11 +747,13 @@ unsafe impl ErasablePtr for ! {
749747
}
750748

751749
#[inline(always)]
750+
#[allow(clippy::needless_lifetimes)]
752751
unsafe fn erase_lt<'a, 'b, T: ?Sized>(this: &'a T) -> &'b T {
753752
&*(this as *const T)
754753
}
755754

756755
#[inline(always)]
756+
#[allow(clippy::needless_lifetimes)]
757757
unsafe fn erase_lt_mut<'a, 'b, T: ?Sized>(this: &'a mut T) -> &'b mut T {
758758
&mut *(this as *mut T)
759759
}

crates/erasable/tests/smoke.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! These tests don't really assert anything, they just exercise the API.
22
//! This is primarily intended to be run under miri as a sanitizer.
33
4-
#![allow(unused, clippy::redundant_clone, clippy::unnecessary_operation)]
4+
#![allow(unused, clippy::style)]
55

66
use erasable::{Erasable, ErasablePtr, ErasedPtr, Thin};
77

crates/ptr-union/Cargo.toml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
[package]
22
name = "ptr-union"
3-
version = "2.2.2"
4-
edition = "2018"
3+
version = "2.3.0"
4+
edition = "2021"
55

6-
authors = ["Christopher Durham (cad97) <[email protected]>"]
76
description = "Pointer union types the size of a pointer by storing the tag in the alignment bits."
87
repository = "https://github.com/CAD97/pointer-utils/tree/master/crates/ptr-union"
98
readme = "README.md"
10-
keywords = ["thin","pointer","union","enum"]
11-
categories = ["data-structures","no-std","rust-patterns"]
9+
keywords = ["thin", "pointer", "union", "enum"]
10+
categories = ["data-structures", "no-std", "rust-patterns"]
1211
license = "MIT OR Apache-2.0"
1312

1413
[package.metadata.workspaces]

crates/ptr-union/build.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
fn main() {
22
let cfg = autocfg::new();
3+
println!("cargo::rustc-check-cfg=cfg(has_never, has_strict_provenance)");
34
cfg.emit_type_cfg("!", "has_never");
5+
cfg.emit_expression_cfg("<*const ()>::addr", "has_strict_provenance");
46
autocfg::rerun_path("build.rs");
57
}

0 commit comments

Comments
 (0)