diff --git a/compatibility-tests/provider-api/src/lib.rs b/compatibility-tests/provider-api/src/lib.rs index 2f4ede4..9fa4568 100644 --- a/compatibility-tests/provider-api/src/lib.rs +++ b/compatibility-tests/provider-api/src/lib.rs @@ -563,12 +563,12 @@ mod doctests { user_id: UserId, }, - Logout { + _Logout { #[snafu(provide)] user_id: UserId, }, - NetworkUnreachable { + _NetworkUnreachable { source: std::io::Error, }, } diff --git a/tests/backtrace.rs b/tests/backtrace.rs index b0fa7fe..25f3e5b 100644 --- a/tests/backtrace.rs +++ b/tests/backtrace.rs @@ -5,17 +5,17 @@ type AnotherError = Box; #[derive(Debug, Snafu)] enum Error { #[snafu(display("Invalid user {user_id}:\n{backtrace}"))] - InvalidUser { + _InvalidUser { user_id: i32, backtrace: Backtrace, }, - WithSource { + _WithSource { source: AnotherError, backtrace: Backtrace, }, - WithSourceAndOtherInfo { + _WithSourceAndOtherInfo { user_id: i32, source: AnotherError, backtrace: Backtrace, diff --git a/tests/display-shorthand.rs b/tests/display-shorthand.rs index 6f2555a..c1979d2 100644 --- a/tests/display-shorthand.rs +++ b/tests/display-shorthand.rs @@ -45,7 +45,7 @@ fn supports_shorthand_formatting() { #[test] fn supports_positional_and_shorthand_formatting() { - let error = OnlyShorthandArgumentsSnafu { + let error = PositionalAndShorthandArgumentsSnafu { id: 42, name: "Anna", } diff --git a/tests/doc_comment.rs b/tests/doc_comment.rs index 022a197..9e76333 100644 --- a/tests/doc_comment.rs +++ b/tests/doc_comment.rs @@ -13,7 +13,7 @@ enum Error { Stronger { stronger: &'static str }, #[doc(hidden)] - Hidden, + _Hidden, } #[test] diff --git a/tests/error_chain.rs b/tests/error_chain.rs index d50c102..0e58bc1 100644 --- a/tests/error_chain.rs +++ b/tests/error_chain.rs @@ -6,7 +6,7 @@ enum LeafError { #[snafu(display("User ID {user_id} is invalid"))] InvalidUser { user_id: i32 }, #[snafu(display("no user available"))] - MissingUser, + _MissingUser, } #[derive(Debug, Clone, Snafu, PartialEq)] diff --git a/tests/generics.rs b/tests/generics.rs index 6475cc6..2d7356d 100644 --- a/tests/generics.rs +++ b/tests/generics.rs @@ -61,7 +61,7 @@ mod bounds { #[derive(Debug, Snafu)] enum Error { #[snafu(display("Boom: {value}"))] - Boom { value: T }, + _Boom { value: T }, #[snafu(whatever, display("{message}"))] Whatever { @@ -94,7 +94,7 @@ mod bounds { T: Display, { #[snafu(display("Boom: {value}"))] - Boom { value: T }, + _Boom { value: T }, #[snafu(whatever, display("{message}"))] Whatever { diff --git a/tests/generics_with_default.rs b/tests/generics_with_default.rs index 67f10ee..51e6f80 100644 --- a/tests/generics_with_default.rs +++ b/tests/generics_with_default.rs @@ -15,14 +15,16 @@ mod default_with_lifetime { S: std::error::Error + AsErrorSource, { #[snafu(display("Boom: {value}"))] - Boom { + _Boom { value: T, name: &'a str, }, - WithSource { + + _WithSource { source: S, }, - Empty, + + _Empty, } #[test] diff --git a/tests/name-conflicts.rs b/tests/name-conflicts.rs index 40acc9c..fb2049b 100644 --- a/tests/name-conflicts.rs +++ b/tests/name-conflicts.rs @@ -7,27 +7,27 @@ mod std {} mod snafu {} #[derive(Debug, Snafu)] -enum VariantNamedNone { +enum _VariantNamedNone { #[snafu(context(suffix(false)))] None, } #[derive(Debug, Snafu)] -enum VariantNamedSome { +enum _VariantNamedSome { Some { value: T }, } #[derive(Debug, Snafu)] -enum VariantNamedOk { +enum _VariantNamedOk { Ok { value: T }, } #[derive(Debug, Snafu)] -enum VariantNamedErr { +enum _VariantNamedErr { Err { value: T }, } -fn _using_ensure() -> Result { +fn _using_ensure() -> Result { ensure!(false, None); Ok(0) } diff --git a/tests/no_context.rs b/tests/no_context.rs index 45f962d..346c3d4 100644 --- a/tests/no_context.rs +++ b/tests/no_context.rs @@ -2,12 +2,12 @@ use snafu::prelude::*; #[derive(Debug, Snafu)] enum AlphaError { - AlphaDummy, + _AlphaDummy, } #[derive(Debug, Snafu)] enum BetaError { - BetaDummy, + _BetaDummy, } #[derive(Debug, Snafu)] @@ -67,7 +67,7 @@ mod with_bounds { #[derive(Debug, Snafu)] enum GenericError { - Something { things: T, other: U }, + _Something { things: T, other: U }, } #[derive(Debug, Snafu)] diff --git a/tests/send_between_threads.rs b/tests/send_between_threads.rs index 45f1a1b..1bce7af 100644 --- a/tests/send_between_threads.rs +++ b/tests/send_between_threads.rs @@ -11,7 +11,7 @@ enum InnerError { #[derive(Debug, Snafu)] enum Error { - Leaf { + _Leaf { name: String, }, @@ -19,15 +19,15 @@ enum Error { source: InnerError, }, - BoxedWrapper { + _BoxedWrapper { source: Box, }, - BoxedTraitObjectSend { + _BoxedTraitObjectSend { source: Box, }, - BoxedTraitObjectSendSync { + _BoxedTraitObjectSendSync { source: Box, }, } diff --git a/tests/source_attributes.rs b/tests/source_attributes.rs index c3d1e14..a6dd30f 100644 --- a/tests/source_attributes.rs +++ b/tests/source_attributes.rs @@ -2,7 +2,7 @@ use snafu::prelude::*; #[derive(Debug, Snafu)] enum InnerError { - Boom, + _Boom, } fn inner() -> Result<(), InnerError> { diff --git a/tests/structs/single_use_lifetimes.rs b/tests/structs/single_use_lifetimes.rs index 824e660..5cca90a 100644 --- a/tests/structs/single_use_lifetimes.rs +++ b/tests/structs/single_use_lifetimes.rs @@ -5,7 +5,7 @@ use snafu::prelude::*; #[test] fn an_error_with_generic_lifetimes_does_not_trigger_the_lint() { #[derive(Debug, Snafu)] - struct Error<'id> { + struct _Error<'id> { to: &'id u32, } } diff --git a/tests/transparent.rs b/tests/transparent.rs index 72235f4..9d6604a 100644 --- a/tests/transparent.rs +++ b/tests/transparent.rs @@ -74,7 +74,7 @@ mod with_bounds { #[derive(Debug, Snafu)] enum GenericError { - Something { things: T, other: U }, + _Something { things: T, other: U }, } #[derive(Debug, Snafu)] diff --git a/tests/visibility.rs b/tests/visibility.rs index dbeeeed..5e94f47 100644 --- a/tests/visibility.rs +++ b/tests/visibility.rs @@ -10,12 +10,14 @@ mod outer { PubCrate { id: i32, }, + #[snafu(visibility(pub(in crate::outer)))] PubInPath { id: i32, }, + #[snafu(visibility)] - Private { + _Private { id: i32, }, }