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 16 pull requests #37262

Closed
wants to merge 64 commits into from
Closed

Rollup of 16 pull requests #37262

wants to merge 64 commits into from

Conversation

pnkfelix and others added 30 commits October 10, 2016 15:27
In particular, as far as I can tell from the error diagnostics, the
former test for E0199 was actually a test for E0198, and there was no
test for E0198.

(I am assuming that one of my previous changes to the `unsafe impl`
checking fixed a latent bug in how these two cases were
differentiated.)
This commit changes `ExtCtx::cfg()` so it returns a `CrateConfig`
reference instead of a clone. As a result, it also changes all of the
`cfg()` callsites to explicitly clone... except one, because the commit
also changes `macro_parser::parse()` to take `&CrateConfig`. This is
good, because that function can be hot, and `CrateConfig` is expensive
to clone.

This change almost halves the number of heap allocations done by rustc
for `html5ever` in rustc-benchmarks suite, which makes compilation 1.20x
faster.
Tweak a few run-make tests to emit files in the output directories, not directly
in the source tree.
We hope to move to AppVeyor in the near future off of Buildbot + EC2. This adds
an `appveyor.yml` configuration file which is ready to run builds on the auto
branch. This is also accompanied with a few minor fixes to the build system and
such to accomodate AppVeyor.

The intention is that we're not switching over to AppVeyor entirely just yet,
but rather we'll watch the builds for a week or so. If everything checks out
then we'll start gating on AppVeyor instead of Buildbot!
It is good practice to implement Debug for public types, and
indicating what directory you're reading seems useful.

Signed-off-by: David Henningsson <diwic@ubuntu.com>
This improves the `inflate-0.1.0` benchmark by about 10% for me.
Implement .zip() specialization for Map and Cloned.

The crucial thing for transparent specialization is that we want to
preserve the potential side effects.

The simplest example is that in this code snippet:

`(0..6).map(f).zip((0..4).map(g)).count()`

`f` will be called five times, and `g` four times. The last time for `f`
is when the other iterator is at its end, so this element is unused.
This side effect can be preserved without disturbing code generation for
simple uses of `.map()`.

The `Zip::next_back()` case is even more complicated, unfortunately.
…s subst.

This addresses issue pointed out by niko that prior code would break
if the declaration order for generics does not match how they are fed
into the instantiation of the type itself. (Added some tests
exercising this scenario.)
This is overdue, even if range and RangeArgument is still unstable.
The stability attributes are the same ones as the other unstable item
(Bound) here, they don't seem to matter.
Avoid many CrateConfig clones.

This commit changes `ExtCtx::cfg()` so it returns a `CrateConfig`
reference instead of a clone. As a result, it also changes all of the
`cfg()` callsites to explicitly clone... except one, because the commit
also changes `macro_parser::parse()` to take `&CrateConfig`. This is
good, because that function can be hot, and `CrateConfig` is expensive
to clone.

This change almost halves the number of heap allocations done by rustc
for `html5ever` in rustc-benchmarks suite, which makes compilation 1.20x
faster.

r? @nrc
test: Don't write files into the source tree

Tweak a few run-make tests to emit files in the output directories, not directly
in the source tree.
Add AppVeyor configuration to the repo

We hope to move to AppVeyor in the near future off of Buildbot + EC2. This adds
an `appveyor.yml` configuration file which is ready to run builds on the auto
branch. This is also accompanied with a few minor fixes to the build system and
such to accomodate AppVeyor.

The intention is that we're not switching over to AppVeyor entirely just yet,
but rather we'll watch the builds for a week or so. If everything checks out
then we'll start gating on AppVeyor instead of Buildbot!
…d_type_arguments, r=nrc

correct erroneous pluralization of '1 type argument' error messages

This is in the matter of rust-lang#37042.
…=nrc

macros 1.1: future proofing and cleanup

This PR
 - uses the macro namespace for custom derives (instead of a dedicated custom derive namespace),
 - relaxes the shadowing rules for `#[macro_use]`-imported custom derives to match the shadowing rules for ordinary `#[macro_use]`-imported macros, and
 - treats custom derive `extern crate`s like empty modules so that we can eventually allow, for example, `extern crate serde_derive; use serde_derive::Serialize;` backwards compatibly.

r? @alexcrichton
Fix some pretty printing tests

Many pretty-printing tests are un-ignored.
Some issues in classification of comments (trailing/isolated) and blank line counting are fixed.
Some comments are printed more carefully.
Some minor refactoring in pprust.rs
`no-pretty-expanded` annotations are removed because this is the default now.
`pretty-expanded` annotations are removed from compile-fail tests, they are not tested with pretty-printer.

Closes rust-lang#23623 in favor of more specific rust-lang#37201 and rust-lang#37199
r? @nrc
…kens_in_macros, r=nrc

macros: fix partially consumed tokens in macro matchers

Fixes rust-lang#37175.

This PR also avoids re-transcribing the tokens consumed by a matcher (and cloning the `TtReader` once per matcher), which improves expansion performance of the test case from rust-lang#34630 by ~8%.

r? @nrc
…r=eddyb

alloc_slice in TypedArena

Added `TypedArena::alloc_slice`, and moved from using `TypedArena<Vec<T>>` to `TypedArena<T>`.

`TypedArena::alloc_slice` is implemented by copying the slices elements into the typed arena, requiring that `T: Copy` when using it. We allocate a new chunk when there's insufficient space remaining in the previous chunk, and we cannot resize the old chunk in place. This is non-optimal, since we may waste allocated space when allocating (especially longer) slices, but is considered good enough for the time being.

This change also reduces heap fragmentation, since the arena now directly stores objects instead of storing the Vec's length and pointer to its contents.

Performance:
```
futures-rs-test  5.048s vs  5.061s --> 0.997x faster (variance: 1.028x, 1.020x)
helloworld       0.284s vs  0.295s --> 0.963x faster (variance: 1.207x, 1.189x)
html5ever-2016-  8.396s vs  8.208s --> 1.023x faster (variance: 1.019x, 1.036x)
hyper.0.5.0      5.768s vs  5.797s --> 0.995x faster (variance: 1.027x, 1.028x)
inflate-0.1.0    5.213s vs  5.069s --> 1.028x faster (variance: 1.008x, 1.022x)
issue-32062-equ  0.428s vs  0.467s --> 0.916x faster (variance: 1.188x, 1.015x)
issue-32278-big  1.949s vs  2.010s --> 0.970x faster (variance: 1.112x, 1.049x)
jld-day15-parse  1.795s vs  1.877s --> 0.956x faster (variance: 1.037x, 1.015x)
piston-image-0. 13.554s vs 13.522s --> 1.002x faster (variance: 1.019x, 1.020x)
rust-encoding-0  2.489s vs  2.465s --> 1.010x faster (variance: 1.047x, 1.086x)
syntex-0.42.2   34.646s vs 34.593s --> 1.002x faster (variance: 1.007x, 1.005x)
syntex-0.42.2-i 17.181s vs 17.163s --> 1.001x faster (variance: 1.004x, 1.004x)
```

r? @eddyb
impl Debug for ReadDir

It is good practice to implement Debug for public types, and
indicating what directory you're reading seems useful.

Signed-off-by: David Henningsson <diwic@ubuntu.com>
Mark enums with non-zero discriminant as non-zero

cc rust-lang/rfcs#1230
r? @eddyb
…=alexcrichton

Expand .zip() specialization to .map() and .cloned()

Implement .zip() specialization for Map and Cloned.

The crucial thing for transparent specialization is that we want to
preserve the potential side effects.

The simplest example is that in this code snippet:

`(0..6).map(f).zip((0..4).map(g)).count()`

`f` will be called five times, and `g` four times. The last time for `f`
is when the other iterator is at its end, so this element is unused.
This side effect can be preserved without disturbing code generation for
simple uses of `.map()`.

The `Zip::next_back()` case is even more complicated, unfortunately.
…he-quest-for-performance, r=arielb1

[Obligation Forest] Don't process cycles when stalled

This improves the `inflate-0.1.0` benchmark by about 10% for me.

/me hopes this is sound
…nikomatsakis

ICH: Use 128-bit Blake2b hash instead of 64-bit SipHash for incr. comp. fingerprints

This PR makes incr. comp. hashes 128 bits wide in order to push collision probability below a threshold that we need to worry about. It also replaces SipHash, which has been mentioned multiple times as not being built for fingerprinting, with the [BLAKE2b hash function](https://blake2.net/), an improved version of the BLAKE sha-3 finalist.

I was worried that using a cryptographic hash function would make ICH computation noticeably slower, but after doing some performance tests, I'm not any more. Most of the time BLAKE2b is actually faster than using two SipHashes (in order to get 128 bits):

```
SipHash
libcore: 0.199 seconds
libstd:  0.090 seconds

BLAKE2b
libcore: 0.162 seconds
libstd:  0.078 seconds
```

If someone can prove that something like MetroHash128 provides a comparably low collision probability as BLAKE2, I'm happy to switch. But for now we are at least not taking a performance hit.

I also suggest that we throw out the sha-256 implementation in the compiler and replace it with BLAKE2, since our sha-256 implementation is two to three times slower than the BLAKE2 implementation in this PR (cc @alexcrichton @eddyb @brson)

r? @nikomatsakis (although there's not much incr. comp. specific in here, so feel free to re-assign)
std::collections: Reexport libcollections's range module

This is overdue, even if range and RangeArgument is still unstable.
The stability attributes are the same ones as the other unstable item
(Bound) here, they don't seem to matter.
Add stable example to TypeId

The old example is still available at [Any::get_type_id](https://doc.rust-lang.org/std/any/trait.Any.html#examples)
Allow bootstrapping without a key. Fixes rust-lang#36548

This will make it easier for packagers to bootstrap rustc when they happen
to have a bootstrap compiler with a slightly different version number.

It's not ok for anything other than the build system to set this environment variable.

r? @alexcrichton
@eddyb
Copy link
Member Author

eddyb commented Oct 19, 2016

@bors r+

@bors
Copy link
Contributor

bors commented Oct 19, 2016

📌 Commit 38708e5 has been approved by eddyb

@eddyb
Copy link
Member Author

eddyb commented Oct 19, 2016

@bors force

@bors
Copy link
Contributor

bors commented Oct 19, 2016

⌛ Testing commit 38708e5 with merge 6777eca...

@bors
Copy link
Contributor

bors commented Oct 19, 2016

💔 Test failed - auto-win-gnu-32-opt-rustbuild

@eddyb
Copy link
Member Author

eddyb commented Oct 19, 2016

@bors retry

@eddyb eddyb closed this Oct 19, 2016
@eddyb eddyb deleted the rollup branch October 19, 2016 04:59
@Centril Centril added the rollup A PR which is a rollup label Oct 24, 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.