Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to anon-const for wrapping expanded impls
Fixes a non_local_definitions warning in the generated code. warning: non-local `impl` definition, they should be avoided as they go against expectation --> tests/test.rs:18:5 | 18 | #[typetag::serde] | ^^^^^^^^^^^^^^^^^ | = help: move this `impl` block outside the of the current constant `_Trait_registry` = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <rust-lang/rust#120363> = note: the attribute macro `typetag::serde` may come from an old version of the `typetag_impl` crate, try updating your dependency with `cargo update -p typetag_impl` = note: `#[warn(non_local_definitions)]` on by default = note: this warning originates in the attribute macro `typetag::serde` (in Nightly builds, run with -Z macro-backtrace for more info) warning: non-local `impl` definition, they should be avoided as they go against expectation --> tests/test.rs:18:5 | 18 | #[typetag::serde] | ^^^^^^^^^^^^^^^^^ | = help: move this `impl` block outside the of the current constant `_Trait_registry` = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <rust-lang/rust#120363> = note: the attribute macro `typetag::serde` may come from an old version of the `typetag_impl` crate, try updating your dependency with `cargo update -p typetag_impl` = note: this warning originates in the attribute macro `typetag::serde` (in Nightly builds, run with -Z macro-backtrace for more info) warning: non-local `impl` definition, they should be avoided as they go against expectation --> tests/test.rs:71:5 | 71 | #[typetag::serde(tag = "type")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: move this `impl` block outside the of the current constant `_Trait_registry` = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <rust-lang/rust#120363> = note: the attribute macro `typetag::serde` may come from an old version of the `typetag_impl` crate, try updating your dependency with `cargo update -p typetag_impl` = note: this warning originates in the attribute macro `typetag::serde` (in Nightly builds, run with -Z macro-backtrace for more info) warning: non-local `impl` definition, they should be avoided as they go against expectation --> tests/test.rs:124:5 | 124 | #[typetag::serde(tag = "type", content = "content")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: move this `impl` block outside the of the current constant `_Trait_registry` = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <rust-lang/rust#120363> = note: the attribute macro `typetag::serde` may come from an old version of the `typetag_impl` crate, try updating your dependency with `cargo update -p typetag_impl` = note: this warning originates in the attribute macro `typetag::serde` (in Nightly builds, run with -Z macro-backtrace for more info) warning: non-local `impl` definition, they should be avoided as they go against expectation --> tests/test.rs:192:5 | 192 | #[typetag::serde] | ^^^^^^^^^^^^^^^^^ | = help: move this `impl` block outside the of the current constant `_Trait_registry` = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <rust-lang/rust#120363> = note: the attribute macro `typetag::serde` may come from an old version of the `typetag_impl` crate, try updating your dependency with `cargo update -p typetag_impl` = note: this warning originates in the attribute macro `typetag::serde` (in Nightly builds, run with -Z macro-backtrace for more info) warning: non-local `impl` definition, they should be avoided as they go against expectation --> tests/test.rs:278:5 | 278 | #[typetag::serde(tag = "type", default_variant = "A")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: move this `impl` block outside the of the current constant `_Trait_registry` = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <rust-lang/rust#120363> = note: the attribute macro `typetag::serde` may come from an old version of the `typetag_impl` crate, try updating your dependency with `cargo update -p typetag_impl` = note: this warning originates in the attribute macro `typetag::serde` (in Nightly builds, run with -Z macro-backtrace for more info) warning: non-local `impl` definition, they should be avoided as they go against expectation --> tests/test.rs:322:5 | 322 | #[typetag::serde(tag = "type", content = "content", default_variant = "A")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: move this `impl` block outside the of the current constant `_Trait_registry` = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <rust-lang/rust#120363> = note: the attribute macro `typetag::serde` may come from an old version of the `typetag_impl` crate, try updating your dependency with `cargo update -p typetag_impl` = note: this warning originates in the attribute macro `typetag::serde` (in Nightly builds, run with -Z macro-backtrace for more info) warning: non-local `impl` definition, they should be avoided as they go against expectation --> tests/test.rs:366:5 | 366 | #[typetag::serde(tag = "type", content = "content", deny_unknown_fields)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: move this `impl` block outside the of the current constant `_Trait_registry` = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <rust-lang/rust#120363> = note: the attribute macro `typetag::serde` may come from an old version of the `typetag_impl` crate, try updating your dependency with `cargo update -p typetag_impl` = note: this warning originates in the attribute macro `typetag::serde` (in Nightly builds, run with -Z macro-backtrace for more info) warning: non-local `impl` definition, they should be avoided as they go against expectation --> tests/test.rs:393:5 | 393 | #[typetag::serde] | ^^^^^^^^^^^^^^^^^ | = help: move this `impl` block outside the of the current constant `_Neither_registry` = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <rust-lang/rust#120363> = note: the attribute macro `typetag::serde` may come from an old version of the `typetag_impl` crate, try updating your dependency with `cargo update -p typetag_impl` = note: this warning originates in the attribute macro `typetag::serde` (in Nightly builds, run with -Z macro-backtrace for more info) warning: non-local `impl` definition, they should be avoided as they go against expectation --> tests/test.rs:396:5 | 396 | #[typetag::serde] | ^^^^^^^^^^^^^^^^^ | = help: move this `impl` block outside the of the current constant `_Sendable_registry` = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <rust-lang/rust#120363> = note: the attribute macro `typetag::serde` may come from an old version of the `typetag_impl` crate, try updating your dependency with `cargo update -p typetag_impl` = note: this warning originates in the attribute macro `typetag::serde` (in Nightly builds, run with -Z macro-backtrace for more info) warning: non-local `impl` definition, they should be avoided as they go against expectation --> tests/test.rs:399:5 | 399 | #[typetag::serde] | ^^^^^^^^^^^^^^^^^ | = help: move this `impl` block outside the of the current constant `_Syncable_registry` = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <rust-lang/rust#120363> = note: the attribute macro `typetag::serde` may come from an old version of the `typetag_impl` crate, try updating your dependency with `cargo update -p typetag_impl` = note: this warning originates in the attribute macro `typetag::serde` (in Nightly builds, run with -Z macro-backtrace for more info) warning: non-local `impl` definition, they should be avoided as they go against expectation --> tests/test.rs:402:5 | 402 | #[typetag::serde] | ^^^^^^^^^^^^^^^^^ | = help: move this `impl` block outside the of the current constant `_Both_registry` = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <rust-lang/rust#120363> = note: the attribute macro `typetag::serde` may come from an old version of the `typetag_impl` crate, try updating your dependency with `cargo update -p typetag_impl` = note: this warning originates in the attribute macro `typetag::serde` (in Nightly builds, run with -Z macro-backtrace for more info) warning: non-local `impl` definition, they should be avoided as they go against expectation --> tests/test.rs:459:5 | 459 | #[typetag::serialize] | ^^^^^^^^^^^^^^^^^^^^^ | = help: move this `impl` block outside the of the current constant `_Generic_registry` = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <rust-lang/rust#120363> = note: the attribute macro `typetag::serialize` may come from an old version of the `typetag_impl` crate, try updating your dependency with `cargo update -p typetag_impl` = note: this warning originates in the attribute macro `typetag::serialize` (in Nightly builds, run with -Z macro-backtrace for more info) warning: non-local `impl` definition, they should be avoided as they go against expectation --> tests/test.rs:466:5 | 466 | #[typetag::serde] | ^^^^^^^^^^^^^^^^^ | = help: move this `impl` block outside the of the current constant `_Trait_registry` = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <rust-lang/rust#120363> = note: the attribute macro `typetag::serde` may come from an old version of the `typetag_impl` crate, try updating your dependency with `cargo update -p typetag_impl` = note: this warning originates in the attribute macro `typetag::serde` (in Nightly builds, run with -Z macro-backtrace for more info) warning: non-local `impl` definition, they should be avoided as they go against expectation --> tests/test.rs:483:5 | 483 | #[typetag::serde] | ^^^^^^^^^^^^^^^^^ | = help: move this `impl` block outside the of the current constant `_Base_registry` = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <rust-lang/rust#120363> = note: the attribute macro `typetag::serde` may come from an old version of the `typetag_impl` crate, try updating your dependency with `cargo update -p typetag_impl` = note: this warning originates in the attribute macro `typetag::serde` (in Nightly builds, run with -Z macro-backtrace for more info) warning: non-local `impl` definition, they should be avoided as they go against expectation --> tests/test.rs:492:5 | 492 | #[typetag::serde] | ^^^^^^^^^^^^^^^^^ | = help: move this `impl` block outside the of the current constant `_Derived_registry` = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <rust-lang/rust#120363> = note: the attribute macro `typetag::serde` may come from an old version of the `typetag_impl` crate, try updating your dependency with `cargo update -p typetag_impl` = note: this warning originates in the attribute macro `typetag::serde` (in Nightly builds, run with -Z macro-backtrace for more info)
- Loading branch information