aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaibo Huang <hhb@google.com>2021-01-18 16:25:39 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-01-18 16:25:39 +0000
commit2641f691128a396ff5ebdee487a0508b9f6d1508 (patch)
tree2d5556bf5f20b6138992e3dd5b9891ba971770d6
parent5c695d45e0f9f714104c7aa5110e22b7511c31d8 (diff)
parent31a90dd76015a2072d17bce90b5b50e142bad06a (diff)
downloadthiserror-2641f691128a396ff5ebdee487a0508b9f6d1508.tar.gz
Upgrade rust/crates/thiserror to 1.0.23 am: 31a90dd760
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/thiserror/+/1536833 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I1bed95ad615cf62e70e54b379b4d91a9737b8fc6
-rw-r--r--.cargo_vcs_info.json2
-rw-r--r--Android.bp6
-rw-r--r--Cargo.toml4
-rw-r--r--Cargo.toml.orig4
-rw-r--r--METADATA8
-rw-r--r--README.md2
-rw-r--r--src/lib.rs3
-rw-r--r--tests/ui/lifetime.rs11
-rw-r--r--tests/ui/lifetime.stderr14
9 files changed, 36 insertions, 18 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index 660ea81..77f4f3f 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,5 +1,5 @@
{
"git": {
- "sha1": "09f247addaf6c5f57353f9558ba131e6619390c7"
+ "sha1": "d263b4b7e4f8e3ad9558256d8f6b2ac916985f7b"
}
}
diff --git a/Android.bp b/Android.bp
index efeaf9f..40c7dce 100644
--- a/Android.bp
+++ b/Android.bp
@@ -15,7 +15,7 @@ rust_library {
// dependent_library ["feature_list"]
// proc-macro2-1.0.24 "default,proc-macro"
-// quote-1.0.7 "default,proc-macro"
-// syn-1.0.53 "clone-impls,default,derive,parsing,printing,proc-macro,quote,visit"
-// thiserror-impl-1.0.22
+// 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
// unicode-xid-0.2.1 "default"
diff --git a/Cargo.toml b/Cargo.toml
index 47ba861..32d201f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,7 +13,7 @@
[package]
edition = "2018"
name = "thiserror"
-version = "1.0.22"
+version = "1.0.23"
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.22"
+version = "=1.0.23"
[dev-dependencies.anyhow]
version = "1.0"
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index 101d6b0..21149d5 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -1,6 +1,6 @@
[package]
name = "thiserror"
-version = "1.0.22"
+version = "1.0.23"
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.22", path = "impl" }
+thiserror-impl = { version = "=1.0.23", path = "impl" }
[dev-dependencies]
anyhow = "1.0"
diff --git a/METADATA b/METADATA
index 57b93b8..a43522a 100644
--- a/METADATA
+++ b/METADATA
@@ -7,13 +7,13 @@ third_party {
}
url {
type: ARCHIVE
- value: "https://static.crates.io/crates/thiserror/thiserror-1.0.22.crate"
+ value: "https://static.crates.io/crates/thiserror/thiserror-1.0.23.crate"
}
- version: "1.0.22"
+ version: "1.0.23"
license_type: NOTICE
last_upgrade_date {
year: 2020
- month: 11
- day: 4
+ month: 12
+ day: 29
}
}
diff --git a/README.md b/README.md
index 704034a..76c436a 100644
--- a/README.md
+++ b/README.md
@@ -70,7 +70,7 @@ pub enum DataStoreError {
```rust
#[derive(Error, Debug)]
pub enum Error {
- #[error("invalid rdo_lookahead_frames {0} (expected < {})", i32::max_value())]
+ #[error("invalid rdo_lookahead_frames {0} (expected < {})", i32::MAX)]
InvalidLookahead(u32),
}
```
diff --git a/src/lib.rs b/src/lib.rs
index 5f6582a..a520798 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -62,11 +62,12 @@
//! which may be arbitrary expressions. For example:
//!
//! ```rust
+//! # use std::i32;
//! # use thiserror::Error;
//! #
//! #[derive(Error, Debug)]
//! pub enum Error {
-//! #[error("invalid rdo_lookahead_frames {0} (expected < {})", i32::max_value())]
+//! #[error("invalid rdo_lookahead_frames {0} (expected < {})", i32::MAX)]
//! InvalidLookahead(u32),
//! }
//! ```
diff --git a/tests/ui/lifetime.rs b/tests/ui/lifetime.rs
index 63c6970..698f8c4 100644
--- a/tests/ui/lifetime.rs
+++ b/tests/ui/lifetime.rs
@@ -1,3 +1,4 @@
+use std::fmt::Debug;
use thiserror::Error;
#[derive(Error, Debug)]
@@ -8,6 +9,16 @@ struct Error<'a>(#[from] Inner<'a>);
#[error("{0}")]
struct Inner<'a>(&'a str);
+#[derive(Error, Debug)]
+enum Enum<'a> {
+ #[error("error")]
+ Foo(#[from] Generic<&'a str>),
+}
+
+#[derive(Error, Debug)]
+#[error("{0:?}")]
+struct Generic<T: Debug>(T);
+
fn main() -> Result<(), Error<'static>> {
Err(Error(Inner("some text")))
}
diff --git a/tests/ui/lifetime.stderr b/tests/ui/lifetime.stderr
index 500f6ab..5f86fa0 100644
--- a/tests/ui/lifetime.stderr
+++ b/tests/ui/lifetime.stderr
@@ -1,5 +1,11 @@
-error: non-static lifetimes are not allowed in the source of an error
- --> $DIR/lifetime.rs:5:18
+error: non-static lifetimes are not allowed in the source of an error, because std::error::Error requires the source is dyn Error + 'static
+ --> $DIR/lifetime.rs:6:26
|
-5 | struct Error<'a>(#[from] Inner<'a>);
- | ^^^^^^^^^^^^^^^^^
+6 | struct Error<'a>(#[from] Inner<'a>);
+ | ^^^^^^^^^
+
+error: non-static lifetimes are not allowed in the source of an error, because std::error::Error requires the source is dyn Error + 'static
+ --> $DIR/lifetime.rs:15:17
+ |
+15 | Foo(#[from] Generic<&'a str>),
+ | ^^^^^^^^^^^^^^^^