diff options
author | Joel Galenson <jgalenson@google.com> | 2021-08-10 16:17:34 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-08-10 16:17:34 +0000 |
commit | a396b3c5e6c3bbc056242b5454e41f873efe2381 (patch) | |
tree | 287e9d974d311e7159105612b9d1b894ca542296 | |
parent | 238ff1d1f2d8b2544b58da981861dd9fe48a5bc1 (diff) | |
parent | 9dc2b8cd8cb114dce1b89c5de2da1511cc09a5fb (diff) | |
download | thiserror-impl-a396b3c5e6c3bbc056242b5454e41f873efe2381.tar.gz |
Upgrade rust/crates/thiserror-impl to 1.0.26 am: 87fb8e3f69 am: 9dc2b8cd8c
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/thiserror-impl/+/1791039
Change-Id: Ib39ffe873ab93c5d8df6c4218d85e9c0701dcc00
-rw-r--r-- | .cargo_vcs_info.json | 2 | ||||
-rw-r--r-- | Android.bp | 4 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | Cargo.toml.orig | 2 | ||||
-rw-r--r-- | METADATA | 8 | ||||
-rw-r--r-- | src/expand.rs | 14 | ||||
-rw-r--r-- | src/prop.rs | 10 | ||||
-rw-r--r-- | 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" } } @@ -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" @@ -13,7 +13,7 @@ [package] edition = "2018" name = "thiserror-impl" -version = "1.0.25" +version = "1.0.26" authors = ["David Tolnay <dtolnay@gmail.com>"] 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 <dtolnay@gmail.com>"] edition = "2018" license = "MIT OR Apache-2.0" @@ -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", |