Skip to content

Commit

Permalink
Fix warning with -Z minimal-versions
Browse files Browse the repository at this point in the history
```
error: non-local `impl` definition, `impl` blocks should be written at the same level as their item
  --> src/rt/object.rs:14:43
   |
14 | #[cfg_attr(feature = "checkpoint", derive(Serialize, Deserialize))]
   |                                           -^^^^^^^^
   |                                           |
   |                                           `Store` is not local
   |                                           `Serialize` is not local
   |                                           move the `impl` block outside of this constant `_IMPL_SERIALIZE_FOR_Store`
   |
   = 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: `-D non-local-definitions` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(non_local_definitions)]`
   = note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
```
  • Loading branch information
taiki-e committed Dec 8, 2024
1 parent 343510e commit aaf96ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ scoped-tls = "1.0.0"
generator = "0.8.1"

# Requires for "checkpoint" feature
serde = { version = "1.0.92", features = ["derive"], optional = true }
serde = { version = "1.0.113", features = ["derive"], optional = true }
serde_json = { version = "1.0.33", optional = true }

# Requires for "futures" feature
Expand Down

0 comments on commit aaf96ca

Please sign in to comment.