mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Fix #[rustc_const_panic_str] functions not actually being hooked
This commit is contained in:
parent
5df690e13f
commit
a9140e197c
3 changed files with 26 additions and 18 deletions
|
@ -1378,8 +1378,9 @@ mod panic {
|
|||
// Special-case the single-argument case for const_panic.
|
||||
("{}", $arg:expr $(,)?) => ({
|
||||
#[rustc_const_panic_str] // enforce a &&str argument in const-check and hook this by const-eval
|
||||
#[rustc_do_not_const_check] // hooked by const-eval
|
||||
const fn panic_cold_display<T: $crate::fmt::Display>(arg: &T) -> ! {
|
||||
loop {}
|
||||
$crate::panicking::panic_display(arg)
|
||||
}
|
||||
panic_cold_display(&$arg);
|
||||
}),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue