File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,24 @@ impl<'a> PanicInfo<'a> {
8181 Some ( & self . location )
8282 }
8383
84+ /// Returns the payload associated with the panic.
85+ ///
86+ /// On `core::panic::PanicInfo`, this method never returns anything useful.
87+ /// It only exists because of compatibility with [`std::panic::PanicInfo`],
88+ /// which used to be the same type.
89+ ///
90+ /// See [`std::panic::PanicInfo::payload`].
91+ ///
92+ /// [`std::panic::PanicInfo`]: ../../std/panic/struct.PanicInfo.html
93+ /// [`std::panic::PanicInfo::payload`]: ../../std/panic/struct.PanicInfo.html#method.payload
94+ #[ deprecated( since = "1.74.0" , note = "this never returns anything useful" ) ]
95+ #[ stable( feature = "panic_hooks" , since = "1.10.0" ) ]
96+ #[ allow( deprecated, deprecated_in_future) ]
97+ pub fn payload ( & self ) -> & ( dyn crate :: any:: Any + Send ) {
98+ struct NoPayload ;
99+ & NoPayload
100+ }
101+
84102 /// Returns whether the panic handler is allowed to unwind the stack from
85103 /// the point where the panic occurred.
86104 ///
You can’t perform that action at this time.
0 commit comments