Skip to content

Fix pretty-printing for empty tuples in MIR. #30748

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 7, 2016
Merged

Fix pretty-printing for empty tuples in MIR. #30748

merged 1 commit into from
Jan 7, 2016

Conversation

solson
Copy link
Member

@solson solson commented Jan 6, 2016

r? @nikomatsakis

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

#![feature(rustc_attrs)]

#[rustc_mir(pretty = "empty_tuple.mir")]
fn main() {
    let _x = ();
}
--- 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);
     }
 }

@eddyb
Copy link
Member

eddyb commented Jan 7, 2016

@bors r+

@bors
Copy link
Collaborator

bors commented Jan 7, 2016

📌 Commit b7fa37d has been approved by eddyb

@solson solson closed this Jan 7, 2016
@solson solson reopened this Jan 7, 2016
bors added a commit that referenced this pull request Jan 7, 2016
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);
     }
 }
```
@bors
Copy link
Collaborator

bors commented Jan 7, 2016

⌛ Testing commit b7fa37d with merge 5c92010...

@bors bors merged commit b7fa37d into rust-lang:master Jan 7, 2016
@solson solson deleted the mir-tuple-fix branch January 15, 2016 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants