Skip to content

Commit

Permalink
Continue running after typeck_item_bodies has failed
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Mar 15, 2019
1 parent e03588b commit 4a90349
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
9 changes: 4 additions & 5 deletions src/librustc_typeck/check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 5 additions & 1 deletion src/test/ui/issues/issue-26217.rs
Original file line number Diff line number Diff line change
@@ -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();
}

0 comments on commit 4a90349

Please sign in to comment.