Skip to content

Commit 23ee94e

Browse files
committed
Correctly close indentation blocks when pretty printing non-inline module
1 parent 81a8ee8 commit 23ee94e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/libsyntax/print/pprust.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1268,13 +1268,14 @@ impl<'a> State<'a> {
12681268
self.print_ident(item.ident)?;
12691269

12701270
if _mod.inline || self.is_expanded {
1271-
println!("Going to print inline anyway");
12721271
self.nbsp()?;
12731272
self.bopen()?;
12741273
self.print_mod(_mod, &item.attrs)?;
12751274
self.bclose(item.span)?;
12761275
} else {
12771276
self.s.word(";")?;
1277+
self.end()?; // end inner head-block
1278+
self.end()?; // end outer head-block
12781279
}
12791280

12801281
}

src/test/pretty/issue_12590_c.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// pp-exact:issue_12590_c.pp
11+
// pretty-compare-only
1212
// pretty-mode:expanded
13+
// pp-exact:issue_12590_c.pp
1314

1415
// The next line should be expanded
1516

0 commit comments

Comments
 (0)