Skip to content

Commit fedf834

Browse files
committed
Ignore non_local_definitions false positive in test
rust-lang/rust#121621 warning: non-local `impl` definition, they should be avoided as they go against expectation --> tests/test.rs:2338:5 | 2338 | / impl<'de> Deserialize<'de> for &'de RawMapKey { 2339 | | fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> 2340 | | where 2341 | | D: serde::Deserializer<'de>, ... | 2345 | | } 2346 | | } | |_____^ | = help: move this `impl` block outside the of the current function `test_raw_value_in_map_key` = 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: `#[warn(non_local_definitions)]` on by default
1 parent e1b3a6d commit fedf834

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tests/test.rs

+2
Original file line numberDiff line numberDiff line change
@@ -2335,6 +2335,8 @@ fn test_raw_value_in_map_key() {
23352335
#[repr(transparent)]
23362336
struct RawMapKey(RawValue);
23372337

2338+
#[allow(unknown_lints)]
2339+
#[allow(non_local_definitions)] // false positive: https://github.com/rust-lang/rust/issues/121621
23382340
impl<'de> Deserialize<'de> for &'de RawMapKey {
23392341
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
23402342
where

0 commit comments

Comments
 (0)