fix: Only add extra padding to the first group's last file
This commit is contained in:
parent
7c2c3c0ded
commit
1befb0bac0
2 changed files with 2 additions and 2 deletions
|
|
@ -213,6 +213,7 @@ impl AnnotateSnippetEmitter {
|
|||
file_ann.swap(0, pos);
|
||||
}
|
||||
|
||||
let file_ann_len = file_ann.len();
|
||||
for (file_idx, (file, annotations)) in file_ann.into_iter().enumerate() {
|
||||
if should_show_source_code(&self.ignored_directories_in_source_blocks, sm, &file) {
|
||||
if let Some(snippet) = self.annotated_snippet(annotations, &file.name, sm) {
|
||||
|
|
@ -240,6 +241,7 @@ impl AnnotateSnippetEmitter {
|
|||
// ╰ warning: this was previously accepted
|
||||
if let Some(c) = children.first()
|
||||
&& (!c.span.has_primary_spans() && !c.span.has_span_labels())
|
||||
&& file_idx == file_ann_len - 1
|
||||
{
|
||||
group = group.element(Padding);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ LL | println!();
|
|||
error: macro expansion ignores `{` and any tokens following
|
||||
--> $SRC_DIR/std/src/macros.rs:LL:COL
|
||||
|
|
||||
|
|
||||
::: $DIR/main-alongside-macro-calls.rs:30:1
|
||||
|
|
||||
LL | println!();
|
||||
|
|
@ -42,7 +41,6 @@ LL | println!();
|
|||
error: macro expansion ignores `{` and any tokens following
|
||||
--> $SRC_DIR/std/src/macros.rs:LL:COL
|
||||
|
|
||||
|
|
||||
::: $DIR/main-alongside-macro-calls.rs:34:1
|
||||
|
|
||||
LL | println!();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue