Skip to content

fix: allow unused_unsafe for __cpuid to support both stable and nightly#5793

Merged
jackye1995 merged 1 commit intolance-format:mainfrom
jackye1995:fix-nightly-cpuid-unsafe
Jan 23, 2026
Merged

fix: allow unused_unsafe for __cpuid to support both stable and nightly#5793
jackye1995 merged 1 commit intolance-format:mainfrom
jackye1995:fix-nightly-cpuid-unsafe

Conversation

@jackye1995
Copy link
Copy Markdown
Contributor

@jackye1995 jackye1995 commented Jan 23, 2026

In Rust nightly, __cpuid was changed to be a safe function, making the unsafe block unnecessary. This causes a warning that fails CI when -D warnings is set (e.g., via setup-rust-toolchain action).

Adding #[allow(unused_unsafe)] allows the code to compile without warnings on both stable (where unsafe is required) and nightly (where it's no longer needed).

Also add RUSTFLAGS="-D warnings" to the linux-build CI job to catch such issues early.

🤖 Generated with Claude Code

@github-actions github-actions Bot added the bug Something isn't working label Jan 23, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Review Summary

LGTM

This is a minimal, correct fix for the Rust nightly compatibility issue where __cpuid changed from an unsafe to a safe function.

The #[allow(unused_unsafe)] attribute is the standard approach for handling this kind of cross-version compatibility, allowing the code to compile without warnings on both stable (where unsafe is required) and nightly (where it is not).

No concerns with this change.

In Rust nightly, __cpuid was changed to be a safe function, making the
unsafe block unnecessary. This causes a warning that fails CI when
RUSTFLAGS includes -D warnings.

Adding #[allow(unused_unsafe)] allows the code to compile without
warnings on both stable (where unsafe is required) and nightly
(where it's no longer needed).

Also add RUSTFLAGS="-D warnings" to the linux-build CI job to catch
such issues early.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@jackye1995 jackye1995 force-pushed the fix-nightly-cpuid-unsafe branch from 4dd8ff7 to 6ca3490 Compare January 23, 2026 00:22
@jackye1995 jackye1995 merged commit d27cd60 into lance-format:main Jan 23, 2026
29 of 30 checks passed
jackye1995 added a commit to jackye1995/lance that referenced this pull request Jan 23, 2026
…ly (lance-format#5793)

In Rust nightly, __cpuid was changed to be a safe function, making the
unsafe block unnecessary. This causes a warning that fails CI when -D
warnings is set (e.g., via setup-rust-toolchain action).

Adding #[allow(unused_unsafe)] allows the code to compile without
warnings on both stable (where unsafe is required) and nightly (where
it's no longer needed).

Also add RUSTFLAGS="-D warnings" to the linux-build CI job to catch such
issues early.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
majin1102 pushed a commit to majin1102/lance that referenced this pull request Jan 23, 2026
…ly (lance-format#5793)

In Rust nightly, __cpuid was changed to be a safe function, making the
unsafe block unnecessary. This causes a warning that fails CI when -D
warnings is set (e.g., via setup-rust-toolchain action).

Adding #[allow(unused_unsafe)] allows the code to compile without
warnings on both stable (where unsafe is required) and nightly (where
it's no longer needed).

Also add RUSTFLAGS="-D warnings" to the linux-build CI job to catch such
issues early.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
jackye1995 added a commit that referenced this pull request Jan 23, 2026
…ly (#5793)

In Rust nightly, __cpuid was changed to be a safe function, making the
unsafe block unnecessary. This causes a warning that fails CI when -D
warnings is set (e.g., via setup-rust-toolchain action).

Adding #[allow(unused_unsafe)] allows the code to compile without
warnings on both stable (where unsafe is required) and nightly (where
it's no longer needed).

Also add RUSTFLAGS="-D warnings" to the linux-build CI job to catch such
issues early.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
vivek-bharathan pushed a commit to vivek-bharathan/lance that referenced this pull request Feb 2, 2026
…ly (lance-format#5793)

In Rust nightly, __cpuid was changed to be a safe function, making the
unsafe block unnecessary. This causes a warning that fails CI when -D
warnings is set (e.g., via setup-rust-toolchain action).

Adding #[allow(unused_unsafe)] allows the code to compile without
warnings on both stable (where unsafe is required) and nightly (where
it's no longer needed).

Also add RUSTFLAGS="-D warnings" to the linux-build CI job to catch such
issues early.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants