summaryrefslogtreecommitdiffstats
path: root/vendor/anyhow
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
commit64d98f8ee037282c35007b64c2649055c56af1db (patch)
tree5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /vendor/anyhow
parentAdding debian version 1.67.1+dfsg1-1. (diff)
downloadrustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz
rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/anyhow')
-rw-r--r--vendor/anyhow/.cargo-checksum.json2
-rw-r--r--vendor/anyhow/Cargo.toml4
-rw-r--r--vendor/anyhow/src/context.rs12
-rw-r--r--vendor/anyhow/src/lib.rs2
-rw-r--r--vendor/anyhow/tests/test_ensure.rs39
-rw-r--r--vendor/anyhow/tests/ui/no-impl.stderr56
6 files changed, 72 insertions, 43 deletions
diff --git a/vendor/anyhow/.cargo-checksum.json b/vendor/anyhow/.cargo-checksum.json
index 5bbee7b7b..e1190e628 100644
--- a/vendor/anyhow/.cargo-checksum.json
+++ b/vendor/anyhow/.cargo-checksum.json
@@ -1 +1 @@
-{"files":{"Cargo.toml":"5779c6bea2555cdabd4560de187ac5e3c88ff2df8172077397643edc51c6fcc3","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"4bd4d352368ac0f5447031d82454490f6ac0c80d2fa4cb64ba0c23c614670d49","build.rs":"88bf7100143c79c0af683da7f28deaac031c9b9b213a6426560dc089b0ba45aa","rust-toolchain.toml":"6bbb61302978c736b2da03e4fb40e3beab908f85d533ab46fd541e637b5f3e0f","src/backtrace.rs":"5b4103a7d24d6f438a64b8cc0fafe28d55fc0ca090368174ce44d64e3940badd","src/chain.rs":"6edefc5f3c7d69683095862e54e3bb56faba5b3387bf2eeaed429da090007a0a","src/context.rs":"0bb1566aae147d393796dd6ede6ba329916e0a373b7cbc38335c3eeeb3d48b57","src/ensure.rs":"498bc9c7fb8b93168ed12f532cb97df6ccdda9ce25371586d7f5b1b1c98a14bf","src/error.rs":"e45d4dcfe64b1823b42fbf9bb260e6437987e8c2d51f92434db9d808b36e700a","src/fmt.rs":"c2d4aad6ce20625a70a7c091e3087b6a2c19a4a87c7a12edb4c98978307245ea","src/kind.rs":"332854c5eb07d44447c356a2e7dc585634b0da1ffbbfa81269c369deaefbc247","src/lib.rs":"82011e86fb9b41fe10ab2fde2b797b4858e697e7ead3a5f0d30b018357f1721d","src/macros.rs":"dd35f2ec2a0a25e4504fb04bcd42f6d0963bc0035aaaefc412f5ee1d78945fe1","src/ptr.rs":"f4e28bc9feba1e84160ca9d185008a51b5d72e168e6546f3e942f4258c361e19","src/wrapper.rs":"ff3ad72065a30cc32e9acb0614a30703c49c57b941a335c348b6439af684316b","tests/common/mod.rs":"f9088c2d7afafa64ff730b629272045b776bfafc2f5957508242da630635f2e1","tests/compiletest.rs":"022a8e400ef813d7ea1875b944549cee5125f6a995dc33e93b48cba3e1b57bd1","tests/drop/mod.rs":"08c3e553c1cc0d2dbd936fc45f4b5b1105057186affd6865e8d261e05f0f0646","tests/test_autotrait.rs":"981e792db353be2f14c7a1cabe43b5f1329c168cb7679077cc2be786a0920d48","tests/test_backtrace.rs":"0e50edbb33b6bd07ba89ff3db72fb7c688ba2a4371fccdbbb20309ab02948b6a","tests/test_boxed.rs":"6b26db0e2eb72afe9af7352ea820837aab90f8d486294616dd5dc34c1b94038c","tests/test_chain.rs":"d5e90e3eba58abc60d241d3aade39e0b8d4006d9a14f3cf015d3d925160b5812","tests/test_context.rs":"8409c53b328562c11e822bd6c3cd17e0d4d50b9bbb8fc3617333fd77303a6a33","tests/test_convert.rs":"7e7a8b4772a427a911014ac4d1083f9519000e786177f898808980dd9bdfde61","tests/test_downcast.rs":"797e69a72d125758c4c4897e5dc776d549d52cc9a6a633e0a33193f588a62b88","tests/test_ensure.rs":"c8137a9565685aedf02b365008b27c707f4c3d81cd2b986b3b7105b426c723b1","tests/test_ffi.rs":"d0cb4c1d6d9154090982dee72ae3ebe05a5981f976058c3250f1c9da5a45edef","tests/test_fmt.rs":"17572596f257aac9aa2ec4620e292ca6a954128b94772bb948399fab53832e70","tests/test_macros.rs":"11f05010bc9b16319884c1286444100e30cddc2ecd1ffe5e0fd3fee5ffb32683","tests/test_repr.rs":"dbb9b04ddbe1ab31eb5331ea69f05bb3a147299da2275a3d4dcc92947b5591b9","tests/test_source.rs":"b80723cf635a4f8c4df21891b34bfab9ed2b2aa407e7a2f826d24e334cd5f88e","tests/ui/chained-comparison.rs":"6504b03d95b5acc232a7f4defc9f343b2be6733bf475fa0992e8e6545b912bd4","tests/ui/chained-comparison.stderr":"7f1d0a8c251b0ede2d30b3087ec157fc660945c97a642c4a5acf5a14ec58de34","tests/ui/empty-ensure.rs":"ab5bf37c846a0d689f26ce9257a27228411ed64154f9c950f1602d88a355d94b","tests/ui/empty-ensure.stderr":"345102cbef47310f2f4066a669199873a627ca4f1fcb885505c6e17d1fc95e88","tests/ui/must-use.rs":"fb59860b43f673bf4a430a6036ba463e95028844d8dd4243cfe5ebc7f2be582f","tests/ui/must-use.stderr":"c2848c5f254b4c061eea6714d9baf709924aba06619eaf2a8b3aee1266b75f9e","tests/ui/no-impl.rs":"fab6cbf2f6ea510b86f567dfb3b7c31250a9fd71ae5d110dbb9188be569ec593","tests/ui/no-impl.stderr":"9d36a96220f0b5a81db027bcba411a61a72cc2e370c38058ab556442e8bb8a8b","tests/ui/temporary-value.rs":"4dcc96271b2403e6372cf4cfc813445e5ce4365fc6e156b6bc38274098499a70","tests/ui/temporary-value.stderr":"64e448b6759cf51d41b1360307a638452bbe53ffa706f93e4a503b712d7b89a8","tests/ui/wrong-interpolation.rs":"9c44d4674c2dccd27b9dedd03341346ec02d993b41793ee89b5755202e7e367e","tests/ui/wrong-interpolation.stderr":"301e60e2eb9401782c7dc0b3580613a4cb2aafd4cc8065734a630a62e1161aa5"},"package":"98161a4e3e2184da77bb14f02184cdd111e83bbbcc9979dfee3c44b9a85f5602"} \ No newline at end of file
+{"files":{"Cargo.toml":"c8e64a8ca00738e01d382e5ec9ce52e3869df34371a2f9bbf008fc8c23817200","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"4bd4d352368ac0f5447031d82454490f6ac0c80d2fa4cb64ba0c23c614670d49","build.rs":"88bf7100143c79c0af683da7f28deaac031c9b9b213a6426560dc089b0ba45aa","rust-toolchain.toml":"6bbb61302978c736b2da03e4fb40e3beab908f85d533ab46fd541e637b5f3e0f","src/backtrace.rs":"5b4103a7d24d6f438a64b8cc0fafe28d55fc0ca090368174ce44d64e3940badd","src/chain.rs":"6edefc5f3c7d69683095862e54e3bb56faba5b3387bf2eeaed429da090007a0a","src/context.rs":"fe733dd36f34ee8d8fc26569cc94df0236a8c1600ed4c969a63afe06dcb7afeb","src/ensure.rs":"498bc9c7fb8b93168ed12f532cb97df6ccdda9ce25371586d7f5b1b1c98a14bf","src/error.rs":"e45d4dcfe64b1823b42fbf9bb260e6437987e8c2d51f92434db9d808b36e700a","src/fmt.rs":"c2d4aad6ce20625a70a7c091e3087b6a2c19a4a87c7a12edb4c98978307245ea","src/kind.rs":"332854c5eb07d44447c356a2e7dc585634b0da1ffbbfa81269c369deaefbc247","src/lib.rs":"dc32c43ef5a7d690f764af71198b7d14fefb0247ae43926aedecf605876c30dd","src/macros.rs":"dd35f2ec2a0a25e4504fb04bcd42f6d0963bc0035aaaefc412f5ee1d78945fe1","src/ptr.rs":"f4e28bc9feba1e84160ca9d185008a51b5d72e168e6546f3e942f4258c361e19","src/wrapper.rs":"ff3ad72065a30cc32e9acb0614a30703c49c57b941a335c348b6439af684316b","tests/common/mod.rs":"f9088c2d7afafa64ff730b629272045b776bfafc2f5957508242da630635f2e1","tests/compiletest.rs":"022a8e400ef813d7ea1875b944549cee5125f6a995dc33e93b48cba3e1b57bd1","tests/drop/mod.rs":"08c3e553c1cc0d2dbd936fc45f4b5b1105057186affd6865e8d261e05f0f0646","tests/test_autotrait.rs":"981e792db353be2f14c7a1cabe43b5f1329c168cb7679077cc2be786a0920d48","tests/test_backtrace.rs":"0e50edbb33b6bd07ba89ff3db72fb7c688ba2a4371fccdbbb20309ab02948b6a","tests/test_boxed.rs":"6b26db0e2eb72afe9af7352ea820837aab90f8d486294616dd5dc34c1b94038c","tests/test_chain.rs":"d5e90e3eba58abc60d241d3aade39e0b8d4006d9a14f3cf015d3d925160b5812","tests/test_context.rs":"8409c53b328562c11e822bd6c3cd17e0d4d50b9bbb8fc3617333fd77303a6a33","tests/test_convert.rs":"7e7a8b4772a427a911014ac4d1083f9519000e786177f898808980dd9bdfde61","tests/test_downcast.rs":"797e69a72d125758c4c4897e5dc776d549d52cc9a6a633e0a33193f588a62b88","tests/test_ensure.rs":"729ba5fb75959a511a0d1cda1b0f7f88af94aa88f8d251505af1c988e74ef8c6","tests/test_ffi.rs":"d0cb4c1d6d9154090982dee72ae3ebe05a5981f976058c3250f1c9da5a45edef","tests/test_fmt.rs":"17572596f257aac9aa2ec4620e292ca6a954128b94772bb948399fab53832e70","tests/test_macros.rs":"11f05010bc9b16319884c1286444100e30cddc2ecd1ffe5e0fd3fee5ffb32683","tests/test_repr.rs":"dbb9b04ddbe1ab31eb5331ea69f05bb3a147299da2275a3d4dcc92947b5591b9","tests/test_source.rs":"b80723cf635a4f8c4df21891b34bfab9ed2b2aa407e7a2f826d24e334cd5f88e","tests/ui/chained-comparison.rs":"6504b03d95b5acc232a7f4defc9f343b2be6733bf475fa0992e8e6545b912bd4","tests/ui/chained-comparison.stderr":"7f1d0a8c251b0ede2d30b3087ec157fc660945c97a642c4a5acf5a14ec58de34","tests/ui/empty-ensure.rs":"ab5bf37c846a0d689f26ce9257a27228411ed64154f9c950f1602d88a355d94b","tests/ui/empty-ensure.stderr":"345102cbef47310f2f4066a669199873a627ca4f1fcb885505c6e17d1fc95e88","tests/ui/must-use.rs":"fb59860b43f673bf4a430a6036ba463e95028844d8dd4243cfe5ebc7f2be582f","tests/ui/must-use.stderr":"c2848c5f254b4c061eea6714d9baf709924aba06619eaf2a8b3aee1266b75f9e","tests/ui/no-impl.rs":"fab6cbf2f6ea510b86f567dfb3b7c31250a9fd71ae5d110dbb9188be569ec593","tests/ui/no-impl.stderr":"d827fcf94a6ddc64f9ad3bfda8018276c2b91f5be4b833af81815e1b3a8a367c","tests/ui/temporary-value.rs":"4dcc96271b2403e6372cf4cfc813445e5ce4365fc6e156b6bc38274098499a70","tests/ui/temporary-value.stderr":"64e448b6759cf51d41b1360307a638452bbe53ffa706f93e4a503b712d7b89a8","tests/ui/wrong-interpolation.rs":"9c44d4674c2dccd27b9dedd03341346ec02d993b41793ee89b5755202e7e367e","tests/ui/wrong-interpolation.stderr":"301e60e2eb9401782c7dc0b3580613a4cb2aafd4cc8065734a630a62e1161aa5"},"package":"216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6"} \ No newline at end of file
diff --git a/vendor/anyhow/Cargo.toml b/vendor/anyhow/Cargo.toml
index 844c2bd3a..b3d57a30f 100644
--- a/vendor/anyhow/Cargo.toml
+++ b/vendor/anyhow/Cargo.toml
@@ -13,7 +13,7 @@
edition = "2018"
rust-version = "1.38"
name = "anyhow"
-version = "1.0.65"
+version = "1.0.66"
authors = ["David Tolnay <dtolnay@gmail.com>"]
description = "Flexible concrete Error type built on std::error::Error"
documentation = "https://docs.rs/anyhow"
@@ -55,7 +55,7 @@ features = ["full"]
version = "1.0"
[dev-dependencies.trybuild]
-version = "1.0.49"
+version = "1.0.66"
features = ["diff"]
[features]
diff --git a/vendor/anyhow/src/context.rs b/vendor/anyhow/src/context.rs
index 1b7dd31ac..238473e5c 100644
--- a/vendor/anyhow/src/context.rs
+++ b/vendor/anyhow/src/context.rs
@@ -47,7 +47,12 @@ where
where
C: Display + Send + Sync + 'static,
{
- self.map_err(|error| error.ext_context(context))
+ // Not using map_err to save 2 useless frames off the captured backtrace
+ // in ext_context.
+ match self {
+ Ok(ok) => Ok(ok),
+ Err(error) => Err(error.ext_context(context)),
+ }
}
fn with_context<C, F>(self, context: F) -> Result<T, Error>
@@ -55,7 +60,10 @@ where
C: Display + Send + Sync + 'static,
F: FnOnce() -> C,
{
- self.map_err(|error| error.ext_context(context()))
+ match self {
+ Ok(ok) => Ok(ok),
+ Err(error) => Err(error.ext_context(context())),
+ }
}
}
diff --git a/vendor/anyhow/src/lib.rs b/vendor/anyhow/src/lib.rs
index 792a4d007..583ab424e 100644
--- a/vendor/anyhow/src/lib.rs
+++ b/vendor/anyhow/src/lib.rs
@@ -210,7 +210,7 @@
//! will require an explicit `.map_err(Error::msg)` when working with a
//! non-Anyhow error type inside a function that returns Anyhow's error type.
-#![doc(html_root_url = "https://docs.rs/anyhow/1.0.65")]
+#![doc(html_root_url = "https://docs.rs/anyhow/1.0.66")]
#![cfg_attr(backtrace, feature(error_generic_member_access, provide_any))]
#![cfg_attr(doc_cfg, feature(doc_cfg))]
#![cfg_attr(not(feature = "std"), no_std)]
diff --git a/vendor/anyhow/tests/test_ensure.rs b/vendor/anyhow/tests/test_ensure.rs
index cbcba5798..6984c7d11 100644
--- a/vendor/anyhow/tests/test_ensure.rs
+++ b/vendor/anyhow/tests/test_ensure.rs
@@ -1,4 +1,5 @@
#![allow(
+ clippy::bool_to_int_with_if,
clippy::diverging_sub_expression,
clippy::if_same_then_else,
clippy::ifs_same_cond,
@@ -17,10 +18,12 @@
irrefutable_let_patterns
)]
+use self::Enum::Generic;
use anyhow::{anyhow, ensure, Chain, Error, Result};
-use std::fmt::Debug;
+use std::fmt::{self, Debug};
use std::iter;
use std::marker::{PhantomData, PhantomData as P};
+use std::mem;
use std::ops::Add;
use std::ptr;
@@ -43,6 +46,24 @@ trait Trait: Sized {
impl<T> Trait for T {}
+enum Enum<T: ?Sized> {
+ #[allow(dead_code)]
+ Thing(PhantomData<T>),
+ Generic,
+}
+
+impl<T: ?Sized> PartialEq for Enum<T> {
+ fn eq(&self, rhs: &Self) -> bool {
+ mem::discriminant(self) == mem::discriminant(rhs)
+ }
+}
+
+impl<T: ?Sized> Debug for Enum<T> {
+ fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+ formatter.write_str("Generic")
+ }
+}
+
#[track_caller]
fn assert_err<T: Debug>(result: impl FnOnce() -> Result<T>, expected: &'static str) {
let actual = result().unwrap_err().to_string();
@@ -355,27 +376,27 @@ fn test_path() {
let test = || Ok(ensure!(E::U::<u8,>>E::U));
assert_err(test, "Condition failed: `E::U::<u8> > E::U` (U vs U)");
- let test = || Ok(ensure!(PhantomData::<dyn Debug + Sync> != PhantomData));
+ let test = || Ok(ensure!(Generic::<dyn Debug + Sync> != Generic));
assert_err(
test,
- "Condition failed: `PhantomData::<dyn Debug + Sync> != PhantomData` (PhantomData vs PhantomData)",
+ "Condition failed: `Generic::<dyn Debug + Sync> != Generic` (Generic vs Generic)",
);
- let test = || Ok(ensure!(PhantomData::<dyn Fn() + Sync> != PhantomData));
+ let test = || Ok(ensure!(Generic::<dyn Fn() + Sync> != Generic));
assert_err(
test,
- "Condition failed: `PhantomData::<dyn Fn() + Sync> != PhantomData` (PhantomData vs PhantomData)",
+ "Condition failed: `Generic::<dyn Fn() + Sync> != Generic` (Generic vs Generic)",
);
#[rustfmt::skip]
let test = || {
Ok(ensure!(
- PhantomData::<dyn Fn::() + ::std::marker::Sync> != PhantomData
+ Generic::<dyn Fn::() + ::std::marker::Sync> != Generic
))
};
assert_err(
test,
- "Condition failed: `PhantomData::<dyn Fn() + ::std::marker::Sync> != PhantomData` (PhantomData vs PhantomData)",
+ "Condition failed: `Generic::<dyn Fn() + ::std::marker::Sync> != Generic` (Generic vs Generic)",
);
}
@@ -408,7 +429,7 @@ fn test_trailer() {
let test = || Ok(ensure!(PhantomData::<u8> {} != PhantomData));
assert_err(
test,
- "Condition failed: `PhantomData::<u8> {} != PhantomData` (PhantomData vs PhantomData)",
+ "Condition failed: `PhantomData::<u8> {} != PhantomData` (PhantomData<u8> vs PhantomData<u8>)",
);
let result = Ok::<_, Error>(1);
@@ -596,7 +617,7 @@ fn test_as() {
};
assert_err(
test,
- "Condition failed: `PhantomData as PhantomData<<i32 as ToOwned>::Owned> != PhantomData` (PhantomData vs PhantomData)",
+ "Condition failed: `PhantomData as PhantomData<<i32 as ToOwned>::Owned> != PhantomData` (PhantomData<i32> vs PhantomData<i32>)",
);
macro_rules! int {
diff --git a/vendor/anyhow/tests/ui/no-impl.stderr b/vendor/anyhow/tests/ui/no-impl.stderr
index 074dafe62..dced9987e 100644
--- a/vendor/anyhow/tests/ui/no-impl.stderr
+++ b/vendor/anyhow/tests/ui/no-impl.stderr
@@ -1,31 +1,31 @@
error[E0599]: the method `anyhow_kind` exists for reference `&Error`, but its trait bounds were not satisfied
- --> tests/ui/no-impl.rs:7:13
- |
-4 | struct Error;
- | ------------
- | |
- | doesn't satisfy `Error: Into<anyhow::Error>`
- | doesn't satisfy `Error: anyhow::kind::TraitKind`
- | doesn't satisfy `Error: std::fmt::Display`
+ --> tests/ui/no-impl.rs:7:13
+ |
+4 | struct Error;
+ | ------------
+ | |
+ | doesn't satisfy `Error: Into<anyhow::Error>`
+ | doesn't satisfy `Error: anyhow::kind::TraitKind`
+ | doesn't satisfy `Error: std::fmt::Display`
...
-7 | let _ = anyhow!(Error);
- | ^^^^^^^^^^^^^^ method cannot be called on `&Error` due to unsatisfied trait bounds
- |
- = note: the following trait bounds were not satisfied:
- `Error: Into<anyhow::Error>`
- which is required by `Error: anyhow::kind::TraitKind`
- `Error: std::fmt::Display`
- which is required by `&Error: anyhow::kind::AdhocKind`
- `&Error: Into<anyhow::Error>`
- which is required by `&Error: anyhow::kind::TraitKind`
+7 | let _ = anyhow!(Error);
+ | ^^^^^^^^^^^^^^ method cannot be called on `&Error` due to unsatisfied trait bounds
+ |
+ = note: the following trait bounds were not satisfied:
+ `Error: Into<anyhow::Error>`
+ which is required by `Error: anyhow::kind::TraitKind`
+ `Error: std::fmt::Display`
+ which is required by `&Error: anyhow::kind::AdhocKind`
+ `&Error: Into<anyhow::Error>`
+ which is required by `&Error: anyhow::kind::TraitKind`
note: the following traits must be implemented
- --> $RUST/core/src/fmt/mod.rs
- |
- | pub trait Display {
- | ^^^^^^^^^^^^^^^^^
- |
- ::: $RUST/core/src/convert/mod.rs
- |
- | pub trait Into<T>: Sized {
- | ^^^^^^^^^^^^^^^^^^^^^^^^
- = note: this error originates in the macro `anyhow` (in Nightly builds, run with -Z macro-backtrace for more info)
+ --> $RUST/core/src/fmt/mod.rs
+ |
+ | pub trait Display {
+ | ^^^^^^^^^^^^^^^^^
+ |
+ ::: $RUST/core/src/convert/mod.rs
+ |
+ | pub trait Into<T>: Sized {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: this error originates in the macro `anyhow` (in Nightly builds, run with -Z macro-backtrace for more info)