Rollup merge of #88954 - nbdd0121:panic3, r=oli-obk
Allow `panic!("{}", computed_str)` in const fn. Special-case `panic!("{}", arg)` and translate it to `panic_display(&arg)`. `panic_display` will behave like `panic_any` in cosnt eval and behave like `panic!(format_args!("{}", arg))` in runtime. This should bring Rust 2015 and 2021 to feature parity in terms of `const_panic`; and hopefully would unblock the stabilisation of #51999. `@rustbot` modify labels: +T-compiler +T-libs +A-const-eval +A-const-fn r? `@oli-obk`
This commit is contained in:
commit
eb62779f2d
14 changed files with 135 additions and 46 deletions
|
@ -923,6 +923,7 @@ symbols! {
|
|||
panic_2021,
|
||||
panic_abort,
|
||||
panic_bounds_check,
|
||||
panic_display,
|
||||
panic_fmt,
|
||||
panic_handler,
|
||||
panic_impl,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue