diff --git a/compiler/rustc_hir_pretty/src/lib.rs b/compiler/rustc_hir_pretty/src/lib.rs index 29c7e576d2b..488537e81be 100644 --- a/compiler/rustc_hir_pretty/src/lib.rs +++ b/compiler/rustc_hir_pretty/src/lib.rs @@ -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); diff --git a/tests/pretty/issue-4264.pp b/tests/pretty/issue-4264.pp index af64260d020..4d43db5716e 100644 --- a/tests/pretty/issue-4264.pp +++ b/tests/pretty/issue-4264.pp @@ -11,15 +11,15 @@ extern crate std; fn foo(_: [i32; (3 as usize)]) ({ } as ()) fn bar() ({ - const FOO: usize = ((5 as usize) - (4 as usize) as usize); - let _: [(); (FOO as usize)] = ([(() as ())] as [(); 1]); + const FOO: usize = ((5 as usize) - (4 as usize) as usize); + let _: [(); (FOO as usize)] = ([(() as ())] as [(); 1]); - let _: [(); (1 as usize)] = ([(() as ())] as [(); 1]); + 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]); + 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]); @@ -29,17 +29,17 @@ fn bar() ({ - ({ - let res = - ((::alloc::fmt::format as - for<'a> fn(Arguments<'a>) -> String {format})(((format_arguments::new_const - as - fn(&[&'static str]) -> Arguments<'_> {Arguments::<'_>::new_const})((&([("test" - as &str)] as [&str; 1]) as &[&str; 1])) as Arguments<'_>)) - as String); - (res as String) - } as String); - } as ()) + ({ + let res = + ((::alloc::fmt::format as + for<'a> fn(Arguments<'a>) -> String {format})(((format_arguments::new_const + as + fn(&[&'static str]) -> Arguments<'_> {Arguments::<'_>::new_const})((&([("test" + as &str)] as [&str; 1]) as &[&str; 1])) as Arguments<'_>)) + as String); + (res as String) + } as String); +} as ()) type Foo = [i32; (3 as usize)]; struct Bar { x: [i32; (3 as usize)], @@ -48,9 +48,9 @@ struct TupleBar([i32; (4 as usize)]); enum Baz { BazVariant([i32; (5 as usize)]), } fn id(x: T) -> T ({ (x as T) } as T) fn use_id() ({ - let _ = - ((id::<[i32; (3 as usize)]> as - fn([i32; 3]) -> [i32; 3] {id::<[i32; 3]>})(([(1 as i32), - (2 as i32), (3 as i32)] as [i32; 3])) as [i32; 3]); - } as ()) + let _ = + ((id::<[i32; (3 as usize)]> as + fn([i32; 3]) -> [i32; 3] {id::<[i32; 3]>})(([(1 as i32), + (2 as i32), (3 as i32)] as [i32; 3])) as [i32; 3]); +} as ()) fn main() ({ } as ()) diff --git a/tests/ui/match/issue-82392.stdout b/tests/ui/match/issue-82392.stdout index 8a23d906757..8949611ac12 100644 --- a/tests/ui/match/issue-82392.stdout +++ b/tests/ui/match/issue-82392.stdout @@ -7,10 +7,10 @@ extern crate std; //@ check-pass fn main() ({ - (if (true as bool) - ({ } as - ()) else if (let Some(a) = - ((Some as - fn(i32) -> Option {Option::::Some})((3 as i32)) as - Option) as bool) ({ } as ()) as ()) - } as ()) + (if (true as bool) + ({ } as + ()) else if (let Some(a) = + ((Some as + fn(i32) -> Option {Option::::Some})((3 as i32)) as + Option) as bool) ({ } as ()) as ()) + } as ()) diff --git a/tests/ui/sized/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.stderr b/tests/ui/sized/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.stderr index 8df0613695b..99f8dbd9a6c 100644 --- a/tests/ui/sized/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.stderr +++ b/tests/ui/sized/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.stderr @@ -25,8 +25,8 @@ LL + let str::as_bytes; | error[E0533]: expected unit struct, unit variant or constant, found associated function `str<{ - fn str() { let (/*ERROR*/); } - }, T>::as_bytes` + fn str() { let (/*ERROR*/); } + }, T>::as_bytes` --> $DIR/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.rs:2:9 | LL | let str::<{fn str() { let str::T>>::as_bytes; }}, T>::as_bytes; diff --git a/tests/ui/type-alias-impl-trait/issue-60662.stdout b/tests/ui/type-alias-impl-trait/issue-60662.stdout index e643dba1245..b541cbeb227 100644 --- a/tests/ui/type-alias-impl-trait/issue-60662.stdout +++ b/tests/ui/type-alias-impl-trait/issue-60662.stdout @@ -10,5 +10,5 @@ extern crate std; trait Animal { } fn main() { - type ServeFut = /*impl Trait*/; - } + type ServeFut = /*impl Trait*/; +} diff --git a/tests/ui/unpretty/bad-literal.stdout b/tests/ui/unpretty/bad-literal.stdout index 07ecb99dccc..c5272711d6e 100644 --- a/tests/ui/unpretty/bad-literal.stdout +++ b/tests/ui/unpretty/bad-literal.stdout @@ -7,5 +7,5 @@ extern crate std; // In #100948 this caused an ICE with -Zunpretty=hir. fn main() { - ; - } + ; +} diff --git a/tests/ui/unpretty/box.stdout b/tests/ui/unpretty/box.stdout index 0fd51edea24..e3b9b9ac207 100644 --- a/tests/ui/unpretty/box.stdout +++ b/tests/ui/unpretty/box.stdout @@ -8,7 +8,7 @@ use ::std::prelude::rust_2015::*; extern crate std; fn main() { - let _ = - #[rustc_box] - Box::new(1); - } + let _ = + #[rustc_box] + Box::new(1); +} diff --git a/tests/ui/unpretty/flattened-format-args.stdout b/tests/ui/unpretty/flattened-format-args.stdout index 275fa104e66..2de1cdd96b5 100644 --- a/tests/ui/unpretty/flattened-format-args.stdout +++ b/tests/ui/unpretty/flattened-format-args.stdout @@ -6,10 +6,10 @@ extern crate std; //@ check-pass 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)])); - }; - } + 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)])); + }; +} diff --git a/tests/ui/unpretty/let-else-hir.stdout b/tests/ui/unpretty/let-else-hir.stdout index ed55f293876..a2ffa5de567 100644 --- a/tests/ui/unpretty/let-else-hir.stdout +++ b/tests/ui/unpretty/let-else-hir.stdout @@ -9,10 +9,10 @@ extern crate std; fn foo(x: Option) { - let Some(_) = x else - { + let Some(_) = x else + { - { ::std::rt::begin_panic("explicit panic") } - }; - } + { ::std::rt::begin_panic("explicit panic") } + }; +} fn main() { }