Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lint: Make latest rust version happy
Unfortunately this required introducing a suppression of a warning: `#[allow(non_local_definitions)]` since the `Serialize` derive-macro declares a non-local implementation of `Block` that (probably) doesn't work together with `#[readonly::make]`, as the `Serialize` adds a function that `readonly::make` doesn't allow other modules to be shown. At least, that's my understanding. Either that, or the `readonly::make` macro defines a local scope for the `Block` data structure that doesn't work with the scope of the derive-macro. Full error message: warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item --> src/models/blockchain/block/mod.rs:124:24 | 122 | #[readonly::make] | ----------------- `ReadOnlyBlock` is not local 123 | #[allow(non_local_definitions)] // needed for [Deserialize] macro from serde 124 | #[derive(Clone, Debug, Serialize, Deserialize, BFieldCodec, GetSize)] | ^-------- | | | `Serialize` is not local | move the `impl` block outside of this constant `_` and up 2 bodies | = note: the derive macro `Serialize` defines the non-local `impl`, and may need to be changed = note: the derive macro `Serialize` may come from an old version of the `serde_derive` crate, try updating your dependency with `cargo update -p serde_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 `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
- Loading branch information