We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0a0ad79 + b71362e commit 754f910Copy full SHA for 754f910
src/rust-2021/panic-macro-consistency.md
@@ -2,10 +2,12 @@
2
3
## Summary
4
5
-- `panic!(..)` now always use `format_args!(..)`, just like `println!()`.
+- `panic!(..)` now always uses `format_args!(..)`, just like `println!()`.
6
- `panic!("{")` is no longer accepted, without escaping the `{` as `{{`.
7
- `panic!(x)` is no longer accepted if `x` is not a string literal.
8
-- Use `std::panic::panic_any(x)` to panic with a non-string payload.
+ - Use `std::panic::panic_any(x)` to panic with a non-string payload.
9
+ - Or use `panic!("{}", x)` to use `x`'s `Display` implementation.
10
+- The same applies to `assert!(expr, ..)`.
11
12
## Details
13
0 commit comments