aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaibo Huang <hhb@google.com>2021-02-19 11:26:42 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-02-19 11:26:42 +0000
commita93a869d81442733ef916952053442a1724107d7 (patch)
tree66ae20c1230c20544f313d586e33ace06db3cfd9
parentf0f4471d47770a2da6e658d17937275f930ece5c (diff)
parent29e2d89ed77dddaca30617d7818332fdaec8c67d (diff)
downloadthiserror-a93a869d81442733ef916952053442a1724107d7.tar.gz
Upgrade rust/crates/thiserror to 1.0.24 am: 29e2d89ed7
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/thiserror/+/1595521 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I0118adb29fe6f7f46b4a702ac2640a2e0961e76e
-rw-r--r--.cargo_vcs_info.json2
-rw-r--r--.clippy.toml1
-rw-r--r--.github/workflows/ci.yml2
-rw-r--r--Android.bp43
-rw-r--r--Cargo.toml4
-rw-r--r--Cargo.toml.orig4
-rw-r--r--METADATA10
-rw-r--r--TEST_MAPPING47
-rw-r--r--src/lib.rs2
-rw-r--r--tests/test_source.rs13
-rw-r--r--tests/ui/no-display.stderr6
-rw-r--r--tests/ui/source-enum-not-error.stderr6
-rw-r--r--tests/ui/source-struct-not-error.stderr6
13 files changed, 86 insertions, 60 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index 77f4f3f..349cbda 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,5 +1,5 @@
{
"git": {
- "sha1": "d263b4b7e4f8e3ad9558256d8f6b2ac916985f7b"
+ "sha1": "1b0a84996b9492c0dc5779127a91c930f23a259e"
}
}
diff --git a/.clippy.toml b/.clippy.toml
new file mode 100644
index 0000000..3d30690
--- /dev/null
+++ b/.clippy.toml
@@ -0,0 +1 @@
+msrv = "1.31.0"
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 03b994a..263e04c 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -39,4 +39,4 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@clippy
- - run: cargo clippy --tests -- -Dclippy::all
+ - run: cargo clippy --tests -- -Dclippy::all -Dclippy::pedantic
diff --git a/Android.bp b/Android.bp
index 839d80e..59b4982 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,40 +1,5 @@
// This file is generated by cargo2android.py --run --dependencies --device --patch=patches/Android.bp.patch.
-
-package {
- default_applicable_licenses: ["external_rust_crates_thiserror_license"],
-}
-
-// Added automatically by a large-scale-change that took the approach of
-// 'apply every license found to every target'. While this makes sure we respect
-// every license restriction, it may not be entirely correct.
-//
-// e.g. GPL in an MIT project might only apply to the contrib/ directory.
-//
-// Please consider splitting the single license below into multiple licenses,
-// taking care not to lose any license_kind information, and overriding the
-// default license using the 'licenses: [...]' property on targets as needed.
-//
-// For unused files, consider creating a 'fileGroup' with "//visibility:private"
-// to attach the license to, and including a comment whether the files may be
-// used in the current project.
-//
-// large-scale-change included anything that looked like it might be a license
-// text as a license_text. e.g. LICENSE, NOTICE, COPYING etc.
-//
-// Please consider removing redundant or irrelevant files from 'license_text:'.
-// See: http://go/android-license-faq
-license {
- name: "external_rust_crates_thiserror_license",
- visibility: [":__subpackages__"],
- license_kinds: [
- "SPDX-license-identifier-Apache-2.0",
- "SPDX-license-identifier-MIT",
- ],
- license_text: [
- "LICENSE-APACHE",
- "LICENSE-MIT",
- ],
-}
+// Do not modify this file as changes will be overridden on upgrade.
rust_library {
name: "libthiserror",
@@ -51,7 +16,7 @@ rust_library {
// dependent_library ["feature_list"]
// proc-macro2-1.0.24 "default,proc-macro"
-// quote-1.0.8 "default,proc-macro"
-// syn-1.0.56 "clone-impls,default,derive,parsing,printing,proc-macro,quote,visit"
-// thiserror-impl-1.0.23
+// quote-1.0.9 "default,proc-macro"
+// syn-1.0.60 "clone-impls,default,derive,parsing,printing,proc-macro,quote"
+// thiserror-impl-1.0.24
// unicode-xid-0.2.1 "default"
diff --git a/Cargo.toml b/Cargo.toml
index 32d201f..e3ef65a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,7 +13,7 @@
[package]
edition = "2018"
name = "thiserror"
-version = "1.0.23"
+version = "1.0.24"
authors = ["David Tolnay <dtolnay@gmail.com>"]
description = "derive(Error)"
documentation = "https://docs.rs/thiserror"
@@ -24,7 +24,7 @@ repository = "https://github.com/dtolnay/thiserror"
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
[dependencies.thiserror-impl]
-version = "=1.0.23"
+version = "=1.0.24"
[dev-dependencies.anyhow]
version = "1.0"
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index 21149d5..0517a91 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -1,6 +1,6 @@
[package]
name = "thiserror"
-version = "1.0.23"
+version = "1.0.24"
authors = ["David Tolnay <dtolnay@gmail.com>"]
edition = "2018"
license = "MIT OR Apache-2.0"
@@ -11,7 +11,7 @@ categories = ["rust-patterns"]
readme = "README.md"
[dependencies]
-thiserror-impl = { version = "=1.0.23", path = "impl" }
+thiserror-impl = { version = "=1.0.24", path = "impl" }
[dev-dependencies]
anyhow = "1.0"
diff --git a/METADATA b/METADATA
index a43522a..3b9f5d5 100644
--- a/METADATA
+++ b/METADATA
@@ -7,13 +7,13 @@ third_party {
}
url {
type: ARCHIVE
- value: "https://static.crates.io/crates/thiserror/thiserror-1.0.23.crate"
+ value: "https://static.crates.io/crates/thiserror/thiserror-1.0.24.crate"
}
- version: "1.0.23"
+ version: "1.0.24"
license_type: NOTICE
last_upgrade_date {
- year: 2020
- month: 12
- day: 29
+ year: 2021
+ month: 2
+ day: 18
}
}
diff --git a/TEST_MAPPING b/TEST_MAPPING
index 6716814..c21ac98 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -1,8 +1,53 @@
-// Generated by cargo2android.py for tests in Android.bp
+// Generated by update_crate_tests.py for tests that depend on this crate.
{
"presubmit": [
{
+ "name": "anyhow_device_test_tests_test_repr"
+ },
+ {
+ "name": "keystore2_test"
+ },
+ {
+ "name": "anyhow_device_test_tests_test_context"
+ },
+ {
"name": "libsqlite3-sys_device_test_src_lib"
+ },
+ {
+ "name": "anyhow_device_test_tests_test_downcast"
+ },
+ {
+ "name": "keystore2_crypto_test_rust"
+ },
+ {
+ "name": "anyhow_device_test_tests_test_convert"
+ },
+ {
+ "name": "anyhow_device_test_tests_test_ffi"
+ },
+ {
+ "name": "anyhow_device_test_tests_test_autotrait"
+ },
+ {
+ "name": "anyhow_device_test_tests_test_macros"
+ },
+ {
+ "name": "anyhow_device_test_tests_test_boxed"
+ },
+ {
+ "name": "anyhow_device_test_tests_test_chain"
+ },
+ {
+ "name": "anyhow_device_test_src_lib"
+ },
+ {
+ "name": "anyhow_device_test_tests_test_source"
+ },
+ {
+ "name": "anyhow_device_test_tests_test_fmt"
+ },
+ {
+ "name": "keystore2_selinux_test"
}
]
}
diff --git a/src/lib.rs b/src/lib.rs
index a520798..02941c8 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -185,6 +185,8 @@
//!
//! [`anyhow`]: https://github.com/dtolnay/anyhow
+#![allow(clippy::module_name_repetitions)]
+
mod aserror;
mod display;
diff --git a/tests/test_source.rs b/tests/test_source.rs
index 66d9dad..860e727 100644
--- a/tests/test_source.rs
+++ b/tests/test_source.rs
@@ -48,3 +48,16 @@ fn test_boxed_source() {
let error = BoxedSource { source };
error.source().unwrap().downcast_ref::<io::Error>().unwrap();
}
+
+macro_rules! error_from_macro {
+ ($($variants:tt)*) => {
+ #[derive(Error)]
+ #[derive(Debug)]
+ pub enum MacroSource {
+ $($variants)*
+ }
+ }
+}
+
+// Test that we generate impls with the proper hygiene
+error_from_macro!(#[error("Something")] Variant(#[from] io::Error));
diff --git a/tests/ui/no-display.stderr b/tests/ui/no-display.stderr
index b1a0c49..8af2452 100644
--- a/tests/ui/no-display.stderr
+++ b/tests/ui/no-display.stderr
@@ -1,12 +1,12 @@
-error[E0599]: no method named `as_display` found for reference `&NoDisplay` in the current scope
+error[E0599]: the method `as_display` exists for reference `&NoDisplay`, but its trait bounds were not satisfied
--> $DIR/no-display.rs:7:9
|
4 | struct NoDisplay;
| ----------------- doesn't satisfy `NoDisplay: std::fmt::Display`
...
7 | #[error("thread: {thread}")]
- | ^^^^^^^^^^^^^^^^^^ method not found in `&NoDisplay`
+ | ^^^^^^^^^^^^^^^^^^ method cannot be called on `&NoDisplay` due to unsatisfied trait bounds
|
- = note: the method `as_display` exists but the following trait bounds were not satisfied:
+ = note: the following trait bounds were not satisfied:
`NoDisplay: std::fmt::Display`
which is required by `&NoDisplay: DisplayAsDisplay`
diff --git a/tests/ui/source-enum-not-error.stderr b/tests/ui/source-enum-not-error.stderr
index 3dee730..2bf7aea 100644
--- a/tests/ui/source-enum-not-error.stderr
+++ b/tests/ui/source-enum-not-error.stderr
@@ -1,4 +1,4 @@
-error[E0599]: no method named `as_dyn_error` found for reference `&NotError` in the current scope
+error[E0599]: the method `as_dyn_error` exists for reference `&NotError`, but its trait bounds were not satisfied
--> $DIR/source-enum-not-error.rs:10:9
|
4 | pub struct NotError;
@@ -8,9 +8,9 @@ error[E0599]: no method named `as_dyn_error` found for reference `&NotError` in
| doesn't satisfy `NotError: std::error::Error`
...
10 | source: NotError,
- | ^^^^^^ method not found in `&NotError`
+ | ^^^^^^ method cannot be called on `&NotError` due to unsatisfied trait bounds
|
- = note: the method `as_dyn_error` exists but the following trait bounds were not satisfied:
+ = note: the following trait bounds were not satisfied:
`NotError: std::error::Error`
which is required by `NotError: AsDynError`
`&NotError: std::error::Error`
diff --git a/tests/ui/source-struct-not-error.stderr b/tests/ui/source-struct-not-error.stderr
index 0aa03dd..7a2c0fe 100644
--- a/tests/ui/source-struct-not-error.stderr
+++ b/tests/ui/source-struct-not-error.stderr
@@ -1,4 +1,4 @@
-error[E0599]: no method named `as_dyn_error` found for struct `NotError` in the current scope
+error[E0599]: the method `as_dyn_error` exists for struct `NotError`, but its trait bounds were not satisfied
--> $DIR/source-struct-not-error.rs:9:5
|
4 | struct NotError;
@@ -9,8 +9,8 @@ error[E0599]: no method named `as_dyn_error` found for struct `NotError` in the
| doesn't satisfy `NotError: std::error::Error`
...
9 | source: NotError,
- | ^^^^^^ method not found in `NotError`
+ | ^^^^^^ method cannot be called on `NotError` due to unsatisfied trait bounds
|
- = note: the method `as_dyn_error` exists but the following trait bounds were not satisfied:
+ = note: the following trait bounds were not satisfied:
`NotError: std::error::Error`
which is required by `NotError: AsDynError`