mirror of https://github.com/rust-lang/rust.git
Correctly close indentation blocks when pretty printing non-inline module
This commit is contained in:
parent
81a8ee8fc4
commit
23ee94e92b
|
@ -1268,13 +1268,14 @@ impl<'a> State<'a> {
|
||||||
self.print_ident(item.ident)?;
|
self.print_ident(item.ident)?;
|
||||||
|
|
||||||
if _mod.inline || self.is_expanded {
|
if _mod.inline || self.is_expanded {
|
||||||
println!("Going to print inline anyway");
|
|
||||||
self.nbsp()?;
|
self.nbsp()?;
|
||||||
self.bopen()?;
|
self.bopen()?;
|
||||||
self.print_mod(_mod, &item.attrs)?;
|
self.print_mod(_mod, &item.attrs)?;
|
||||||
self.bclose(item.span)?;
|
self.bclose(item.span)?;
|
||||||
} else {
|
} else {
|
||||||
self.s.word(";")?;
|
self.s.word(";")?;
|
||||||
|
self.end()?; // end inner head-block
|
||||||
|
self.end()?; // end outer head-block
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,8 +8,9 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// pp-exact:issue_12590_c.pp
|
// pretty-compare-only
|
||||||
// pretty-mode:expanded
|
// pretty-mode:expanded
|
||||||
|
// pp-exact:issue_12590_c.pp
|
||||||
|
|
||||||
// The next line should be expanded
|
// The next line should be expanded
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue