Skip to content

Commit 0a47fd0

Browse files
committed
Correctly close indentation blocks when pretty printing non-inline module
1 parent 8b57111 commit 0a47fd0

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/libsyntax/print/pprust.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1270,13 +1270,14 @@ impl<'a> State<'a> {
12701270
self.print_ident(item.ident)?;
12711271

12721272
if _mod.inline || self.is_expanded {
1273-
println!("Going to print inline anyway");
12741273
self.nbsp()?;
12751274
self.bopen()?;
12761275
self.print_mod(_mod, &item.attrs)?;
12771276
self.bclose(item.span)?;
12781277
} else {
12791278
self.s.word(";")?;
1279+
self.end()?; // end inner head-block
1280+
self.end()?; // end outer head-block
12801281
}
12811282

12821283
}

src/test/pretty/issue_12590_c.rs

+2-1
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)