Unlike expr macros, macros in type position in a derive input are rare
enough that it's not worth supporting for an issue that has such an easy
workaround (just replace `Self` in the macro input with your type name).
This usage is fine. It's mirroring trait signatures in syn::visit::Visit.
error: unused `self` argument
--> serde_derive/src/bound.rs:241:24
|
241 | fn visit_macro(&mut self, _mac: &'ast syn::Macro) {}
| ^^^^^^^^^
|
note: the lint level is defined here
--> serde_derive/src/lib.rs:18:22
|
18 | #![deny(clippy::all, clippy::pedantic)]
| ^^^^^^^^^^^^^^^^
= note: `#[deny(clippy::unused_self)]` implied by `#[deny(clippy::pedantic)]`
= help: consider refactoring to a associated function
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_self
The builtin visitor is fairly expensive to compile (3700 lines of code),
particularly if something else in the dependency graph also enables
syn/full. For the usage in serde_derive, it turns out to be easy to
replace.
The BorrowedDeserializer was added in #1917, but only makes sense for
&str and &[u8], not for u64 which also needs to be have an
IdentifierDeserializer impl.
Both of these modules are doc(hidden) and commented "Not public API",
but incorrect downstream code sometimes still references them. Naming
the module __private will make it more likely to be noticed in code
review.
error: use `std::ptr::eq` when comparing raw pointers
--> serde_derive/src/de.rs:362:12
|
362 | if field as *const Field == transparent_field as *const Field {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::eq(field, transparent_field)`
|
note: the lint level is defined here
--> serde_derive/src/lib.rs:18:9
|
18 | #![deny(clippy::all, clippy::pedantic)]
| ^^^^^^^^^^^
= note: `#[deny(clippy::ptr_eq)]` implied by `#[deny(clippy::all)]`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_eq