Add delay span bug

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
This commit is contained in:
hi-rustin 2022-11-21 20:03:28 +08:00
parent a60e267200
commit fec6ffc816

View file

@ -47,7 +47,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
let to = normalize(to);
trace!(?from, ?to);
if from.has_non_region_infer() || to.has_non_region_infer() {
// We can't check anything if there are inference variables.
tcx.sess.delay_span_bug(span, "argument to transmute has inference variables");
return;
}
// Transmutes that are only changing lifetimes are always ok.