| ... | ... | @@ -2195,6 +2195,8 @@ pub fn update(comp: *Compilation, main_progress_node: std.Progress.Node) !void { |
| 2195 | 2195 | |
| 2196 | 2196 | zcu.compile_log_text.shrinkAndFree(gpa, 0); |
| 2197 | 2197 | |
| 2198 | zcu.skip_analysis_errors = false; |
| 2199 | |
| 2198 | 2200 | // Make sure std.zig is inside the import_table. We unconditionally need |
| 2199 | 2201 | // it for start.zig. |
| 2200 | 2202 | const std_mod = zcu.std_mod; |
| ... | ... | @@ -3207,7 +3209,7 @@ pub fn getAllErrorsAlloc(comp: *Compilation) !ErrorBundle { |
| 3207 | 3209 | }); |
| 3208 | 3210 | } |
| 3209 | 3211 | |
| 3210 | | if (comp.zcu) |zcu| { |
| 3212 | if (comp.zcu) |zcu| zcu_errors: { |
| 3211 | 3213 | for (zcu.failed_files.keys(), zcu.failed_files.values()) |file, error_msg| { |
| 3212 | 3214 | if (error_msg) |msg| { |
| 3213 | 3215 | try addModuleErrorMsg(zcu, &bundle, msg.*); |
| ... | ... | @@ -3224,6 +3226,7 @@ pub fn getAllErrorsAlloc(comp: *Compilation) !ErrorBundle { |
| 3224 | 3226 | } |
| 3225 | 3227 | } |
| 3226 | 3228 | } |
| 3229 | if (zcu.skip_analysis_errors) break :zcu_errors; |
| 3227 | 3230 | var sorted_failed_analysis: std.AutoArrayHashMapUnmanaged(InternPool.AnalUnit, *Zcu.ErrorMsg).DataList.Slice = s: { |
| 3228 | 3231 | const SortOrder = struct { |
| 3229 | 3232 | zcu: *Zcu, |
| ... | ... | @@ -3359,7 +3362,7 @@ pub fn getAllErrorsAlloc(comp: *Compilation) !ErrorBundle { |
| 3359 | 3362 | try comp.link_diags.addMessagesToBundle(&bundle, comp.bin_file); |
| 3360 | 3363 | |
| 3361 | 3364 | if (comp.zcu) |zcu| { |
| 3362 | | if (bundle.root_list.items.len == 0 and zcu.compile_log_sources.count() != 0) { |
| 3365 | if (!zcu.skip_analysis_errors and bundle.root_list.items.len == 0 and zcu.compile_log_sources.count() != 0) { |
| 3363 | 3366 | const values = zcu.compile_log_sources.values(); |
| 3364 | 3367 | // First one will be the error; subsequent ones will be notes. |
| 3365 | 3368 | const src_loc = values[0].src(); |
| ... | ... | @@ -3860,10 +3863,9 @@ fn performAllTheWorkInner( |
| 3860 | 3863 | // We give up right now! No updating of ZIR refs, no nothing. The idea is that this prevents |
| 3861 | 3864 | // us from invalidating lots of incremental dependencies due to files with e.g. parse errors. |
| 3862 | 3865 | // However, this means our analysis data is invalid, so we want to omit all analysis errors. |
| 3863 | | // To do that, let's just clear the analysis roots! |
| 3864 | 3866 | |
| 3865 | 3867 | assert(zcu.failed_files.count() > 0); // we will get an error |
| 3866 | | zcu.analysis_roots.clear(); // no analysis happened |
| 3868 | zcu.skip_analysis_errors = true; |
| 3867 | 3869 | return; |
| 3868 | 3870 | } |
| 3869 | 3871 | |