Skip to content

Commit

Permalink
Auto merge of rust-lang#30748 - tsion:mir-tuple-fix, r=eddyb
Browse files Browse the repository at this point in the history
r? @nikomatsakis

(Related issue about `debug_tuple` at rust-lang/rfcs#1448.)

```rust

fn main() {
    let _x = ();
}
```

```diff
--- empty_tuple-old.mir	2016-01-06 16:04:24.206409186 -0600
+++ empty_tuple-new.mir	2016-01-06 14:26:17.324888585 -0600
@@ -1,13 +1,13 @@
 fn() -> () {
     let var0: (); // _x
     let mut tmp0: ();

     bb0: {
-        var0 = ;
+        var0 = ();
         Some(goto -> bb1);
     }

     bb1: {
         Some(return);
     }
 }
```
  • Loading branch information
bors committed Jan 7, 2016
2 parents 25d1f4b + b7fa37d commit 5c92010
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/librustc/mir/repr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -803,10 +803,10 @@ impl<'tcx> Debug for Rvalue<'tcx> {
Vec => write!(fmt, "{:?}", lvs),

Tuple => {
if lvs.len() == 1 {
write!(fmt, "({:?},)", lvs[0])
} else {
fmt_tuple(fmt, "", lvs)
match lvs.len() {
0 => write!(fmt, "()"),
1 => write!(fmt, "({:?},)", lvs[0]),
_ => fmt_tuple(fmt, "", lvs),
}
}

Expand Down

0 comments on commit 5c92010

Please sign in to comment.