Skip to content

Commit c44fe70

Browse files
committed
fix missing parenthesis in pretty discriminant
1 parent 2886b36 commit c44fe70

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

compiler/rustc_public/src/mir/pretty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ fn pretty_statement<W: Write>(writer: &mut W, statement: &StatementKind) -> io::
100100
writeln!(writer, "{INDENT}FakeRead({cause:?}, {place:?});")
101101
}
102102
StatementKind::SetDiscriminant { place, variant_index } => {
103-
writeln!(writer, "{INDENT}discriminant({place:?} = {};", variant_index.to_index())
103+
writeln!(writer, "{INDENT}discriminant({place:?}) = {};", variant_index.to_index())
104104
}
105105
StatementKind::Deinit(place) => writeln!(writer, "Deinit({place:?};"),
106106
StatementKind::StorageLive(local) => {

tests/ui/rustc_public-ir-print/async-closure.stdout

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ fn foo::{closure#0}::{closure#0}(_1: Pin<&mut {async closure body@$DIR/async-clo
6363
StorageDead(_3);
6464
_0 = std::task::Poll::Ready(move _5);
6565
_10 = CopyForDeref((_1.0: &mut {async closure body@$DIR/async-closure.rs:9:22: 11:6}));
66-
discriminant((*_10) = 1;
66+
discriminant((*_10)) = 1;
6767
return;
6868
}
6969
bb2: {
@@ -101,7 +101,7 @@ fn foo::{closure#0}::{synthetic#0}(_1: Pin<&mut {async closure body@$DIR/async-c
101101
StorageDead(_3);
102102
_0 = std::task::Poll::Ready(move _5);
103103
_10 = CopyForDeref((_1.0: &mut {async closure body@$DIR/async-closure.rs:9:22: 11:6}));
104-
discriminant((*_10) = 1;
104+
discriminant((*_10)) = 1;
105105
return;
106106
}
107107
bb2: {

0 commit comments

Comments
 (0)