Continue running after typeck_item_bodies has failed

This commit is contained in:
Esteban Küber 2019-03-14 19:29:02 -07:00
parent d1808aa509
commit 936dec8df3
2 changed files with 9 additions and 6 deletions

View File

@ -706,11 +706,10 @@ fn typeck_item_bodies<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, crate_num: CrateNum
-> Result<(), ErrorReported>
{
debug_assert!(crate_num == LOCAL_CRATE);
Ok(tcx.sess.track_errors(|| {
tcx.par_body_owners(|body_owner_def_id| {
tcx.ensure().typeck_tables_of(body_owner_def_id);
});
})?)
tcx.par_body_owners(|body_owner_def_id| {
tcx.ensure().typeck_tables_of(body_owner_def_id);
});
Ok(())
}
fn check_item_well_formed<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) {

View File

@ -1,6 +1,10 @@
fn foo<T>() where for<'a> T: 'a {}
fn main<'a>() {
fn bar<'a>() {
foo::<&'a i32>();
//~^ ERROR the type `&'a i32` does not fulfill the required lifetime
}
fn main() {
bar();
}