]> git.lizzy.rs Git - rust.git/commitdiff
Continue running after `typeck_item_bodies` has failed
authorEsteban Küber <esteban@kuber.com.ar>
Fri, 15 Mar 2019 02:29:02 +0000 (19:29 -0700)
committerEsteban Küber <esteban@kuber.com.ar>
Sat, 23 Mar 2019 03:15:32 +0000 (20:15 -0700)
src/librustc_typeck/check/mod.rs
src/test/ui/issues/issue-26217.rs

index ab0e4b086bc77492b53ca6e21c0e786da195e8f7..9cba51741367d8d6a1507a2d91ab307beb1c3bb1 100644 (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) {
index a700807d7f2160012221330e0eea3c2adb9e18b3..05e046219090689560f741ceee2bf004e952062e 100644 (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();
+}