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

Resolve non_local_definitions warnings in rustc 1.78-nightly #51

Merged
merged 2 commits into from
Feb 26, 2024
Merged

Conversation

dtolnay
Copy link
Owner

@dtolnay dtolnay commented Feb 26, 2024

warning: non-local `impl` definition, they should be avoided as they go against expectation
  --> src/de/impls.rs:21:9
   |
21 | /         impl Visitor for Place<()> {
22 | |             fn null(&mut self) -> Result<()> {
23 | |                 self.out = Some(());
24 | |                 Ok(())
25 | |             }
26 | |         }
   | |_________^
   |
   = help: move this `impl` block outside the of the current associated function `begin`
   = 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 <https://github.com/rust-lang/rust/issues/120363>
   = note: `#[warn(non_local_definitions)]` on by default

Fixes a non_local_definitions warning in the derived code.

    warning: non-local `impl` definition, they should be avoided as they go against expectation
     --> tests/test_derive.rs:5:28
      |
    5 | #[derive(PartialEq, Debug, Serialize, Deserialize)]
      |                            ^^^^^^^^^
      |
      = help: move this `impl` block outside the of the current constant `_IMPL_MINISERIALIZE_FOR_Tag`
      = 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 derive macro `Serialize` may come from an old version of the `mini_internal` crate, try updating your dependency with `cargo update -p mini_internal`
      = 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)
Fixes warning about non_local_definitions.

    warning: non-local `impl` definition, they should be avoided as they go against expectation
      --> src/de/impls.rs:21:9
       |
    21 | /         impl Visitor for Place<()> {
    22 | |             fn null(&mut self) -> Result<()> {
    23 | |                 self.out = Some(());
    24 | |                 Ok(())
    25 | |             }
    26 | |         }
       | |_________^
       |
       = help: move this `impl` block outside the of the current associated function `begin`
       = 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

    warning: non-local `impl` definition, they should be avoided as they go against expectation
      --> src/de/impls.rs:33:9
       |
    33 | /         impl Visitor for Place<bool> {
    34 | |             fn boolean(&mut self, b: bool) -> Result<()> {
    35 | |                 self.out = Some(b);
    36 | |                 Ok(())
    37 | |             }
    38 | |         }
       | |_________^
       |
       = help: move this `impl` block outside the of the current associated function `begin`
       = 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>

    warning: non-local `impl` definition, they should be avoided as they go against expectation
      --> src/de/impls.rs:45:9
       |
    45 | /         impl Visitor for Place<String> {
    46 | |             fn string(&mut self, s: &str) -> Result<()> {
    47 | |                 self.out = Some(s.to_owned());
    48 | |                 Ok(())
    49 | |             }
    50 | |         }
       | |_________^
       |
       = help: move this `impl` block outside the of the current associated function `begin`
       = 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>

    warning: non-local `impl` definition, they should be avoided as they go against expectation
      --> src/de/impls.rs:59:17
       |
    59 | /                 impl Visitor for Place<$ty> {
    60 | |                     fn negative(&mut self, n: i64) -> Result<()> {
    61 | |                         if n >= $ty::min_value() as i64 {
    62 | |                             self.out = Some(n as $ty);
    ...  |
    76 | |                     }
    77 | |                 }
       | |_________________^
    ...
    83 |   signed!(i8);
       |   ----------- in this macro invocation
       |
       = help: move this `impl` block outside the of the current associated function `begin`
       = 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: this warning originates in the macro `signed` (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
      --> src/de/impls.rs:59:17
       |
    59 | /                 impl Visitor for Place<$ty> {
    60 | |                     fn negative(&mut self, n: i64) -> Result<()> {
    61 | |                         if n >= $ty::min_value() as i64 {
    62 | |                             self.out = Some(n as $ty);
    ...  |
    76 | |                     }
    77 | |                 }
       | |_________________^
    ...
    84 |   signed!(i16);
       |   ------------ in this macro invocation
       |
       = help: move this `impl` block outside the of the current associated function `begin`
       = 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: this warning originates in the macro `signed` (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
      --> src/de/impls.rs:59:17
       |
    59 | /                 impl Visitor for Place<$ty> {
    60 | |                     fn negative(&mut self, n: i64) -> Result<()> {
    61 | |                         if n >= $ty::min_value() as i64 {
    62 | |                             self.out = Some(n as $ty);
    ...  |
    76 | |                     }
    77 | |                 }
       | |_________________^
    ...
    85 |   signed!(i32);
       |   ------------ in this macro invocation
       |
       = help: move this `impl` block outside the of the current associated function `begin`
       = 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: this warning originates in the macro `signed` (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
      --> src/de/impls.rs:59:17
       |
    59 | /                 impl Visitor for Place<$ty> {
    60 | |                     fn negative(&mut self, n: i64) -> Result<()> {
    61 | |                         if n >= $ty::min_value() as i64 {
    62 | |                             self.out = Some(n as $ty);
    ...  |
    76 | |                     }
    77 | |                 }
       | |_________________^
    ...
    86 |   signed!(i64);
       |   ------------ in this macro invocation
       |
       = help: move this `impl` block outside the of the current associated function `begin`
       = 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: this warning originates in the macro `signed` (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
      --> src/de/impls.rs:59:17
       |
    59 | /                 impl Visitor for Place<$ty> {
    60 | |                     fn negative(&mut self, n: i64) -> Result<()> {
    61 | |                         if n >= $ty::min_value() as i64 {
    62 | |                             self.out = Some(n as $ty);
    ...  |
    76 | |                     }
    77 | |                 }
       | |_________________^
    ...
    87 |   signed!(isize);
       |   -------------- in this macro invocation
       |
       = help: move this `impl` block outside the of the current associated function `begin`
       = 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: this warning originates in the macro `signed` (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
       --> src/de/impls.rs:93:17
        |
    93  | /                 impl Visitor for Place<$ty> {
    94  | |                     fn nonnegative(&mut self, n: u64) -> Result<()> {
    95  | |                         if n <= $ty::max_value() as u64 {
    96  | |                             self.out = Some(n as $ty);
    ...   |
    101 | |                     }
    102 | |                 }
        | |_________________^
    ...
    108 |   unsigned!(u8);
        |   ------------- in this macro invocation
        |
        = help: move this `impl` block outside the of the current associated function `begin`
        = 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: this warning originates in the macro `unsigned` (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
       --> src/de/impls.rs:93:17
        |
    93  | /                 impl Visitor for Place<$ty> {
    94  | |                     fn nonnegative(&mut self, n: u64) -> Result<()> {
    95  | |                         if n <= $ty::max_value() as u64 {
    96  | |                             self.out = Some(n as $ty);
    ...   |
    101 | |                     }
    102 | |                 }
        | |_________________^
    ...
    109 |   unsigned!(u16);
        |   -------------- in this macro invocation
        |
        = help: move this `impl` block outside the of the current associated function `begin`
        = 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: this warning originates in the macro `unsigned` (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
       --> src/de/impls.rs:93:17
        |
    93  | /                 impl Visitor for Place<$ty> {
    94  | |                     fn nonnegative(&mut self, n: u64) -> Result<()> {
    95  | |                         if n <= $ty::max_value() as u64 {
    96  | |                             self.out = Some(n as $ty);
    ...   |
    101 | |                     }
    102 | |                 }
        | |_________________^
    ...
    110 |   unsigned!(u32);
        |   -------------- in this macro invocation
        |
        = help: move this `impl` block outside the of the current associated function `begin`
        = 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: this warning originates in the macro `unsigned` (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
       --> src/de/impls.rs:93:17
        |
    93  | /                 impl Visitor for Place<$ty> {
    94  | |                     fn nonnegative(&mut self, n: u64) -> Result<()> {
    95  | |                         if n <= $ty::max_value() as u64 {
    96  | |                             self.out = Some(n as $ty);
    ...   |
    101 | |                     }
    102 | |                 }
        | |_________________^
    ...
    111 |   unsigned!(u64);
        |   -------------- in this macro invocation
        |
        = help: move this `impl` block outside the of the current associated function `begin`
        = 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: this warning originates in the macro `unsigned` (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
       --> src/de/impls.rs:93:17
        |
    93  | /                 impl Visitor for Place<$ty> {
    94  | |                     fn nonnegative(&mut self, n: u64) -> Result<()> {
    95  | |                         if n <= $ty::max_value() as u64 {
    96  | |                             self.out = Some(n as $ty);
    ...   |
    101 | |                     }
    102 | |                 }
        | |_________________^
    ...
    112 |   unsigned!(usize);
        |   ---------------- in this macro invocation
        |
        = help: move this `impl` block outside the of the current associated function `begin`
        = 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: this warning originates in the macro `unsigned` (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
       --> src/de/impls.rs:118:17
        |
    118 | /                 impl Visitor for Place<$ty> {
    119 | |                     fn negative(&mut self, n: i64) -> Result<()> {
    120 | |                         self.out = Some(n as $ty);
    121 | |                         Ok(())
    ...   |
    132 | |                     }
    133 | |                 }
        | |_________________^
    ...
    139 |   float!(f32);
        |   ----------- in this macro invocation
        |
        = help: move this `impl` block outside the of the current associated function `begin`
        = 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: this warning originates in the macro `float` (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
       --> src/de/impls.rs:118:17
        |
    118 | /                 impl Visitor for Place<$ty> {
    119 | |                     fn negative(&mut self, n: i64) -> Result<()> {
    120 | |                         self.out = Some(n as $ty);
    121 | |                         Ok(())
    ...   |
    132 | |                     }
    133 | |                 }
        | |_________________^
    ...
    140 |   float!(f64);
        |   ----------- in this macro invocation
        |
        = help: move this `impl` block outside the of the current associated function `begin`
        = 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: this warning originates in the macro `float` (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
       --> src/de/impls.rs:144:9
        |
    144 | /         impl<T: Deserialize> Visitor for Place<Box<T>> {
    145 | |             fn null(&mut self) -> Result<()> {
    146 | |                 let mut out = None;
    147 | |                 Deserialize::begin(&mut out).null()?;
    ...   |
    205 | |             }
    206 | |         }
        | |_________^
        |
        = help: move this `impl` block outside the of the current associated function `begin`
        = 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>

    warning: non-local `impl` definition, they should be avoided as they go against expectation
       --> src/de/impls.rs:270:9
        |
    270 | /         impl<T: Deserialize> Visitor for Place<Option<T>> {
    271 | |             fn null(&mut self) -> Result<()> {
    272 | |                 self.out = Some(None);
    273 | |                 Ok(())
    ...   |
    309 | |             }
    310 | |         }
        | |_________^
        |
        = help: move this `impl` block outside the of the current associated function `begin`
        = 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>

    warning: non-local `impl` definition, they should be avoided as they go against expectation
       --> src/de/impls.rs:318:9
        |
    318 | /         impl<A: Deserialize, B: Deserialize> Visitor for Place<(A, B)> {
    319 | |             fn seq(&mut self) -> Result<Box<dyn Seq + '_>> {
    320 | |                 Ok(Box::new(TupleBuilder {
    321 | |                     out: &mut self.out,
    ...   |
    324 | |             }
    325 | |         }
        | |_________^
        |
        = help: move this `impl` block outside the of the current associated function `begin`
        = 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>

    warning: non-local `impl` definition, they should be avoided as they go against expectation
       --> src/de/impls.rs:359:9
        |
    359 | /         impl<T: Deserialize> Visitor for Place<Vec<T>> {
    360 | |             fn seq(&mut self) -> Result<Box<dyn Seq + '_>> {
    361 | |                 Ok(Box::new(VecBuilder {
    362 | |                     out: &mut self.out,
    ...   |
    366 | |             }
    367 | |         }
        | |_________^
        |
        = help: move this `impl` block outside the of the current associated function `begin`
        = 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>

    warning: non-local `impl` definition, they should be avoided as they go against expectation
       --> src/de/impls.rs:402:9
        |
    402 | /         impl<T: Deserialize, const N: usize> Visitor for Place<[T; N]> {
    403 | |             fn seq(&mut self) -> Result<Box<dyn Seq + '_>> {
    404 | |                 Ok(Box::new(ArrayBuilder {
    405 | |                     out: &mut self.out,
    ...   |
    410 | |             }
    411 | |         }
        | |_________^
        |
        = help: move this `impl` block outside the of the current associated function `begin`
        = 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>

    warning: non-local `impl` definition, they should be avoided as they go against expectation
       --> src/de/impls.rs:472:9
        |
    472 | /         impl<K, V, H> Visitor for Place<HashMap<K, V, H>>
    473 | |         where
    474 | |             K: FromStr + Hash + Eq,
    475 | |             V: Deserialize,
    ...   |
    485 | |             }
    486 | |         }
        | |_________^
        |
        = help: move this `impl` block outside the of the current associated function `begin`
        = 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>

    warning: non-local `impl` definition, they should be avoided as they go against expectation
       --> src/de/impls.rs:532:9
        |
    532 | /         impl<K: FromStr + Ord, V: Deserialize> Visitor for Place<BTreeMap<K, V>> {
    533 | |             fn map(&mut self) -> Result<Box<dyn Map + '_>> {
    534 | |                 Ok(Box::new(MapBuilder {
    535 | |                     out: &mut self.out,
    ...   |
    540 | |             }
    541 | |         }
        | |_________^
        |
        = help: move this `impl` block outside the of the current associated function `begin`
        = 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>

    warning: non-local `impl` definition, they should be avoided as they go against expectation
       --> src/json/value.rs:75:9
        |
    75  | /         impl Visitor for Place<Value> {
    76  | |             fn null(&mut self) -> Result<()> {
    77  | |                 self.out = Some(Value::Null);
    78  | |                 Ok(())
    ...   |
    121 | |             }
    122 | |         }
        | |_________^
        |
        = help: move this `impl` block outside the of the current associated function `begin`
        = 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>

    warning: non-local `impl` definition, they should be avoided as they go against expectation
      --> src/json/number.rs:37:9
       |
    37 | /         impl Visitor for Place<Number> {
    38 | |             fn negative(&mut self, n: i64) -> Result<()> {
    39 | |                 self.out = Some(Number::I64(n));
    40 | |                 Ok(())
    ...  |
    51 | |             }
    52 | |         }
       | |_________^
       |
       = help: move this `impl` block outside the of the current associated function `begin`
       = 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>

    warning: non-local `impl` definition, they should be avoided as they go against expectation
       --> src/json/array.rs:116:9
        |
    116 | /         impl Visitor for Place<Array> {
    117 | |             fn seq(&mut self) -> Result<Box<dyn Seq + '_>> {
    118 | |                 Ok(Box::new(ArrayBuilder {
    119 | |                     out: &mut self.out,
    ...   |
    123 | |             }
    124 | |         }
        | |_________^
        |
        = help: move this `impl` block outside the of the current associated function `begin`
        = 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>

    warning: non-local `impl` definition, they should be avoided as they go against expectation
       --> src/json/object.rs:119:9
        |
    119 | /         impl Visitor for Place<Object> {
    120 | |             fn map(&mut self) -> Result<Box<dyn Map + '_>> {
    121 | |                 Ok(Box::new(ObjectBuilder {
    122 | |                     out: &mut self.out,
    ...   |
    127 | |             }
    128 | |         }
        | |_________^
        |
        = help: move this `impl` block outside the of the current associated function `begin`
        = 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>
@dtolnay dtolnay merged commit 4d17186 into master Feb 26, 2024
19 checks passed
@dtolnay dtolnay deleted the local branch February 26, 2024 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant