diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:59:35 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:59:35 +0000 |
commit | d1b2d29528b7794b41e66fc2136e395a02f8529b (patch) | |
tree | a4a17504b260206dec3cf55b2dca82929a348ac2 /vendor/thiserror | |
parent | Releasing progress-linux version 1.72.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.tar.xz rustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.zip |
Merging upstream version 1.73.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/thiserror')
-rw-r--r-- | vendor/thiserror/.cargo-checksum.json | 2 | ||||
-rw-r--r-- | vendor/thiserror/Cargo.toml | 15 | ||||
-rw-r--r-- | vendor/thiserror/build.rs | 45 | ||||
-rw-r--r-- | vendor/thiserror/src/aserror.rs | 2 | ||||
-rw-r--r-- | vendor/thiserror/src/display.rs | 2 | ||||
-rw-r--r-- | vendor/thiserror/src/lib.rs | 11 | ||||
-rw-r--r-- | vendor/thiserror/src/provide.rs | 17 | ||||
-rw-r--r-- | vendor/thiserror/tests/test_backtrace.rs | 65 | ||||
-rw-r--r-- | vendor/thiserror/tests/test_option.rs | 5 |
9 files changed, 90 insertions, 74 deletions
diff --git a/vendor/thiserror/.cargo-checksum.json b/vendor/thiserror/.cargo-checksum.json index ad4300a7e..0be47e8cf 100644 --- a/vendor/thiserror/.cargo-checksum.json +++ b/vendor/thiserror/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"3a25d0550abd84a575c7a90e15509bcdde1c546780707a8633b963378e33c8f8","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"106c5a937767d49503e1fc5eae1b924f57f15decd8583720a3c652483e348a64","build.rs":"8b8d9cbf84b9a2fd108b49ecb4bae327da688d80b818acda9ee17170c788e193","rust-toolchain.toml":"6bbb61302978c736b2da03e4fb40e3beab908f85d533ab46fd541e637b5f3e0f","src/aserror.rs":"c93bd9191f26a7599043b397e26822564d9bafaa339a19861182a9909e8a3811","src/display.rs":"63c492bfa8b8e9180ad5abcbe63c1173b4ad490c47ec33cac9a338f96c8f8e42","src/lib.rs":"fbdfd87ec64d9dd66a288aaab5e58c29c2c69a79f2e2943b1a7522b5d17d93f4","src/provide.rs":"b2f7a33f44f44a03e94f54cc4b79ba2dcc5fcf0fdf64b07cdd9588a6544c8d8e","tests/compiletest.rs":"022a8e400ef813d7ea1875b944549cee5125f6a995dc33e93b48cba3e1b57bd1","tests/test_backtrace.rs":"fd1f326bc23e6c1611a51bc43c1d5092b32ee18a1613abe20da0818e5729c0ed","tests/test_deprecated.rs":"7b80a10f090a3982da017556d3d71398abcead59afd8278c7b9d9b1f7b66c7b3","tests/test_display.rs":"f7d023365adbd47a24cb62cea02905503fd54705cbfdffdfdb3412dc210737a9","tests/test_error.rs":"d06dca3c38f22d7ce4e27dadd6c0f78e5cefe3a2ebbc5fe44abc9ddd5ee1985f","tests/test_expr.rs":"388402702a3be4ffcd0574d66733e8932bf7d5de37544a00ecb0e4f8d8246da4","tests/test_from.rs":"36bd22be7b048cd187a19076aeac1456040f20a0b677b01c6003998b63439ea1","tests/test_generics.rs":"4f33747e3f62550d5af94687679af230ef92fbb3247ae4b41df46792a040e4dc","tests/test_lints.rs":"c17d79d77edfcdd4b8f6dcdcd1c70ad065cfbc747e1a618ac6343315d0b59ea4","tests/test_option.rs":"3a82af1ad206444b9955e3f2fda508d70f887ad0b7f7986bafc17496f63b07ab","tests/test_path.rs":"ef5452c7e828a0179f5ace7e19f95b9762aa887caf10244adbfe36ded712c090","tests/test_source.rs":"f2f04f11bf8a709eddb1c68f113cda0c2be87e56800d6b9d991bedd545b4642f","tests/test_transparent.rs":"cd8d5be14d00d610a1782104bea6c013618501dab5c3625178ecfcf66e31f939","tests/ui/bad-field-attr.rs":"c5b567e3091969a01061843fb2d95c5e1aa3fa81edfeecdf416a84a6fba40aa8","tests/ui/bad-field-attr.stderr":"78f576d5ec66464a77f1cdf0f5bb7dcdf18f7f04f1165983a6239ec59d908ea3","tests/ui/concat-display.rs":"3995bd6b3bdd67df7bb16499775d89600c0dd20895633fe807396a64c117078d","tests/ui/concat-display.stderr":"256dfde61ee689ebe51588b135e2e030bdf95ba5adef1cb59f588c797bbdeef2","tests/ui/duplicate-enum-source.rs":"bfe28ce18042d446a76c7411aa233598211ce1157fdd3cb87bff3b3fa7c33131","tests/ui/duplicate-enum-source.stderr":"3d32fead420b27b4497be49080bc3b78f7f0ba339ead3de6c94e5dc20302c18f","tests/ui/duplicate-fmt.rs":"af53b66445bcce076a114376747f176b42c060a156563a41ccb638ae14c451fd","tests/ui/duplicate-fmt.stderr":"998bb121ce6f1595fd99529a7a1b06451b6bf476924337dce5524a83a7a5f1a1","tests/ui/duplicate-struct-source.rs":"f3d5f8e3d6fccfcdbb630db291353709583a920c6bf46f9f9de9966b67ea4c0f","tests/ui/duplicate-struct-source.stderr":"fb761d76668ac42357cf37b03c0abdbae5de0a828034990850291c9cb6ab766d","tests/ui/duplicate-transparent.rs":"41a9447e85f1a47027023442acde55c3d8610ec46d91b39bd43a42d7a004d747","tests/ui/duplicate-transparent.stderr":"4975abad43e973df158f18098d9bcb9dc39f8e75d3e733ed5d6620d1ee065c11","tests/ui/from-backtrace-backtrace.rs":"1fd51c5a1f7f6b6ee676d9fc798b6276ef2ce75def33d07f0e4b7bbde3291859","tests/ui/from-backtrace-backtrace.stderr":"f9774e9dad51374501ef4a55fa2dacece4d1c70e29ca18761394bdb80a9a74da","tests/ui/from-not-source.rs":"744a55aeffe11066830159ac023c33aaa5576e313b341fa24440ee13dfe3ac98","tests/ui/from-not-source.stderr":"525038e8b841707b927434cca4549168f73bd305faca17552a0d1fffa542ccc4","tests/ui/lifetime.rs":"e72e0391695e47fcd07edbf3819f114e468e2097086ec687781c7c8d6b4b7da7","tests/ui/lifetime.stderr":"d889a23f71324afe95dafc5f9d15337fbdbc9977cb8924f0cafe3a3becf4ced7","tests/ui/missing-fmt.rs":"bc9e2830e54c2474ff6c27a766ed3dee88d29e40f93f30e8d64d63233866c17d","tests/ui/missing-fmt.stderr":"9a20ccee9b660fe31a5b3199307b48580bb8305cb9ce33d97d3fc767a0cfc614","tests/ui/no-display.rs":"962245372272d23e9833311c15e73221b3c7da822a2ff90189613af56ffb5c2e","tests/ui/no-display.stderr":"d7bdecccb74d21677361fb7f89dc784dc859258afcf663fa1c48da6c172a61aa","tests/ui/source-enum-not-error.rs":"7c57c63b3ec37bc456738acea2e1038de5b0f32fe7e83984037d7ad1ed921737","tests/ui/source-enum-not-error.stderr":"feac587e2436fd7bed73e7265dceb31b495587f1a8eea5c5fefd9da66b912dac","tests/ui/source-struct-not-error.rs":"09fb7713637242dca9192585a6daeb8d732dc1c1d0fa522b74f1c98618e6d949","tests/ui/source-struct-not-error.stderr":"66fb5fa85d59f11d8b5f7ec99469a843c51943b0010e554bdf56376a0614a2ca","tests/ui/transparent-display.rs":"b3c59583eb64b0b5a246444456d03cf52d51bcdc08885023600dbb44fd87e5f2","tests/ui/transparent-display.stderr":"16d538914e0d92026bde4b4bec75660217da9ecc6b621d12d2eb81d33ed1d1da","tests/ui/transparent-enum-many.rs":"2a40a764fb4683bff57973eec61507a6c00f7d4d7a32da6e7bd0190c2e445434","tests/ui/transparent-enum-many.stderr":"f1d78c1d6d8edbef153420db4fb9ca3dc6076fa043b5b1bc0cd291daa417a3ea","tests/ui/transparent-enum-source.rs":"18f606a98ac0a53f08dc56f5f923b9cbe75d25ed34479c777b48dac305d5968c","tests/ui/transparent-enum-source.stderr":"1b2e0ac53951034575d43ec0396c4e2b3cfb272db2aef8d6baa13a7e1632cc84","tests/ui/transparent-struct-many.rs":"72c6b6c1a44c203d3bc68989b2f1ec092531ef75b745432824c3776c290326f6","tests/ui/transparent-struct-many.stderr":"7bd0536dbb54a0ce7d4a8e66ca7624a1b132d8a1d1e4fecca642ec77494ac01c","tests/ui/transparent-struct-source.rs":"863fa691ed7d27e8767da58d9ee11fd40d6642274b36338ca1074c07964ea2b3","tests/ui/transparent-struct-source.stderr":"267dab65929e67d32347fb467a00b43af931f8205d727d7671938580217fc70e","tests/ui/unexpected-field-fmt.rs":"29fba7b4d81c642ec8e47cfe053aa515acf9080a86d65e685363a48993becfe3","tests/ui/unexpected-field-fmt.stderr":"20731c4a08af04bed3ff513903adadd690b6bc532b15604557e7f25575a8338f","tests/ui/unexpected-struct-source.rs":"c6cbe882d622635c216feb8290b1bd536ce0ec4feee16bc087667a21b3641d5c","tests/ui/unexpected-struct-source.stderr":"7c8227513478f6cc09e8a28be337c8a0e758a06ca5978d774c91bd43c4a54043","tests/ui/union.rs":"331adff27cebd8b95b03b6742cc8247331fda1f961e1590ed39c8d39f50cf1d8","tests/ui/union.stderr":"5f67ad29753d6fb14bc03aef7d4a1f660ee7796e469c037efbf8b13456934ad3"},"package":"978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac"}
\ No newline at end of file +{"files":{"Cargo.toml":"426e954049c684a86d819889248e16d5035fee3e6208c8561a6306f67829c37f","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"106c5a937767d49503e1fc5eae1b924f57f15decd8583720a3c652483e348a64","build.rs":"68e8862d9a6fa607647c01232662a3d9a44462aec390a6fe98beccd59fa58f7d","rust-toolchain.toml":"6bbb61302978c736b2da03e4fb40e3beab908f85d533ab46fd541e637b5f3e0f","src/aserror.rs":"cf3c98abb2b9e06afa3c4aba0df14938417c3e330315863437561cbb3573888b","src/display.rs":"44edb82464d52b33604236445e7429b86273fcd921fbaafc72270f0e1d8876ff","src/lib.rs":"c42c4fed186c0d328fb2f8cec2dc72be925c54936db148b2700203319ff78a7c","src/provide.rs":"8007e22953bacfcc57bb7d12a03fbeb0acece5d2ec889cf55522a4e071d26df3","tests/compiletest.rs":"022a8e400ef813d7ea1875b944549cee5125f6a995dc33e93b48cba3e1b57bd1","tests/test_backtrace.rs":"a8f038490fb881463c0e8c36557617c47cf2d181f16c00525d4d139c7964fade","tests/test_deprecated.rs":"7b80a10f090a3982da017556d3d71398abcead59afd8278c7b9d9b1f7b66c7b3","tests/test_display.rs":"f7d023365adbd47a24cb62cea02905503fd54705cbfdffdfdb3412dc210737a9","tests/test_error.rs":"d06dca3c38f22d7ce4e27dadd6c0f78e5cefe3a2ebbc5fe44abc9ddd5ee1985f","tests/test_expr.rs":"388402702a3be4ffcd0574d66733e8932bf7d5de37544a00ecb0e4f8d8246da4","tests/test_from.rs":"36bd22be7b048cd187a19076aeac1456040f20a0b677b01c6003998b63439ea1","tests/test_generics.rs":"4f33747e3f62550d5af94687679af230ef92fbb3247ae4b41df46792a040e4dc","tests/test_lints.rs":"c17d79d77edfcdd4b8f6dcdcd1c70ad065cfbc747e1a618ac6343315d0b59ea4","tests/test_option.rs":"ac30d929c019d6c54d1c1792b09e43c18dc0e4123b82051ff9e5db5e63c15e43","tests/test_path.rs":"ef5452c7e828a0179f5ace7e19f95b9762aa887caf10244adbfe36ded712c090","tests/test_source.rs":"f2f04f11bf8a709eddb1c68f113cda0c2be87e56800d6b9d991bedd545b4642f","tests/test_transparent.rs":"cd8d5be14d00d610a1782104bea6c013618501dab5c3625178ecfcf66e31f939","tests/ui/bad-field-attr.rs":"c5b567e3091969a01061843fb2d95c5e1aa3fa81edfeecdf416a84a6fba40aa8","tests/ui/bad-field-attr.stderr":"78f576d5ec66464a77f1cdf0f5bb7dcdf18f7f04f1165983a6239ec59d908ea3","tests/ui/concat-display.rs":"3995bd6b3bdd67df7bb16499775d89600c0dd20895633fe807396a64c117078d","tests/ui/concat-display.stderr":"256dfde61ee689ebe51588b135e2e030bdf95ba5adef1cb59f588c797bbdeef2","tests/ui/duplicate-enum-source.rs":"bfe28ce18042d446a76c7411aa233598211ce1157fdd3cb87bff3b3fa7c33131","tests/ui/duplicate-enum-source.stderr":"3d32fead420b27b4497be49080bc3b78f7f0ba339ead3de6c94e5dc20302c18f","tests/ui/duplicate-fmt.rs":"af53b66445bcce076a114376747f176b42c060a156563a41ccb638ae14c451fd","tests/ui/duplicate-fmt.stderr":"998bb121ce6f1595fd99529a7a1b06451b6bf476924337dce5524a83a7a5f1a1","tests/ui/duplicate-struct-source.rs":"f3d5f8e3d6fccfcdbb630db291353709583a920c6bf46f9f9de9966b67ea4c0f","tests/ui/duplicate-struct-source.stderr":"fb761d76668ac42357cf37b03c0abdbae5de0a828034990850291c9cb6ab766d","tests/ui/duplicate-transparent.rs":"41a9447e85f1a47027023442acde55c3d8610ec46d91b39bd43a42d7a004d747","tests/ui/duplicate-transparent.stderr":"4975abad43e973df158f18098d9bcb9dc39f8e75d3e733ed5d6620d1ee065c11","tests/ui/from-backtrace-backtrace.rs":"1fd51c5a1f7f6b6ee676d9fc798b6276ef2ce75def33d07f0e4b7bbde3291859","tests/ui/from-backtrace-backtrace.stderr":"f9774e9dad51374501ef4a55fa2dacece4d1c70e29ca18761394bdb80a9a74da","tests/ui/from-not-source.rs":"744a55aeffe11066830159ac023c33aaa5576e313b341fa24440ee13dfe3ac98","tests/ui/from-not-source.stderr":"525038e8b841707b927434cca4549168f73bd305faca17552a0d1fffa542ccc4","tests/ui/lifetime.rs":"e72e0391695e47fcd07edbf3819f114e468e2097086ec687781c7c8d6b4b7da7","tests/ui/lifetime.stderr":"d889a23f71324afe95dafc5f9d15337fbdbc9977cb8924f0cafe3a3becf4ced7","tests/ui/missing-fmt.rs":"bc9e2830e54c2474ff6c27a766ed3dee88d29e40f93f30e8d64d63233866c17d","tests/ui/missing-fmt.stderr":"9a20ccee9b660fe31a5b3199307b48580bb8305cb9ce33d97d3fc767a0cfc614","tests/ui/no-display.rs":"962245372272d23e9833311c15e73221b3c7da822a2ff90189613af56ffb5c2e","tests/ui/no-display.stderr":"d7bdecccb74d21677361fb7f89dc784dc859258afcf663fa1c48da6c172a61aa","tests/ui/source-enum-not-error.rs":"7c57c63b3ec37bc456738acea2e1038de5b0f32fe7e83984037d7ad1ed921737","tests/ui/source-enum-not-error.stderr":"feac587e2436fd7bed73e7265dceb31b495587f1a8eea5c5fefd9da66b912dac","tests/ui/source-struct-not-error.rs":"09fb7713637242dca9192585a6daeb8d732dc1c1d0fa522b74f1c98618e6d949","tests/ui/source-struct-not-error.stderr":"66fb5fa85d59f11d8b5f7ec99469a843c51943b0010e554bdf56376a0614a2ca","tests/ui/transparent-display.rs":"b3c59583eb64b0b5a246444456d03cf52d51bcdc08885023600dbb44fd87e5f2","tests/ui/transparent-display.stderr":"16d538914e0d92026bde4b4bec75660217da9ecc6b621d12d2eb81d33ed1d1da","tests/ui/transparent-enum-many.rs":"2a40a764fb4683bff57973eec61507a6c00f7d4d7a32da6e7bd0190c2e445434","tests/ui/transparent-enum-many.stderr":"f1d78c1d6d8edbef153420db4fb9ca3dc6076fa043b5b1bc0cd291daa417a3ea","tests/ui/transparent-enum-source.rs":"18f606a98ac0a53f08dc56f5f923b9cbe75d25ed34479c777b48dac305d5968c","tests/ui/transparent-enum-source.stderr":"1b2e0ac53951034575d43ec0396c4e2b3cfb272db2aef8d6baa13a7e1632cc84","tests/ui/transparent-struct-many.rs":"72c6b6c1a44c203d3bc68989b2f1ec092531ef75b745432824c3776c290326f6","tests/ui/transparent-struct-many.stderr":"7bd0536dbb54a0ce7d4a8e66ca7624a1b132d8a1d1e4fecca642ec77494ac01c","tests/ui/transparent-struct-source.rs":"863fa691ed7d27e8767da58d9ee11fd40d6642274b36338ca1074c07964ea2b3","tests/ui/transparent-struct-source.stderr":"267dab65929e67d32347fb467a00b43af931f8205d727d7671938580217fc70e","tests/ui/unexpected-field-fmt.rs":"29fba7b4d81c642ec8e47cfe053aa515acf9080a86d65e685363a48993becfe3","tests/ui/unexpected-field-fmt.stderr":"20731c4a08af04bed3ff513903adadd690b6bc532b15604557e7f25575a8338f","tests/ui/unexpected-struct-source.rs":"c6cbe882d622635c216feb8290b1bd536ce0ec4feee16bc087667a21b3641d5c","tests/ui/unexpected-struct-source.stderr":"7c8227513478f6cc09e8a28be337c8a0e758a06ca5978d774c91bd43c4a54043","tests/ui/union.rs":"331adff27cebd8b95b03b6742cc8247331fda1f961e1590ed39c8d39f50cf1d8","tests/ui/union.stderr":"5f67ad29753d6fb14bc03aef7d4a1f660ee7796e469c037efbf8b13456934ad3"},"package":"97a802ec30afc17eee47b2855fc72e0c4cd62be9b4efe6591edde0ec5bd68d8f"}
\ No newline at end of file diff --git a/vendor/thiserror/Cargo.toml b/vendor/thiserror/Cargo.toml index 4d3905b71..3064706bc 100644 --- a/vendor/thiserror/Cargo.toml +++ b/vendor/thiserror/Cargo.toml @@ -10,10 +10,10 @@ # See Cargo.toml.orig for the original contents. [package] -edition = "2018" +edition = "2021" rust-version = "1.56" name = "thiserror" -version = "1.0.40" +version = "1.0.47" authors = ["David Tolnay <dtolnay@gmail.com>"] description = "derive(Error)" documentation = "https://docs.rs/thiserror" @@ -28,20 +28,21 @@ license = "MIT OR Apache-2.0" repository = "https://github.com/dtolnay/thiserror" [package.metadata.docs.rs] +rustdoc-args = ["--generate-link-to-definition"] targets = ["x86_64-unknown-linux-gnu"] [dependencies.thiserror-impl] -version = "=1.0.40" +version = "=1.0.47" [dev-dependencies.anyhow] -version = "1.0.65" +version = "1.0.73" [dev-dependencies.ref-cast] -version = "1.0" +version = "1.0.18" [dev-dependencies.rustversion] -version = "1.0" +version = "1.0.13" [dev-dependencies.trybuild] -version = "1.0.66" +version = "1.0.81" features = ["diff"] diff --git a/vendor/thiserror/build.rs b/vendor/thiserror/build.rs index 004dfb015..7983a2b07 100644 --- a/vendor/thiserror/build.rs +++ b/vendor/thiserror/build.rs @@ -4,27 +4,56 @@ use std::path::Path; use std::process::{Command, ExitStatus, Stdio}; use std::str; -// This code exercises the surface area that we expect of the Provider API. If -// the current toolchain is able to compile it, then thiserror is able to use -// providers for backtrace support. +// This code exercises the surface area that we expect of the Error generic +// member access API. If the current toolchain is able to compile it, then +// thiserror is able to provide backtrace support. const PROBE: &str = r#" - #![feature(provide_any)] + #![feature(error_generic_member_access)] - use std::any::{Demand, Provider}; + use std::error::{Error, Request}; + use std::fmt::{self, Debug, Display}; - fn _f<'a, P: Provider>(p: &'a P, demand: &mut Demand<'a>) { - p.provide(demand); + struct MyError(Thing); + struct Thing; + + impl Debug for MyError { + fn fmt(&self, _formatter: &mut fmt::Formatter) -> fmt::Result { + unimplemented!() + } + } + + impl Display for MyError { + fn fmt(&self, _formatter: &mut fmt::Formatter) -> fmt::Result { + unimplemented!() + } + } + + impl Error for MyError { + fn provide<'a>(&'a self, request: &mut Request<'a>) { + request.provide_ref(&self.0); + } } "#; fn main() { match compile_probe() { - Some(status) if status.success() => println!("cargo:rustc-cfg=provide_any"), + Some(status) if status.success() => println!("cargo:rustc-cfg=error_generic_member_access"), _ => {} } } fn compile_probe() -> Option<ExitStatus> { + if env::var_os("RUSTC_STAGE").is_some() { + // We are running inside rustc bootstrap. This is a highly non-standard + // environment with issues such as: + // + // https://github.com/rust-lang/cargo/issues/11138 + // https://github.com/rust-lang/rust/issues/114839 + // + // Let's just not use nightly features here. + return None; + } + let rustc = env::var_os("RUSTC")?; let out_dir = env::var_os("OUT_DIR")?; let probefile = Path::new(&out_dir).join("probe.rs"); diff --git a/vendor/thiserror/src/aserror.rs b/vendor/thiserror/src/aserror.rs index 5fea84ef8..54fc6f119 100644 --- a/vendor/thiserror/src/aserror.rs +++ b/vendor/thiserror/src/aserror.rs @@ -1,6 +1,7 @@ use std::error::Error; use std::panic::UnwindSafe; +#[doc(hidden)] pub trait AsDynError<'a>: Sealed { fn as_dyn_error(&self) -> &(dyn Error + 'a); } @@ -40,6 +41,7 @@ impl<'a> AsDynError<'a> for dyn Error + Send + Sync + UnwindSafe + 'a { } } +#[doc(hidden)] pub trait Sealed {} impl<'a, T: Error + 'a> Sealed for T {} impl<'a> Sealed for dyn Error + 'a {} diff --git a/vendor/thiserror/src/display.rs b/vendor/thiserror/src/display.rs index 0eb0dd9e2..da4905115 100644 --- a/vendor/thiserror/src/display.rs +++ b/vendor/thiserror/src/display.rs @@ -1,6 +1,7 @@ use std::fmt::Display; use std::path::{self, Path, PathBuf}; +#[doc(hidden)] pub trait DisplayAsDisplay { fn as_display(&self) -> Self; } @@ -11,6 +12,7 @@ impl<T: Display> DisplayAsDisplay for &T { } } +#[doc(hidden)] pub trait PathAsDisplay { fn as_display(&self) -> path::Display<'_>; } diff --git a/vendor/thiserror/src/lib.rs b/vendor/thiserror/src/lib.rs index 94bd86094..e5d295062 100644 --- a/vendor/thiserror/src/lib.rs +++ b/vendor/thiserror/src/lib.rs @@ -228,7 +228,7 @@ //! //! [`anyhow`]: https://github.com/dtolnay/anyhow -#![doc(html_root_url = "https://docs.rs/thiserror/1.0.40")] +#![doc(html_root_url = "https://docs.rs/thiserror/1.0.47")] #![allow( // Clippy bug: https://github.com/rust-lang/rust-clippy/issues/7421 clippy::doc_markdown, @@ -236,11 +236,11 @@ clippy::return_self_not_must_use, clippy::wildcard_imports, )] -#![cfg_attr(provide_any, feature(provide_any))] +#![cfg_attr(error_generic_member_access, feature(error_generic_member_access))] mod aserror; mod display; -#[cfg(provide_any)] +#[cfg(error_generic_member_access)] mod provide; pub use thiserror_impl::*; @@ -248,8 +248,11 @@ pub use thiserror_impl::*; // Not public API. #[doc(hidden)] pub mod __private { + #[doc(hidden)] pub use crate::aserror::AsDynError; + #[doc(hidden)] pub use crate::display::{DisplayAsDisplay, PathAsDisplay}; - #[cfg(provide_any)] + #[cfg(error_generic_member_access)] + #[doc(hidden)] pub use crate::provide::ThiserrorProvide; } diff --git a/vendor/thiserror/src/provide.rs b/vendor/thiserror/src/provide.rs index 524e7435d..7b4e92238 100644 --- a/vendor/thiserror/src/provide.rs +++ b/vendor/thiserror/src/provide.rs @@ -1,15 +1,20 @@ -use std::any::{Demand, Provider}; +use std::error::{Error, Request}; +#[doc(hidden)] pub trait ThiserrorProvide: Sealed { - fn thiserror_provide<'a>(&'a self, demand: &mut Demand<'a>); + fn thiserror_provide<'a>(&'a self, request: &mut Request<'a>); } -impl<T: Provider + ?Sized> ThiserrorProvide for T { +impl<T> ThiserrorProvide for T +where + T: Error + ?Sized, +{ #[inline] - fn thiserror_provide<'a>(&'a self, demand: &mut Demand<'a>) { - self.provide(demand); + fn thiserror_provide<'a>(&'a self, request: &mut Request<'a>) { + self.provide(request); } } +#[doc(hidden)] pub trait Sealed {} -impl<T: Provider + ?Sized> Sealed for T {} +impl<T: Error + ?Sized> Sealed for T {} diff --git a/vendor/thiserror/tests/test_backtrace.rs b/vendor/thiserror/tests/test_backtrace.rs index 43f68b8b7..4710d45bc 100644 --- a/vendor/thiserror/tests/test_backtrace.rs +++ b/vendor/thiserror/tests/test_backtrace.rs @@ -1,7 +1,4 @@ -#![cfg_attr( - thiserror_nightly_testing, - feature(error_generic_member_access, provide_any) -)] +#![cfg_attr(thiserror_nightly_testing, feature(error_generic_member_access))] use thiserror::Error; @@ -19,9 +16,8 @@ pub struct InnerBacktrace { #[cfg(thiserror_nightly_testing)] pub mod structs { use super::{Inner, InnerBacktrace}; - use std::any; use std::backtrace::Backtrace; - use std::error::Error; + use std::error::{self, Error}; use std::sync::Arc; use thiserror::Error; @@ -106,75 +102,56 @@ pub mod structs { let error = PlainBacktrace { backtrace: Backtrace::capture(), }; - assert!(any::request_ref::<Backtrace>(&error).is_some()); + assert!(error::request_ref::<Backtrace>(&error).is_some()); let error = ExplicitBacktrace { backtrace: Backtrace::capture(), }; - assert!(any::request_ref::<Backtrace>(&error).is_some()); + assert!(error::request_ref::<Backtrace>(&error).is_some()); let error = OptBacktrace { backtrace: Some(Backtrace::capture()), }; - assert!(any::request_ref::<Backtrace>(&error).is_some()); + assert!(error::request_ref::<Backtrace>(&error).is_some()); let error = ArcBacktrace { backtrace: Arc::new(Backtrace::capture()), }; - assert!(any::request_ref::<Backtrace>(&error).is_some()); + assert!(error::request_ref::<Backtrace>(&error).is_some()); let error = BacktraceFrom::from(Inner); - assert!(any::request_ref::<Backtrace>(&error).is_some()); + assert!(error::request_ref::<Backtrace>(&error).is_some()); let error = CombinedBacktraceFrom::from(InnerBacktrace { backtrace: Backtrace::capture(), }); - assert!(any::request_ref::<Backtrace>(&error).is_some()); + assert!(error::request_ref::<Backtrace>(&error).is_some()); let error = OptBacktraceFrom::from(Inner); - assert!(any::request_ref::<Backtrace>(&error).is_some()); + assert!(error::request_ref::<Backtrace>(&error).is_some()); let error = ArcBacktraceFrom::from(Inner); - assert!(any::request_ref::<Backtrace>(&error).is_some()); + assert!(error::request_ref::<Backtrace>(&error).is_some()); let error = AnyhowBacktrace { source: anyhow::Error::msg("..."), }; - assert!(any::request_ref::<Backtrace>(&error).is_some()); + assert!(error::request_ref::<Backtrace>(&error).is_some()); let error = BoxDynErrorBacktrace { source: Box::new(PlainBacktrace { backtrace: Backtrace::capture(), }), }; - assert!(any::request_ref::<Backtrace>(&error).is_some()); - } - - // https://github.com/dtolnay/thiserror/issues/185 -- std::error::Error and - // std::any::Provide both have a method called 'provide', so directly - // calling it from generated code could be ambiguous. - #[test] - fn test_provide_name_collision() { - use std::any::Provider; - - #[derive(Error, Debug)] - #[error("...")] - struct MyError { - #[source] - #[backtrace] - x: std::io::Error, - } - - let _: dyn Error; - let _: dyn Provider; + assert!(error::request_ref::<Backtrace>(&error).is_some()); } } #[cfg(thiserror_nightly_testing)] pub mod enums { use super::{Inner, InnerBacktrace}; - use std::any; use std::backtrace::Backtrace; + use std::error; use std::sync::Arc; use thiserror::Error; @@ -259,36 +236,36 @@ pub mod enums { let error = PlainBacktrace::Test { backtrace: Backtrace::capture(), }; - assert!(any::request_ref::<Backtrace>(&error).is_some()); + assert!(error::request_ref::<Backtrace>(&error).is_some()); let error = ExplicitBacktrace::Test { backtrace: Backtrace::capture(), }; - assert!(any::request_ref::<Backtrace>(&error).is_some()); + assert!(error::request_ref::<Backtrace>(&error).is_some()); let error = OptBacktrace::Test { backtrace: Some(Backtrace::capture()), }; - assert!(any::request_ref::<Backtrace>(&error).is_some()); + assert!(error::request_ref::<Backtrace>(&error).is_some()); let error = ArcBacktrace::Test { backtrace: Arc::new(Backtrace::capture()), }; - assert!(any::request_ref::<Backtrace>(&error).is_some()); + assert!(error::request_ref::<Backtrace>(&error).is_some()); let error = BacktraceFrom::from(Inner); - assert!(any::request_ref::<Backtrace>(&error).is_some()); + assert!(error::request_ref::<Backtrace>(&error).is_some()); let error = CombinedBacktraceFrom::from(InnerBacktrace { backtrace: Backtrace::capture(), }); - assert!(any::request_ref::<Backtrace>(&error).is_some()); + assert!(error::request_ref::<Backtrace>(&error).is_some()); let error = OptBacktraceFrom::from(Inner); - assert!(any::request_ref::<Backtrace>(&error).is_some()); + assert!(error::request_ref::<Backtrace>(&error).is_some()); let error = ArcBacktraceFrom::from(Inner); - assert!(any::request_ref::<Backtrace>(&error).is_some()); + assert!(error::request_ref::<Backtrace>(&error).is_some()); } } diff --git a/vendor/thiserror/tests/test_option.rs b/vendor/thiserror/tests/test_option.rs index ed5287dc9..232e5a3bb 100644 --- a/vendor/thiserror/tests/test_option.rs +++ b/vendor/thiserror/tests/test_option.rs @@ -1,7 +1,4 @@ -#![cfg_attr( - thiserror_nightly_testing, - feature(error_generic_member_access, provide_any) -)] +#![cfg_attr(thiserror_nightly_testing, feature(error_generic_member_access))] #[cfg(thiserror_nightly_testing)] pub mod structs { |