serde/serde_derive_internals/lib.rs

51 lines
1.6 KiB
Rust
Raw Normal View History

2021-04-09 16:23:13 -05:00
#![doc(html_root_url = "https://docs.rs/serde_derive_internals/0.26.0")]
#![allow(unknown_lints, bare_trait_objects)]
#![deny(clippy::all, clippy::pedantic)]
// Ignored clippy lints
#![allow(
clippy::cognitive_complexity,
// clippy bug: https://github.com/rust-lang/rust-clippy/issues/7575
clippy::collapsible_match,
Ignore if_then_panic clippy lint error: only a `panic!` in `if`-then statement --> serde_derive/src/internals/ctxt.rs:58:9 | 58 | / if !thread::panicking() && self.errors.borrow().is_some() { 59 | | panic!("forgot to check for errors"); 60 | | } | |_________^ help: try: `assert!(!!thread::panicking() && self.errors.borrow().is_some(), "forgot to check for errors");` | note: the lint level is defined here --> serde_derive/src/lib.rs:18:9 | 18 | #![deny(clippy::all, clippy::pedantic)] | ^^^^^^^^^^^ = note: `#[deny(clippy::if_then_panic)]` implied by `#[deny(clippy::all)]` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_then_panic error: only a `panic!` in `if`-then statement --> serde_test/src/assert.rs:73:5 | 73 | / if ser.remaining() > 0 { 74 | | panic!("{} remaining tokens", ser.remaining()); 75 | | } | |_____^ help: try: `assert!(!ser.remaining() > 0, "{} remaining tokens", ser.remaining());` | note: the lint level is defined here --> serde_test/src/lib.rs:149:44 | 149 | #![cfg_attr(feature = "cargo-clippy", deny(clippy, clippy_pedantic))] | ^^^^^^ = note: `#[deny(clippy::if_then_panic)]` implied by `#[deny(clippy::all)]` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_then_panic error: only a `panic!` in `if`-then statement --> serde_test/src/assert.rs:126:5 | 126 | / if ser.remaining() > 0 { 127 | | panic!("{} remaining tokens", ser.remaining()); 128 | | } | |_____^ help: try: `assert!(!ser.remaining() > 0, "{} remaining tokens", ser.remaining());` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_then_panic error: only a `panic!` in `if`-then statement --> serde_test/src/assert.rs:166:5 | 166 | / if de.remaining() > 0 { 167 | | panic!("{} remaining tokens", de.remaining()); 168 | | } | |_____^ help: try: `assert!(!de.remaining() > 0, "{} remaining tokens", de.remaining());` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_then_panic error: only a `panic!` in `if`-then statement --> serde_test/src/assert.rs:180:5 | 180 | / if de.remaining() > 0 { 181 | | panic!("{} remaining tokens", de.remaining()); 182 | | } | |_____^ help: try: `assert!(!de.remaining() > 0, "{} remaining tokens", de.remaining());` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_then_panic error: only a `panic!` in `if`-then statement --> serde_test/src/assert.rs:220:5 | 220 | / if de.remaining() > 0 { 221 | | panic!("{} remaining tokens", de.remaining()); 222 | | } | |_____^ help: try: `assert!(!de.remaining() > 0, "{} remaining tokens", de.remaining());` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_then_panic error: only a `panic!` in `if`-then statement --> test_suite/tests/test_de.rs:1349:9 | 1349 | / if de.remaining() > 0 { 1350 | | panic!("{} remaining tokens", de.remaining()); 1351 | | } | |_________^ help: try: `assert!(!de.remaining() > 0, "{} remaining tokens", de.remaining());` | = note: `-D clippy::if-then-panic` implied by `-D clippy::all` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_then_panic
2021-09-29 23:27:28 -05:00
clippy::if_then_panic,
// clippy bug: https://github.com/rust-lang/rust-clippy/issues/6797
clippy::manual_map,
clippy::missing_panics_doc,
clippy::redundant_field_names,
clippy::result_unit_err,
clippy::should_implement_trait,
clippy::trivially_copy_pass_by_ref,
clippy::wildcard_in_or_patterns,
// clippy bug: https://github.com/rust-lang/rust-clippy/issues/5704
clippy::unnested_or_patterns,
2018-04-13 00:58:24 -05:00
)]
// Ignored clippy_pedantic lints
#![allow(
clippy::doc_markdown,
clippy::enum_glob_use,
clippy::items_after_statements,
clippy::let_underscore_drop,
clippy::match_same_arms,
// clippy bug: https://github.com/rust-lang/rust-clippy/issues/6984
clippy::match_wildcard_for_single_variants,
clippy::missing_errors_doc,
Ignore some pedantic lints in serde_derive_internals from PR 1830 error: item name ends with its containing module's name --> serde_derive_internals/src/receiver.rs:11:1 | 11 | / pub fn replace_receiver(input: &mut DeriveInput) { 12 | | let self_ty = { 13 | | let ident = &input.ident; 14 | | let ty_generics = input.generics.split_for_impl().1; ... | 19 | | visitor.visit_data_mut(&mut input.data); 20 | | } | |_^ | note: the lint level is defined here --> serde_derive_internals/lib.rs:3:22 | 3 | #![deny(clippy::all, clippy::pedantic)] | ^^^^^^^^^^^^^^^^ = note: `#[deny(clippy::module_name_repetitions)]` implied by `#[deny(clippy::pedantic)]` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions error: binding's name is too similar to existing binding --> serde_derive_internals/src/receiver.rs:31:29 | 31 | fn self_to_qself(&self, qself: &mut Option<QSelf>, path: &mut Path) { | ^^^^^ | note: the lint level is defined here --> serde_derive_internals/lib.rs:3:22 | 3 | #![deny(clippy::all, clippy::pedantic)] | ^^^^^^^^^^^^^^^^ = note: `#[deny(clippy::similar_names)]` implied by `#[deny(clippy::pedantic)]` note: existing binding defined here --> serde_derive_internals/src/receiver.rs:31:23 | 31 | fn self_to_qself(&self, qself: &mut Option<QSelf>, path: &mut Path) { | ^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#similar_names error: unused `self` argument --> serde_derive_internals/src/receiver.rs:286:24 | 286 | fn visit_macro_mut(&mut self, _mac: &mut Macro) {} | ^^^^^^^^^ | note: the lint level is defined here --> serde_derive_internals/lib.rs:3:22 | 3 | #![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
2021-01-25 02:02:55 -06:00
clippy::module_name_repetitions,
clippy::must_use_candidate,
Ignore some pedantic lints in serde_derive_internals from PR 1830 error: item name ends with its containing module's name --> serde_derive_internals/src/receiver.rs:11:1 | 11 | / pub fn replace_receiver(input: &mut DeriveInput) { 12 | | let self_ty = { 13 | | let ident = &input.ident; 14 | | let ty_generics = input.generics.split_for_impl().1; ... | 19 | | visitor.visit_data_mut(&mut input.data); 20 | | } | |_^ | note: the lint level is defined here --> serde_derive_internals/lib.rs:3:22 | 3 | #![deny(clippy::all, clippy::pedantic)] | ^^^^^^^^^^^^^^^^ = note: `#[deny(clippy::module_name_repetitions)]` implied by `#[deny(clippy::pedantic)]` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions error: binding's name is too similar to existing binding --> serde_derive_internals/src/receiver.rs:31:29 | 31 | fn self_to_qself(&self, qself: &mut Option<QSelf>, path: &mut Path) { | ^^^^^ | note: the lint level is defined here --> serde_derive_internals/lib.rs:3:22 | 3 | #![deny(clippy::all, clippy::pedantic)] | ^^^^^^^^^^^^^^^^ = note: `#[deny(clippy::similar_names)]` implied by `#[deny(clippy::pedantic)]` note: existing binding defined here --> serde_derive_internals/src/receiver.rs:31:23 | 31 | fn self_to_qself(&self, qself: &mut Option<QSelf>, path: &mut Path) { | ^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#similar_names error: unused `self` argument --> serde_derive_internals/src/receiver.rs:286:24 | 286 | fn visit_macro_mut(&mut self, _mac: &mut Macro) {} | ^^^^^^^^^ | note: the lint level is defined here --> serde_derive_internals/lib.rs:3:22 | 3 | #![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
2021-01-25 02:02:55 -06:00
clippy::similar_names,
clippy::struct_excessive_bools,
clippy::too_many_lines,
Ignore some pedantic lints in serde_derive_internals from PR 1830 error: item name ends with its containing module's name --> serde_derive_internals/src/receiver.rs:11:1 | 11 | / pub fn replace_receiver(input: &mut DeriveInput) { 12 | | let self_ty = { 13 | | let ident = &input.ident; 14 | | let ty_generics = input.generics.split_for_impl().1; ... | 19 | | visitor.visit_data_mut(&mut input.data); 20 | | } | |_^ | note: the lint level is defined here --> serde_derive_internals/lib.rs:3:22 | 3 | #![deny(clippy::all, clippy::pedantic)] | ^^^^^^^^^^^^^^^^ = note: `#[deny(clippy::module_name_repetitions)]` implied by `#[deny(clippy::pedantic)]` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions error: binding's name is too similar to existing binding --> serde_derive_internals/src/receiver.rs:31:29 | 31 | fn self_to_qself(&self, qself: &mut Option<QSelf>, path: &mut Path) { | ^^^^^ | note: the lint level is defined here --> serde_derive_internals/lib.rs:3:22 | 3 | #![deny(clippy::all, clippy::pedantic)] | ^^^^^^^^^^^^^^^^ = note: `#[deny(clippy::similar_names)]` implied by `#[deny(clippy::pedantic)]` note: existing binding defined here --> serde_derive_internals/src/receiver.rs:31:23 | 31 | fn self_to_qself(&self, qself: &mut Option<QSelf>, path: &mut Path) { | ^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#similar_names error: unused `self` argument --> serde_derive_internals/src/receiver.rs:286:24 | 286 | fn visit_macro_mut(&mut self, _mac: &mut Macro) {} | ^^^^^^^^^ | note: the lint level is defined here --> serde_derive_internals/lib.rs:3:22 | 3 | #![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
2021-01-25 02:02:55 -06:00
clippy::unused_self,
clippy::wildcard_imports
)]
2017-04-20 10:11:31 -05:00
2017-04-02 23:42:07 -05:00
#[macro_use]
2018-01-08 23:49:09 -06:00
extern crate syn;
2018-01-09 22:34:29 -06:00
extern crate proc_macro2;
extern crate quote;
2018-01-09 22:34:29 -06:00
#[cfg_attr(serde_build_from_git, path = "../serde_derive/src/internals/mod.rs")]
#[cfg_attr(not(serde_build_from_git), path = "src/mod.rs")]
mod internals;
pub use internals::*;