Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hide unexpected_cfgs warnings in proc-macro generated code #287

Merged
merged 2 commits into from
Nov 30, 2024

Conversation

Freax13
Copy link
Contributor

@Freax13 Freax13 commented Nov 30, 2024

Closes #286

The new impls should be identical, but they have the advantage that we
can move them around. See the next patch for why this is useful.
AFAICT it's not possible to set `#[allow(unexpected_cfgs)]` on a
`#[cfg(...)]` or `#[cfg_attr(...)]` directly. Instead, we have to crate
a new scope and use `#[allow(...)]` on that. This patch wraps all uses
of `target_arch = "spirv"` in an unnamed constant scope and uses
`#[allow(unexpected_cfgs)]` on it.
@Lokathor Lokathor requested a review from fu5ha November 30, 2024 14:21
Copy link
Collaborator

@fu5ha fu5ha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a nice solution to me

@Lokathor Lokathor merged commit 227d7fe into Lokathor:main Nov 30, 2024
14 checks passed
@Lokathor Lokathor added semver-patch semver patch change semver-derive We need to update the main crate's use of the derive crate labels Nov 30, 2024
@Lokathor
Copy link
Owner

released in bytemuck_derive-1.8.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-derive We need to update the main crate's use of the derive crate semver-patch semver patch change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Future unexpected_cfgs warning from derive(CheckedBitPattern)
3 participants