Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitad0667f

Browse files
committed
Add note on panic payload type.
1 parent518722e commitad0667f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

‎std/src/panic.rs‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,13 @@ impl<'a> PanicHookInfo<'a> {
6363
///
6464
/// This will commonly, but not always, be a `&'static str` or [`String`].
6565
///
66+
/// A invocation of the `panic!()` macro in Rust 2021 or later will always result in a
67+
/// panic payload of type `&'static str` or `String`.
68+
///
69+
/// Only an invocation of [`panic_any`]
70+
/// (or, in Rust 2018 and earlier, `panic!(x)` where `x` is something other than a string)
71+
/// can result in a panic payload other than a `&'static str` or `String`.
72+
///
6673
/// [`String`]: ../../std/string/struct.String.html
6774
///
6875
/// # Examples

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp