Make const parent errors delay_span_bugs

This commit is contained in:
varkor 2019-05-10 20:53:21 +01:00
parent cff1bdbd77
commit 385d012d9e

View File

@ -1404,7 +1404,13 @@ pub fn checked_type_of<'a, 'tcx>(
if !fail {
return None;
}
bug!("unexpected const parent path def {:?}", x);
tcx.sess.delay_span_bug(
DUMMY_SP,
&format!(
"unexpected const parent path def {:?}", x
),
);
tcx.types.err
}
}
}
@ -1412,7 +1418,13 @@ pub fn checked_type_of<'a, 'tcx>(
if !fail {
return None;
}
bug!("unexpected const parent path {:?}", x);
tcx.sess.delay_span_bug(
DUMMY_SP,
&format!(
"unexpected const parent path {:?}", x
),
);
tcx.types.err
}
}
}
@ -1421,7 +1433,13 @@ pub fn checked_type_of<'a, 'tcx>(
if !fail {
return None;
}
bug!("unexpected const parent in type_of_def_id(): {:?}", x);
tcx.sess.delay_span_bug(
DUMMY_SP,
&format!(
"unexpected const parent in type_of_def_id(): {:?}", x
),
);
tcx.types.err
}
}
}