Fix const core::panic!(non_literal_str).

This commit is contained in:
Mara Bos
2020-09-05 17:26:11 +02:00
parent 500ddc5efd
commit 4f7ffbf351
6 changed files with 15 additions and 3 deletions

View File

@@ -70,9 +70,10 @@ impl<'mir, 'tcx> InterpCx<'mir, 'tcx, CompileTimeInterpreter<'mir, 'tcx>> {
) -> InterpResult<'tcx> {
let def_id = instance.def_id();
if Some(def_id) == self.tcx.lang_items().panic_fn()
|| Some(def_id) == self.tcx.lang_items().panic_str()
|| Some(def_id) == self.tcx.lang_items().begin_panic_fn()
{
// &'static str
// &str
assert!(args.len() == 1);
let msg_place = self.deref_operand(args[0])?;