1
Fork 0

Partially outline code inside the panic! macro

This commit is contained in:
John Kåre Alsaker 2023-09-03 06:31:56 +02:00
parent 15e52b05ca
commit 6a02baaa3d
11 changed files with 117 additions and 30 deletions

View file

@ -207,7 +207,7 @@ impl<'mir, 'tcx: 'mir> CompileTimeEvalContext<'mir, 'tcx> {
) -> InterpResult<'tcx, Option<ty::Instance<'tcx>>> {
let def_id = instance.def_id();
if Some(def_id) == self.tcx.lang_items().panic_display()
if self.tcx.has_attr(def_id, sym::rustc_const_panic_str)
|| Some(def_id) == self.tcx.lang_items().begin_panic_fn()
{
let args = self.copy_fn_args(args)?;