Skip to content
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

Rollup of 4 pull requests #30660

Merged
merged 10 commits into from
Dec 31, 2015
Merged

Rollup of 4 pull requests #30660

merged 10 commits into from
Dec 31, 2015

Conversation

tamird and others added 6 commits December 18, 2015 06:53
This moves back (essentially reverts rust-lang#30265) into MIR-specific translation code, but keeps the
funcition split out, since it is expected to eventually become recursive.
Previously, all references to closure arguments went to the argument before the
one they should (e.g. to arg1 when it was supposed to be arg2). This was because
the MIR builder did not account for the implicit arguments that come before the
explicit arguments, and closures have one implicit argument - the struct
containing the captures.
@rust-highfive
Copy link
Collaborator

r? @erickt

(rust_highfive has picked a reviewer for you, use r? to override)

@nagisa
Copy link
Member Author

nagisa commented Dec 31, 2015

All of these PRs seem to have failed by timeouting on tests (or in case of the #30565, failed to FF)

@aturon
Copy link
Member

aturon commented Dec 31, 2015

@bors: r+ p=1

@bors
Copy link
Contributor

bors commented Dec 31, 2015

📌 Commit 3445af5 has been approved by aturon

Since `darwin` is really `apple-darwin`, the valgrind-rpass tests were not actually being run with valgrind on mac before. Also, the `HOST` check was completely wrong.

r? @alexcrichton
…brson

This PR changes the `emit_opaque` and `read_opaque` methods in the RBML library to use a space-efficient binary encoder that does not emit any tags and uses the LEB128 variable-length integer format for all numbers it emits.

The space savings are nice, albeit a bit underwhelming, especially for dynamic libraries where metadata is already compressed.

| RLIBs        |  NEW   |   OLD     |
|--------------|--------|-----------|
|libstd        | 8.8 MB |  10.5 MB  |
|libcore       |15.6 MB |   19.7 MB |
|libcollections| 3.7 MB |    4.8 MB |
|librustc      |34.0 MB |   37.8 MB |
|libsyntax     |28.3 MB |   32.1 MB |

| SOs           |     NEW   |    OLD |
|---------------|-----------|--------|
| libstd        |  4.8 MB   | 5.1 MB |
| librustc      |  8.6 MB   | 9.2 MB |
| libsyntax     |  7.8 MB   | 8.4 MB |

At least this should make up for the size increase caused recently by also storing MIR in crate metadata.

Can this be a breaking change for anyone?
cc @rust-lang/compiler
…mana

This moves back (essentially reverts rust-lang#30265) into MIR-specific translation code, but keeps the
funcition split out, since it is expected to eventually become recursive.

Fixes rust-lang#29572

cc @oli-obk
Previously, all references to closure arguments went to the argument before the one they should (e.g. to `arg1` when it was supposed to go to `arg2`). This was because the MIR builder did not account for the implicit arguments that come before the explicit arguments, and closures have one implicit argument - the struct containing the captures.

This is my test code and a diff of the MIR generated for the closure:

```rust
let a = 2i32;
let _f = |b: i32| -> i32 { a + b }:
```

```diff
--- old	2015-12-29 23:16:32.027926372 -0600
+++ new	2015-12-29 23:16:42.975400757 -0600
@@ -1,22 +1,22 @@
 fn(arg0: &[closure@closure-args.rs:8:14: 8:39 a:&i32], arg1: i32) -> i32 {
     let var0: i32; // b
     let tmp0: ();
     let tmp1: i32;
     let tmp2: i32;

     bb0: {
-        var0 = arg0;
+        var0 = arg1;
         tmp1 = (*(*arg0).0);
         tmp2 = var0;
         ReturnPointer = Add(tmp1, tmp2);
         goto -> bb1;
     }

     bb1: {
         return;
     }

     bb2: {
         diverge;
     }
 }
```

(If you're wondering where this text MIR output comes from, it's from another branch of mine waiting on rust-lang#30602 to get merged.)
@nagisa nagisa changed the title Rollup of 5 pull requests Rollup of 4 pull requests Dec 31, 2015
@bors
Copy link
Contributor

bors commented Dec 31, 2015

📌 Commit 7448f48 has been approved by steveklabnik

@steveklabnik
Copy link
Member

@bors: r+ p=1

@bors
Copy link
Contributor

bors commented Dec 31, 2015

📌 Commit 7448f48 has been approved by steveklabnik

@bors
Copy link
Contributor

bors commented Dec 31, 2015

⌛ Testing commit 7448f48 with merge 53cd573...

bors added a commit that referenced this pull request Dec 31, 2015
@bors bors merged commit 7448f48 into rust-lang:master Dec 31, 2015
@bors bors mentioned this pull request Dec 31, 2015
@Centril Centril added the rollup A PR which is a rollup label Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants