Skip to content

Commit 78c76c3

Browse files
committed
add thir print test
1 parent 77558c8 commit 78c76c3

File tree

3 files changed

+324
-1
lines changed

3 files changed

+324
-1
lines changed

compiler/rustc_mir_build/src/thir/print.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ impl<'a, 'tcx> ThirPrinter<'a, 'tcx> {
320320
print_indented!(self, ")", depth_lvl);
321321
}
322322
LoopMatch { state, region_scope, match_span, arms } => {
323-
print_indented!(self, "LoopMatch (", depth_lvl);
323+
print_indented!(self, "LoopMatch {", depth_lvl);
324324
print_indented!(self, "state:", depth_lvl + 1);
325325
self.print_expr(*state, depth_lvl + 2);
326326
print_indented!(self, format!("region_scope: {:?}", region_scope), depth_lvl + 1);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//@ check-pass
2+
//@ compile-flags: -Zunpretty=thir-tree
3+
4+
#![allow(incomplete_features)]
5+
#![feature(loop_match)]
6+
7+
fn boolean(mut state: bool) -> bool {
8+
#[loop_match]
9+
loop {
10+
state = 'blk: {
11+
match state {
12+
true => {
13+
#[const_continue]
14+
break 'blk false;
15+
}
16+
false => return state,
17+
}
18+
}
19+
}
20+
}
21+
22+
fn main() {}

0 commit comments

Comments
 (0)