From bac25085fcea68ca30b8e19b8981fbd689f53735 Mon Sep 17 00:00:00 2001 From: Hayden Stainsby Date: Sun, 26 Nov 2023 16:34:17 +0100 Subject: [PATCH] chore: fixes for clippy changes in Rust 1.74 (#2814) With the release of Rust 1.74, there are some new or modified clippy lints that need adaption in the code. The main change was the removal of the `private_in_public`. https://rust-lang.github.io/rfcs/2145-type-privacy.html Then two more changes were required, in one case to adhere a lint and the other to allow it. When talking about what an "application" needs to do when setting up `tracing-error`, it makes sense to include `fn main()` in the doctest, even though the lint recommends against it. --- examples/examples/map-traced-error.rs | 2 +- tracing-appender/src/lib.rs | 3 ++- tracing-attributes/src/lib.rs | 3 ++- tracing-core/src/lib.rs | 3 ++- tracing-error/src/lib.rs | 4 +++- tracing-flame/src/lib.rs | 3 ++- tracing-futures/src/lib.rs | 3 ++- tracing-log/src/lib.rs | 3 ++- tracing-serde/src/lib.rs | 3 ++- tracing-subscriber/src/lib.rs | 3 ++- tracing-tower/src/lib.rs | 3 ++- tracing/src/lib.rs | 3 ++- 12 files changed, 24 insertions(+), 12 deletions(-) diff --git a/examples/examples/map-traced-error.rs b/examples/examples/map-traced-error.rs index 25bf779355..9911e762ef 100644 --- a/examples/examples/map-traced-error.rs +++ b/examples/examples/map-traced-error.rs @@ -44,7 +44,7 @@ fn do_something() -> Result<(), TracedError> { #[tracing::instrument] fn do_the_real_stuff() -> Result<(), TracedError> { - Err(InnerError).map_err(TracedError::from) + Err(TracedError::from(InnerError)) } #[derive(Debug)] diff --git a/tracing-appender/src/lib.rs b/tracing-appender/src/lib.rs index 03ce53fec0..d6e2af9e95 100644 --- a/tracing-appender/src/lib.rs +++ b/tracing-appender/src/lib.rs @@ -153,7 +153,8 @@ overflowing_literals, path_statements, patterns_in_fns_without_body, - private_in_public, + private_interfaces, + private_bounds, unconditional_recursion, unused, unused_allocation, diff --git a/tracing-attributes/src/lib.rs b/tracing-attributes/src/lib.rs index 857e0798b6..809305ca4e 100644 --- a/tracing-attributes/src/lib.rs +++ b/tracing-attributes/src/lib.rs @@ -70,7 +70,8 @@ overflowing_literals, path_statements, patterns_in_fns_without_body, - private_in_public, + private_interfaces, + private_bounds, unconditional_recursion, unused_allocation, unused_comparisons, diff --git a/tracing-core/src/lib.rs b/tracing-core/src/lib.rs index 7aafb01151..eafdba9120 100644 --- a/tracing-core/src/lib.rs +++ b/tracing-core/src/lib.rs @@ -152,7 +152,8 @@ overflowing_literals, path_statements, patterns_in_fns_without_body, - private_in_public, + private_interfaces, + private_bounds, unconditional_recursion, unused, unused_allocation, diff --git a/tracing-error/src/lib.rs b/tracing-error/src/lib.rs index 19f1d6e65e..c658f4e8c6 100644 --- a/tracing-error/src/lib.rs +++ b/tracing-error/src/lib.rs @@ -183,6 +183,7 @@ html_favicon_url = "https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/favicon.ico", issue_tracker_base_url = "/~https://github.com/tokio-rs/tracing/issues/" )] +#![allow(clippy::needless_doctest_main)] #![warn( missing_debug_implementations, missing_docs, @@ -196,7 +197,8 @@ overflowing_literals, path_statements, patterns_in_fns_without_body, - private_in_public, + private_interfaces, + private_bounds, unconditional_recursion, unused, unused_allocation, diff --git a/tracing-flame/src/lib.rs b/tracing-flame/src/lib.rs index 36d2f9c844..5ad84b582c 100644 --- a/tracing-flame/src/lib.rs +++ b/tracing-flame/src/lib.rs @@ -124,7 +124,8 @@ overflowing_literals, path_statements, patterns_in_fns_without_body, - private_in_public, + private_interfaces, + private_bounds, unconditional_recursion, unused, unused_allocation, diff --git a/tracing-futures/src/lib.rs b/tracing-futures/src/lib.rs index 0b1c810c60..dfa99b046c 100644 --- a/tracing-futures/src/lib.rs +++ b/tracing-futures/src/lib.rs @@ -89,7 +89,8 @@ overflowing_literals, path_statements, patterns_in_fns_without_body, - private_in_public, + private_interfaces, + private_bounds, unconditional_recursion, unused, unused_allocation, diff --git a/tracing-log/src/lib.rs b/tracing-log/src/lib.rs index aff6d42fe1..dbdf8e9549 100644 --- a/tracing-log/src/lib.rs +++ b/tracing-log/src/lib.rs @@ -115,7 +115,8 @@ overflowing_literals, path_statements, patterns_in_fns_without_body, - private_in_public, + private_interfaces, + private_bounds, unconditional_recursion, unused, unused_allocation, diff --git a/tracing-serde/src/lib.rs b/tracing-serde/src/lib.rs index 67535b8514..97b78d55c0 100644 --- a/tracing-serde/src/lib.rs +++ b/tracing-serde/src/lib.rs @@ -159,7 +159,8 @@ overflowing_literals, path_statements, patterns_in_fns_without_body, - private_in_public, + private_interfaces, + private_bounds, unconditional_recursion, unused, unused_allocation, diff --git a/tracing-subscriber/src/lib.rs b/tracing-subscriber/src/lib.rs index c64a40eedf..4b1ce72d82 100644 --- a/tracing-subscriber/src/lib.rs +++ b/tracing-subscriber/src/lib.rs @@ -156,7 +156,8 @@ overflowing_literals, path_statements, patterns_in_fns_without_body, - private_in_public, + private_interfaces, + private_bounds, unconditional_recursion, unused, unused_allocation, diff --git a/tracing-tower/src/lib.rs b/tracing-tower/src/lib.rs index 41ec704970..4f06044d29 100644 --- a/tracing-tower/src/lib.rs +++ b/tracing-tower/src/lib.rs @@ -17,7 +17,8 @@ overflowing_literals, path_statements, patterns_in_fns_without_body, - private_in_public, + private_interfaces, + private_bounds, unconditional_recursion, unused, unused_allocation, diff --git a/tracing/src/lib.rs b/tracing/src/lib.rs index a2fcc25a31..1467c907f2 100644 --- a/tracing/src/lib.rs +++ b/tracing/src/lib.rs @@ -948,7 +948,8 @@ overflowing_literals, path_statements, patterns_in_fns_without_body, - private_in_public, + private_interfaces, + private_bounds, unconditional_recursion, unused, unused_allocation,