diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:06:37 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:06:37 +0000 |
commit | 246f239d9f40f633160f0c18f87a20922d4e77bb (patch) | |
tree | 5a88572663584b3d4d28e5a20e10abab1be40884 /vendor/thiserror/tests/test_backtrace.rs | |
parent | Releasing progress-linux version 1.64.0+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-246f239d9f40f633160f0c18f87a20922d4e77bb.tar.xz rustc-246f239d9f40f633160f0c18f87a20922d4e77bb.zip |
Merging debian version 1.65.0+dfsg1-2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | vendor/thiserror/tests/test_backtrace.rs | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/vendor/thiserror/tests/test_backtrace.rs b/vendor/thiserror/tests/test_backtrace.rs index 42e37ca16..052c6f481 100644 --- a/vendor/thiserror/tests/test_backtrace.rs +++ b/vendor/thiserror/tests/test_backtrace.rs @@ -1,4 +1,7 @@ -#![cfg_attr(thiserror_nightly_testing, feature(backtrace))] +#![cfg_attr( + thiserror_nightly_testing, + feature(error_generic_member_access, provide_any) +)] use thiserror::Error; @@ -16,8 +19,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::sync::Arc; use thiserror::Error; @@ -88,44 +91,44 @@ pub mod structs { let error = PlainBacktrace { backtrace: Backtrace::capture(), }; - assert!(error.backtrace().is_some()); + assert!(any::request_ref::<Backtrace>(&error).is_some()); let error = ExplicitBacktrace { backtrace: Backtrace::capture(), }; - assert!(error.backtrace().is_some()); + assert!(any::request_ref::<Backtrace>(&error).is_some()); let error = OptBacktrace { backtrace: Some(Backtrace::capture()), }; - assert!(error.backtrace().is_some()); + assert!(any::request_ref::<Backtrace>(&error).is_some()); let error = ArcBacktrace { backtrace: Arc::new(Backtrace::capture()), }; - assert!(error.backtrace().is_some()); + assert!(any::request_ref::<Backtrace>(&error).is_some()); let error = BacktraceFrom::from(Inner); - assert!(error.backtrace().is_some()); + assert!(any::request_ref::<Backtrace>(&error).is_some()); let error = CombinedBacktraceFrom::from(InnerBacktrace { backtrace: Backtrace::capture(), }); - assert!(error.backtrace().is_some()); + assert!(any::request_ref::<Backtrace>(&error).is_some()); let error = OptBacktraceFrom::from(Inner); - assert!(error.backtrace().is_some()); + assert!(any::request_ref::<Backtrace>(&error).is_some()); let error = ArcBacktraceFrom::from(Inner); - assert!(error.backtrace().is_some()); + assert!(any::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::Error; use std::sync::Arc; use thiserror::Error; @@ -210,36 +213,36 @@ pub mod enums { let error = PlainBacktrace::Test { backtrace: Backtrace::capture(), }; - assert!(error.backtrace().is_some()); + assert!(any::request_ref::<Backtrace>(&error).is_some()); let error = ExplicitBacktrace::Test { backtrace: Backtrace::capture(), }; - assert!(error.backtrace().is_some()); + assert!(any::request_ref::<Backtrace>(&error).is_some()); let error = OptBacktrace::Test { backtrace: Some(Backtrace::capture()), }; - assert!(error.backtrace().is_some()); + assert!(any::request_ref::<Backtrace>(&error).is_some()); let error = ArcBacktrace::Test { backtrace: Arc::new(Backtrace::capture()), }; - assert!(error.backtrace().is_some()); + assert!(any::request_ref::<Backtrace>(&error).is_some()); let error = BacktraceFrom::from(Inner); - assert!(error.backtrace().is_some()); + assert!(any::request_ref::<Backtrace>(&error).is_some()); let error = CombinedBacktraceFrom::from(InnerBacktrace { backtrace: Backtrace::capture(), }); - assert!(error.backtrace().is_some()); + assert!(any::request_ref::<Backtrace>(&error).is_some()); let error = OptBacktraceFrom::from(Inner); - assert!(error.backtrace().is_some()); + assert!(any::request_ref::<Backtrace>(&error).is_some()); let error = ArcBacktraceFrom::from(Inner); - assert!(error.backtrace().is_some()); + assert!(any::request_ref::<Backtrace>(&error).is_some()); } } |