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

Deriving TryFromBytes warns about non_camel_case_types #2051

Closed
bluurryy opened this issue Nov 13, 2024 · 2 comments
Closed

Deriving TryFromBytes warns about non_camel_case_types #2051

bluurryy opened this issue Nov 13, 2024 · 2 comments

Comments

@bluurryy
Copy link

When you derive TryFromBytes on an enum like this:

#[repr(u32)]
#[allow(non_camel_case_types)]
#[derive(TryFromBytes)]
pub enum Code {
    I32_ADD,
    I32_SUB,
    I32_MUL,
}

You get warnings about non_camel_case_types from the expanded code:

// ...
#[repr(u32)]
#[allow(dead_code)]
enum ___ZerocopyTag {
    I32_ADD,
    I32_SUB,
    I32_MUL,
}
// ...

Adding #[allow(non_camel_case_types)] to the ___ZerocopyTag will fix this.

joshlf added a commit that referenced this issue Nov 13, 2024
...in derive-generated code.

Closes #2051

gherrit-pr-id: If3dbedcccd338435b5aa72dd724caaf9447b1baa
@joshlf
Copy link
Member

joshlf commented Nov 13, 2024

Thanks for reporting this! I've opened a fix in #2057.

joshlf added a commit that referenced this issue Nov 13, 2024
...in derive-generated code.

Closes #2051

gherrit-pr-id: If3dbedcccd338435b5aa72dd724caaf9447b1baa
github-merge-queue bot pushed a commit that referenced this issue Nov 13, 2024
...in derive-generated code.

Closes #2051

gherrit-pr-id: If3dbedcccd338435b5aa72dd724caaf9447b1baa
google-pr-creation-bot pushed a commit to google-pr-creation-bot/zerocopy that referenced this issue Nov 14, 2024
...in derive-generated code.

Closes google#2051

gherrit-pr-id: If3dbedcccd338435b5aa72dd724caaf9447b1baa
github-merge-queue bot pushed a commit that referenced this issue Nov 14, 2024
...in derive-generated code.

Closes #2051

gherrit-pr-id: If3dbedcccd338435b5aa72dd724caaf9447b1baa

Co-authored-by: Joshua Liebow-Feeser <joshlf@users.noreply.github.com>
@joshlf
Copy link
Member

joshlf commented Nov 14, 2024

Closed in #2057

@joshlf joshlf closed this as completed Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants