mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
Rollup merge of #125158 - Nilstrieb:block-indent, r=compiler-errors
hir pretty: fix block indent before: ```rust fn main() { { { ::std::io::_print(format_arguments::new_const(&["Hello, world!\n"])); }; } } ``` after: ```rust fn main() { { { ::std::io::_print(format_arguments::new_const(&["Hello, world!\n"])); }; } } ``` AST pretty does the same.
This commit is contained in:
commit
4b26045b92
@ -1454,7 +1454,7 @@ impl<'a> State<'a> {
|
||||
self.word_space(":");
|
||||
}
|
||||
// containing cbox, will be closed by print-block at `}`
|
||||
self.cbox(INDENT_UNIT);
|
||||
self.cbox(0);
|
||||
// head-box, will be closed by print-block after `{`
|
||||
self.ibox(0);
|
||||
self.print_block(blk);
|
||||
|
@ -17,9 +17,9 @@ fn bar() ({
|
||||
let _: [(); (1 as usize)] = ([(() as ())] as [(); 1]);
|
||||
|
||||
let _ =
|
||||
(((&([(1 as i32), (2 as i32), (3 as i32)] as [i32; 3]) as
|
||||
&[i32; 3]) as *const _ as *const [i32; 3]) as
|
||||
*const [i32; (3 as usize)] as *const [i32; 3]);
|
||||
(((&([(1 as i32), (2 as i32), (3 as i32)] as [i32; 3]) as &[i32; 3])
|
||||
as *const _ as *const [i32; 3]) as *const [i32; (3 as usize)]
|
||||
as *const [i32; 3]);
|
||||
|
||||
|
||||
|
||||
|
@ -9,7 +9,7 @@ fn main() {
|
||||
let x = 1;
|
||||
// Should flatten to println!("a 123 b {x} xyz\n"):
|
||||
{
|
||||
::std::io::_print(format_arguments::new_v1(&["a 123 b ",
|
||||
" xyz\n"], &[format_argument::new_display(&x)]));
|
||||
::std::io::_print(format_arguments::new_v1(&["a 123 b ", " xyz\n"],
|
||||
&[format_argument::new_display(&x)]));
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user