summaryrefslogtreecommitdiffstats
path: root/library/core/src/panic/panic_info.rs
diff options
context:
space:
mode:
Diffstat (limited to 'library/core/src/panic/panic_info.rs')
-rw-r--r--library/core/src/panic/panic_info.rs15
1 files changed, 14 insertions, 1 deletions
diff --git a/library/core/src/panic/panic_info.rs b/library/core/src/panic/panic_info.rs
index c7f04f11e..c77e9675a 100644
--- a/library/core/src/panic/panic_info.rs
+++ b/library/core/src/panic/panic_info.rs
@@ -28,6 +28,7 @@ pub struct PanicInfo<'a> {
message: Option<&'a fmt::Arguments<'a>>,
location: &'a Location<'a>,
can_unwind: bool,
+ force_no_backtrace: bool,
}
impl<'a> PanicInfo<'a> {
@@ -42,9 +43,10 @@ impl<'a> PanicInfo<'a> {
message: Option<&'a fmt::Arguments<'a>>,
location: &'a Location<'a>,
can_unwind: bool,
+ force_no_backtrace: bool,
) -> Self {
struct NoPayload;
- PanicInfo { location, message, payload: &NoPayload, can_unwind }
+ PanicInfo { location, message, payload: &NoPayload, can_unwind, force_no_backtrace }
}
#[unstable(
@@ -141,6 +143,17 @@ impl<'a> PanicInfo<'a> {
pub fn can_unwind(&self) -> bool {
self.can_unwind
}
+
+ #[unstable(
+ feature = "panic_internals",
+ reason = "internal details of the implementation of the `panic!` and related macros",
+ issue = "none"
+ )]
+ #[doc(hidden)]
+ #[inline]
+ pub fn force_no_backtrace(&self) -> bool {
+ self.force_no_backtrace
+ }
}
#[stable(feature = "panic_hook_display", since = "1.26.0")]