From 87fb8e3f69e7796f98391c8063d1b62e792b534d Mon Sep 17 00:00:00 2001 From: Joel Galenson Date: Mon, 9 Aug 2021 10:47:32 -0700 Subject: Upgrade rust/crates/thiserror-impl to 1.0.26 Test: make Change-Id: I4a3714da4edbd8ebb8551817573ef4ce827bab9a --- .cargo_vcs_info.json | 2 +- Android.bp | 4 ++-- Cargo.toml | 2 +- Cargo.toml.orig | 2 +- METADATA | 8 ++++---- src/expand.rs | 14 ++++++++++++-- src/prop.rs | 10 +++++----- src/valid.rs | 2 +- 8 files changed, 27 insertions(+), 17 deletions(-) diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json index bc886ab..16f81ed 100644 --- a/.cargo_vcs_info.json +++ b/.cargo_vcs_info.json @@ -1,5 +1,5 @@ { "git": { - "sha1": "19cb5cee4b51203f6801daa3ff0185761d0d3d4c" + "sha1": "031fea6f3b82c72be11477e7550c6ae3579e6139" } } diff --git a/Android.bp b/Android.bp index 8e0a561..41c72f0 100644 --- a/Android.bp +++ b/Android.bp @@ -52,7 +52,7 @@ rust_proc_macro { } // dependent_library ["feature_list"] -// proc-macro2-1.0.27 "default,proc-macro" +// proc-macro2-1.0.28 "default,proc-macro" // quote-1.0.9 "default,proc-macro" -// syn-1.0.73 "clone-impls,default,derive,parsing,printing,proc-macro,quote" +// syn-1.0.74 "clone-impls,default,derive,parsing,printing,proc-macro,quote" // unicode-xid-0.2.2 "default" diff --git a/Cargo.toml b/Cargo.toml index 44bc47f..2f1e842 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ [package] edition = "2018" name = "thiserror-impl" -version = "1.0.25" +version = "1.0.26" authors = ["David Tolnay "] description = "Implementation detail of the `thiserror` crate" license = "MIT OR Apache-2.0" diff --git a/Cargo.toml.orig b/Cargo.toml.orig index 1458595..39bbc3d 100644 --- a/Cargo.toml.orig +++ b/Cargo.toml.orig @@ -1,6 +1,6 @@ [package] name = "thiserror-impl" -version = "1.0.25" +version = "1.0.26" authors = ["David Tolnay "] edition = "2018" license = "MIT OR Apache-2.0" diff --git a/METADATA b/METADATA index d5fb4e5..24ef154 100644 --- a/METADATA +++ b/METADATA @@ -7,13 +7,13 @@ third_party { } url { type: ARCHIVE - value: "https://static.crates.io/crates/thiserror-impl/thiserror-impl-1.0.25.crate" + value: "https://static.crates.io/crates/thiserror-impl/thiserror-impl-1.0.26.crate" } - version: "1.0.25" + version: "1.0.26" license_type: NOTICE last_upgrade_date { year: 2021 - month: 6 - day: 21 + month: 8 + day: 9 } } diff --git a/src/expand.rs b/src/expand.rs index fa85cbb..789eee6 100644 --- a/src/expand.rs +++ b/src/expand.rs @@ -115,7 +115,11 @@ fn impl_struct(input: Struct) -> TokenStream { quote! { #[allow(unused_qualifications)] impl #impl_generics std::fmt::Display for #ty #ty_generics #where_clause { - #[allow(clippy::used_underscore_binding)] + #[allow( + // Clippy bug: https://github.com/rust-lang/rust-clippy/issues/7422 + clippy::nonstandard_macro_braces, + clippy::used_underscore_binding, + )] fn fmt(&self, __formatter: &mut std::fmt::Formatter) -> std::fmt::Result { #body } @@ -303,7 +307,13 @@ fn impl_enum(input: Enum) -> TokenStream { impl #impl_generics std::fmt::Display for #ty #ty_generics #where_clause { fn fmt(&self, __formatter: &mut std::fmt::Formatter) -> std::fmt::Result { #use_as_display - #[allow(unused_variables, deprecated, clippy::used_underscore_binding)] + #[allow( + unused_variables, + deprecated, + // Clippy bug: https://github.com/rust-lang/rust-clippy/issues/7422 + clippy::nonstandard_macro_braces, + clippy::used_underscore_binding, + )] match #void_deref self { #(#arms,)* } diff --git a/src/prop.rs b/src/prop.rs index e011848..059b74b 100644 --- a/src/prop.rs +++ b/src/prop.rs @@ -65,7 +65,7 @@ impl Field<'_> { fn from_field<'a, 'b>(fields: &'a [Field<'b>]) -> Option<&'a Field<'b>> { for field in fields { if field.attrs.from.is_some() { - return Some(&field); + return Some(field); } } None @@ -74,12 +74,12 @@ fn from_field<'a, 'b>(fields: &'a [Field<'b>]) -> Option<&'a Field<'b>> { fn source_field<'a, 'b>(fields: &'a [Field<'b>]) -> Option<&'a Field<'b>> { for field in fields { if field.attrs.from.is_some() || field.attrs.source.is_some() { - return Some(&field); + return Some(field); } } for field in fields { match &field.member { - Member::Named(ident) if ident == "source" => return Some(&field), + Member::Named(ident) if ident == "source" => return Some(field), _ => {} } } @@ -89,12 +89,12 @@ fn source_field<'a, 'b>(fields: &'a [Field<'b>]) -> Option<&'a Field<'b>> { fn backtrace_field<'a, 'b>(fields: &'a [Field<'b>]) -> Option<&'a Field<'b>> { for field in fields { if field.attrs.backtrace.is_some() { - return Some(&field); + return Some(field); } } for field in fields { if field.is_backtrace() { - return Some(&field); + return Some(field); } } None diff --git a/src/valid.rs b/src/valid.rs index 7246d0c..7657265 100644 --- a/src/valid.rs +++ b/src/valid.rs @@ -188,7 +188,7 @@ fn check_field_attrs(fields: &[Field]) -> Result<()> { } } if let Some(source_field) = source_field.or(from_field) { - if contains_non_static_lifetime(&source_field.ty) { + if contains_non_static_lifetime(source_field.ty) { return Err(Error::new_spanned( &source_field.original.ty, "non-static lifetimes are not allowed in the source of an error, because std::error::Error requires the source is dyn Error + 'static", -- cgit v1.2.3