Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,13 @@ jobs:
cargo +stable update
- uses: taiki-e/install-action@v2
with:
tool: cargo-hack,cargo-nextest
tool: cargo-hack,cargo-nextest,cargo-minimal-versions
- name: Test (${{ matrix.rust }}, ${{ matrix.feature_flags }}})
run: |
cargo hack ${{ matrix.feature_flags }} nextest run --no-tests=pass
- name: Check -Zminimal-versions (${{ matrix.rust }}, ${{ matrix.feature_flags }}})
run: |
cargo hack ${{ matrix.feature_flags }} minimal-versions check

clippy:
# Only run on PRs if the source branch is on someone else's repo
Expand Down
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ intid-derive = { path = "intid-derive", version = "0.3.2" }
intid-core = { path = "intid-core", version = "0.3.2"}
intid = { path = "intid", version = "0.3.2" }

# bytemuck 1.14 - adds `align_offset` feature
# bytemuck 1.19 - adds `track_caller` feature
bytemuck = "1.19"

[workspace.lints.rust]
missing-docs = "deny"
unsafe-op-in-unsafe-fn = "deny"
Expand Down
2 changes: 1 addition & 1 deletion intid-allocator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ keywords = [

[dependencies]
atomic = { version = "0.6", optional = true }
bytemuck = { version = "1", optional = true }
bytemuck = { workspace = true, optional = true }
rustversion = "1"

[dependencies.intid]
Expand Down
2 changes: 1 addition & 1 deletion intid-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ keywords = ["intid", "id", "counter", "idmap", "integer"]
[dependencies]
num-traits = { version = "0.2", optional = true }
nonmax = { version = "0.5", optional = true }
bytemuck = { version = "1", optional = true }
bytemuck = { workspace = true, optional = true }

[features]
default = ["std"]
Expand Down
5 changes: 3 additions & 2 deletions intid-derive/src/analyze.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,8 @@ pub fn determine_repr(input: &DeriveInput) -> Result<Option<Repr>, syn::Error> {
if result.is_some() {
return Err(meta.error("Encountered multiple repr(...) attributes"));
}
let ident = meta.path.require_ident()?;
let unknown_repr = || syn::Error::new(meta.path.span(), "Unknown #[repr])");
let ident = meta.path.get_ident().ok_or_else(unknown_repr)?;
let s = ident.to_string();
result = Some(match &*s {
"C" => Repr::C(ident.span()),
Expand All @@ -343,7 +344,7 @@ pub fn determine_repr(input: &DeriveInput) -> Result<Option<Repr>, syn::Error> {
..int
})
}
_ => return Err(syn::Error::new(meta.path.span(), "Unknown #[repr])")),
_ => return Err(unknown_repr()),
});
Ok(())
})?;
Expand Down
Loading