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 /library/std/src/backtrace | |
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 'library/std/src/backtrace')
-rw-r--r-- | library/std/src/backtrace/tests.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/library/std/src/backtrace/tests.rs b/library/std/src/backtrace/tests.rs index 4dfbf88e8..73543a3af 100644 --- a/library/std/src/backtrace/tests.rs +++ b/library/std/src/backtrace/tests.rs @@ -1,4 +1,5 @@ use super::*; +use crate::panic::{RefUnwindSafe, UnwindSafe}; fn generate_fake_frames() -> Vec<BacktraceFrame> { vec![ @@ -43,9 +44,8 @@ fn generate_fake_frames() -> Vec<BacktraceFrame> { #[test] fn test_debug() { let backtrace = Backtrace { - inner: Inner::Captured(LazilyResolvedCapture::new(Capture { + inner: Inner::Captured(LazyLock::preinit(Capture { actual_start: 1, - resolved: true, frames: generate_fake_frames(), })), }; @@ -66,9 +66,8 @@ fn test_debug() { #[test] fn test_frames() { let backtrace = Backtrace { - inner: Inner::Captured(LazilyResolvedCapture::new(Capture { + inner: Inner::Captured(LazyLock::preinit(Capture { actual_start: 1, - resolved: true, frames: generate_fake_frames(), })), }; @@ -93,3 +92,9 @@ fn test_frames() { assert!(iter.all(|(f, e)| format!("{f:#?}") == *e)); } + +#[test] +fn backtrace_unwind_safe() { + fn assert_unwind_safe<T: UnwindSafe + RefUnwindSafe>() {} + assert_unwind_safe::<Backtrace>(); +} |