diff options
| author | bors <bors@rust-lang.org> | 2025-07-31 08:54:41 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-07-31 08:54:41 +0000 |
| commit | 64ca23b6235732fa61c0a2b957c5d7e591e7c972 (patch) | |
| tree | 4688ea8f1bef26095df721f0a4344b64e2e66f03 /compiler/rustc_errors/src | |
| parent | cc0a5b73053c62a3df5f84b3ee85079c9b65fa87 (diff) | |
| parent | 017586c93abe3b7e6f495a1f2bf34df4f3693411 (diff) | |
| download | rust-64ca23b6235732fa61c0a2b957c5d7e591e7c972.tar.gz rust-64ca23b6235732fa61c0a2b957c5d7e591e7c972.zip | |
Auto merge of #144723 - Zalathar:rollup-f9e0rfo, r=Zalathar
Rollup of 3 pull requests Successful merges: - rust-lang/rust#144657 (fix: Only "close the window" when its the last annotated file) - rust-lang/rust#144665 (Re-block SRoA on SIMD types) - rust-lang/rust#144713 (`rustc_middle::ty` cleanups) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_errors/src')
| -rw-r--r-- | compiler/rustc_errors/src/emitter.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/rustc_errors/src/emitter.rs b/compiler/rustc_errors/src/emitter.rs index 46a4a186824..3fe525df94f 100644 --- a/compiler/rustc_errors/src/emitter.rs +++ b/compiler/rustc_errors/src/emitter.rs @@ -1597,8 +1597,9 @@ impl HumanEmitter { annotated_files.swap(0, pos); } + let annotated_files_len = annotated_files.len(); // Print out the annotate source lines that correspond with the error - for annotated_file in annotated_files { + for (file_idx, annotated_file) in annotated_files.into_iter().enumerate() { // we can't annotate anything if the source is unavailable. if !should_show_source_code( &self.ignored_directories_in_source_blocks, @@ -1855,7 +1856,9 @@ impl HumanEmitter { width_offset, code_offset, margin, - !is_cont && line_idx + 1 == annotated_file.lines.len(), + !is_cont + && file_idx + 1 == annotated_files_len + && line_idx + 1 == annotated_file.lines.len(), ); let mut to_add = FxHashMap::default(); |
