Skip to content

Commit f2f4246

Browse files
committed
hir pretty: fix block indent
1 parent b21b74b commit f2f4246

File tree

8 files changed

+30
-30
lines changed

8 files changed

+30
-30
lines changed

compiler/rustc_hir_pretty/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1454,7 +1454,7 @@ impl<'a> State<'a> {
14541454
self.word_space(":");
14551455
}
14561456
// containing cbox, will be closed by print-block at `}`
1457-
self.cbox(INDENT_UNIT);
1457+
self.cbox(0);
14581458
// head-box, will be closed by print-block after `{`
14591459
self.ibox(0);
14601460
self.print_block(blk);

tests/ui/match/issue-82392.stdout

+7-7
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ extern crate std;
77
//@ check-pass
88

99
fn main() ({
10-
(if (true as bool)
11-
({ } as
12-
()) else if (let Some(a) =
13-
((Some as
14-
fn(i32) -> Option<i32> {Option::<i32>::Some})((3 as i32)) as
15-
Option<i32>) as bool) ({ } as ()) as ())
16-
} as ())
10+
(if (true as bool)
11+
({ } as
12+
()) else if (let Some(a) =
13+
((Some as
14+
fn(i32) -> Option<i32> {Option::<i32>::Some})((3 as i32)) as
15+
Option<i32>) as bool) ({ } as ()) as ())
16+
} as ())

tests/ui/sized/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ LL + let str::as_bytes;
2525
|
2626

2727
error[E0533]: expected unit struct, unit variant or constant, found associated function `str<{
28-
fn str() { let (/*ERROR*/); }
29-
}, T>::as_bytes`
28+
fn str() { let (/*ERROR*/); }
29+
}, T>::as_bytes`
3030
--> $DIR/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.rs:2:9
3131
|
3232
LL | let str::<{fn str() { let str::T>>::as_bytes; }}, T>::as_bytes;

tests/ui/type-alias-impl-trait/issue-60662.stdout

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ extern crate std;
1010
trait Animal { }
1111

1212
fn main() {
13-
type ServeFut = /*impl Trait*/;
14-
}
13+
type ServeFut = /*impl Trait*/;
14+
}

tests/ui/unpretty/bad-literal.stdout

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ extern crate std;
77

88
// In #100948 this caused an ICE with -Zunpretty=hir.
99
fn main() {
10-
<bad-literal>;
11-
}
10+
<bad-literal>;
11+
}

tests/ui/unpretty/box.stdout

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use ::std::prelude::rust_2015::*;
88
extern crate std;
99

1010
fn main() {
11-
let _ =
12-
#[rustc_box]
13-
Box::new(1);
14-
}
11+
let _ =
12+
#[rustc_box]
13+
Box::new(1);
14+
}

tests/ui/unpretty/flattened-format-args.stdout

+7-7
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ extern crate std;
66
//@ check-pass
77

88
fn main() {
9-
let x = 1;
10-
// Should flatten to println!("a 123 b {x} xyz\n"):
11-
{
12-
::std::io::_print(format_arguments::new_v1(&["a 123 b ",
13-
" xyz\n"], &[format_argument::new_display(&x)]));
14-
};
15-
}
9+
let x = 1;
10+
// Should flatten to println!("a 123 b {x} xyz\n"):
11+
{
12+
::std::io::_print(format_arguments::new_v1(&["a 123 b ", " xyz\n"],
13+
&[format_argument::new_display(&x)]));
14+
};
15+
}

tests/ui/unpretty/let-else-hir.stdout

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ extern crate std;
99

1010
fn foo(x:
1111
Option<u32>) {
12-
let Some(_) = x else
13-
{
12+
let Some(_) = x else
13+
{
1414

15-
{ ::std::rt::begin_panic("explicit panic") }
16-
};
17-
}
15+
{ ::std::rt::begin_panic("explicit panic") }
16+
};
17+
}
1818
fn main() { }

0 commit comments

Comments
 (0)