Skip to content

Commit 385d012

Browse files
committed
Make const parent errors delay_span_bugs
1 parent cff1bdb commit 385d012

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

src/librustc_typeck/collect.rs

+21-3
Original file line numberDiff line numberDiff line change
@@ -1404,15 +1404,27 @@ pub fn checked_type_of<'a, 'tcx>(
14041404
if !fail {
14051405
return None;
14061406
}
1407-
bug!("unexpected const parent path def {:?}", x);
1407+
tcx.sess.delay_span_bug(
1408+
DUMMY_SP,
1409+
&format!(
1410+
"unexpected const parent path def {:?}", x
1411+
),
1412+
);
1413+
tcx.types.err
14081414
}
14091415
}
14101416
}
14111417
x => {
14121418
if !fail {
14131419
return None;
14141420
}
1415-
bug!("unexpected const parent path {:?}", x);
1421+
tcx.sess.delay_span_bug(
1422+
DUMMY_SP,
1423+
&format!(
1424+
"unexpected const parent path {:?}", x
1425+
),
1426+
);
1427+
tcx.types.err
14161428
}
14171429
}
14181430
}
@@ -1421,7 +1433,13 @@ pub fn checked_type_of<'a, 'tcx>(
14211433
if !fail {
14221434
return None;
14231435
}
1424-
bug!("unexpected const parent in type_of_def_id(): {:?}", x);
1436+
tcx.sess.delay_span_bug(
1437+
DUMMY_SP,
1438+
&format!(
1439+
"unexpected const parent in type_of_def_id(): {:?}", x
1440+
),
1441+
);
1442+
tcx.types.err
14251443
}
14261444
}
14271445
}

0 commit comments

Comments
 (0)