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

build warnings in data-formats module #713

Open
nullr0ute opened this issue Jan 9, 2025 · 0 comments
Open

build warnings in data-formats module #713

nullr0ute opened this issue Jan 9, 2025 · 0 comments

Comments

@nullr0ute
Copy link
Contributor

We're seeing some new warnings in the data-formats module, I think due to a new version of rust.

warning: elided lifetime has a name
   --> data-formats/src/ownershipvoucher.rs:330:45
    |
329 | impl<'a> OwnershipVoucher {
    |      -- lifetime `'a` declared here
330 |     pub fn iter_entries(&'a self) -> Result<EntryIter> {
    |                                             ^^^^^^^^^ this elided lifetime gets resolved as `'a`
    |
    = note: `#[warn(elided_named_lifetimes)]` on by default

warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
   --> data-formats/src/constants/mod.rs:350:64
    |
350 | #[derive(Debug, Clone, Copy, Serialize_repr, Deserialize_repr, FromPrimitive, PartialEq, Eq)]
    |                                                                ^------------
    |                                                                |
    |                                                                `FromPrimitive` is not local
    |                                                                move the `impl` block outside of this constant `_IMPL_NUM_FromPrimitive_FOR_MessageType`
...
353 | pub enum MessageType {
    |          ----------- `MessageType` is not local
    |
    = note: the derive macro `FromPrimitive` defines the non-local `impl`, and may need to be changed
    = note: the derive macro `FromPrimitive` may come from an old version of the `num_derive` crate, try updating your dependency with `cargo update -p num_derive`
    = note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl`
    = note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint
    = note: `#[warn(non_local_definitions)]` on by default
    = note: this warning originates in the derive macro `FromPrimitive` (in Nightly builds, run with -Z macro-backtrace for more info)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant