Skip to content

Commit f6949e5

Browse files
committed
generator: Emit new c"" CStr literals
These will land in Rust 1.76 and automatically append a `\0` terminator in the compiler without having to have a checked or `unsafe`-unchecked constructor on `CStr`. Hacking in an invalid `\0` anywhere in the string is disallowed with a compiler error. Note that `proc-macro`, and by extension `proc-macro2` only has support for parsing this literal, but not for emitting it yet.
1 parent e6d80ba commit f6949e5

File tree

6 files changed

+1127
-3442
lines changed

6 files changed

+1127
-3442
lines changed

.github/workflows/ci.yml

+17-4
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@v4
11+
- uses: dtolnay/rust-toolchain@nightly
1112
- run: cargo check --workspace --all-targets --all-features
1213

1314
check_msrv:
14-
name: Check ash and ash-window MSRV (1.69.0)
15+
name: Check ash and ash-window MSRV (1.76.0)
1516
runs-on: ubuntu-latest
1617
steps:
1718
- uses: actions/checkout@v4
18-
- uses: dtolnay/rust-toolchain@1.69.0
19+
- uses: dtolnay/rust-toolchain@nightly
1920
- run: cargo check -p ash -p ash-rewrite -p ash-window -p ash-examples --all-features
2021

2122
# TODO: add a similar job for the rewrite once that generates code
@@ -29,6 +30,10 @@ jobs:
2930
run: git submodule update --recursive --init --force --checkout
3031
- name: Run generator
3132
run: cargo run -p generator
33+
- uses: dtolnay/rust-toolchain@nightly
34+
with:
35+
components: rustfmt
36+
- run: cargo fmt
3237
- name: Diff autogen result
3338
run: test -z "$(git status --porcelain)" || (echo "::error::Generated files are different, please regenerate with cargo run -p generator!"; git diff; false)
3439

@@ -39,6 +44,7 @@ jobs:
3944
- name: Install Vulkan loader
4045
run: sudo apt-get install libvulkan-dev
4146
- uses: actions/checkout@v4
47+
- uses: dtolnay/rust-toolchain@nightly
4248
- name: Test all targets
4349
run: cargo test --workspace --all-targets
4450
- name: Test docs
@@ -49,6 +55,9 @@ jobs:
4955
runs-on: ubuntu-latest
5056
steps:
5157
- uses: actions/checkout@v4
58+
- uses: dtolnay/rust-toolchain@nightly
59+
with:
60+
components: rustfmt
5261
- run: cargo fmt --all -- --check
5362

5463
clippy:
@@ -61,10 +70,13 @@ jobs:
6170
- x86_64-unknown-linux-gnu
6271
- x86_64-apple-darwin
6372
- aarch64-apple-ios
73+
- aarch64-linux-android
6474
steps:
6575
- uses: actions/checkout@v4
66-
- name: Add Rust target ${{ matrix.target }}
67-
run: rustup target add ${{ matrix.target }}
76+
- uses: dtolnay/rust-toolchain@nightly
77+
with:
78+
targets: ${{ matrix.target }}
79+
components: clippy
6880
- name: Clippy lint without features
6981
# Only test the core ash, ash-rewrite and ash-window crate, where features reside.
7082
# The examples crate would otherwise enable all default features again,
@@ -84,6 +96,7 @@ jobs:
8496
runs-on: ubuntu-latest
8597
steps:
8698
- uses: actions/checkout@v4
99+
- uses: dtolnay/rust-toolchain@nightly
87100
- name: Document all crates
88101
env:
89102
RUSTDOCFLAGS: -Dwarnings

ash/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ categories = [
1919
"rendering::graphics-api"
2020
]
2121
edition = "2021"
22-
rust-version = "1.69.0"
22+
rust-version = "1.76.0"
2323

2424
[dependencies]
2525
libloading = { version = "0.8", optional = true }

ash/src/vk.rs

-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
)]
66
#[macro_use]
77
mod macros;
8-
pub use macros::*;
98
mod aliases;
109
pub use aliases::*;
1110
mod bitflags;
@@ -21,7 +20,6 @@ pub use enums::*;
2120
mod extensions;
2221
pub use extensions::*;
2322
mod feature_extensions;
24-
pub use feature_extensions::*;
2523
mod features;
2624
pub use features::*;
2725
mod prelude;

0 commit comments

Comments
 (0)