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

model-derive: add derive attributes at start of list #1572

Merged
merged 1 commit into from
May 13, 2021

Conversation

tjkirch
Copy link
Contributor

@tjkirch tjkirch commented May 13, 2021

Description of changes:

model-derive: add derive attributes at start of list

Rust 1.52 added a legacy_derive_helpers warning (soon to be an error) that
yells if you use an attribute macro before the derive macro that introduces it.
We should always put derive macros at the start of the list to avoid this.

Reference: https://github.com/rust-lang/rust/issues/79202

Fixes the warnings in the model crate showing up with Rust 1.52:

warning: derive helper attribute is used before it is introduced
   --> models/src/lib.rs:261:1
    |
261 | #[model]
    | ^^^^^^^^ the attribute is introduced here
    |
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #79202 <https://github.com/rust-lang/rust/issues/79202>
    = note: this warning originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)

Testing done:

^ Those are all gone. Confirmed I still get a healthy image where the API works fine, pod OK, etc.

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

Rust 1.52 added a legacy_derive_helpers warning (soon to be an error) that
yells if you use an attribute macro before the derive macro that introduces it.
We should always put derive macros at the start of the list to avoid this.

Reference: rust-lang/rust#79202
Copy link
Contributor

@zmrow zmrow left a comment

Choose a reason for hiding this comment

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

🍔

@tjkirch tjkirch merged commit 63fc9c7 into bottlerocket-os:develop May 13, 2021
@tjkirch tjkirch deleted the legacy_derive_helpers branch May 13, 2021 20:28
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

Successfully merging this pull request may close these issues.

3 participants