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 11 pull requests #46166

Merged
merged 29 commits into from
Nov 21, 2017
Merged

Rollup of 11 pull requests #46166

merged 29 commits into from
Nov 21, 2017

Conversation

gaurikholkar and others added 29 commits November 14, 2017 21:01
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
This patch makes `read_to_end` use Vec's memory-growth pattern rather
than using a custom pattern.

This has some interesting effects:

 - If memory is reserved up front, `read_to_end` can be faster, as it
   starts reading at the buffer size, rather than always starting at 32
   bytes. This speeds up file reading by 2x in one of my use cases.

 - It can reduce the number of syscalls when reading large files.
   Previously, `read_to_end` would settle into a sequence of 8192-byte
   reads. With this patch, the read size follows Vec's allocation
   pattern. For example, on a 16MiB file, it can do 21 read syscalls
   instead of 2057. In simple benchmarks of large files though, overall
   speed is still dominated by the actual I/O.

 - A downside is that Read implementations that don't implement
   `initializer()` may see increased memory zeroing overhead.

I benchmarked this on a variety of data sizes, with and without
preallocated buffers. Most benchmarks see no difference, but reading
a small/medium file with a pre-allocated buffer is faster.
As reported in rust-lang#19140, rust-lang#44083, and rust-lang#44565, some users were confused when
the dead-code lint reported an enum variant to be "unused" when it was
matched on (but not constructed). This wording change makes it clearer
that the lint is in fact checking for construction.

We continue to say "used" for all other items (it's tempting to say
"called" for functions and methods, but this turns out not to be
correct: functions can be passed as arguments and the dead-code lint
isn't special-casing that or anything).

Resolves rust-lang#19140.
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
Fix a typo in ToSocketAddrs documentation: s/ToSocketsAddr/ToSocketAddrs
It doesn’t change anything for stable users in practice. See discussion in rust-lang#46148
This is a follow-up to rust-lang#45225 (comment)
now that upstream has adjusted servo/servo#19316
before: DefId { krate: CrateNum(11), index: DefIndex(0:6) => foo[8787]::Mapper[0]::OtherType[0] } }
after: DefId(11:0:6 ~ foo[8787]::Mapper[0]::OtherType[0])
…rister

update let-expressions hash test to use `except`

A part of rust-lang#44924, this PR updated let-expressions test using `except`.

cc @michaelwoerister
r? @nikomatsakis
rustbuild: distribute cargo-fmt alongside rustfmt

Not sure whether we want that nor if it's the right way to do so, but it feels quite weird to have rustfmt without cargo-fmt. Or are there other plans wrt that?

What do you think @nrc ?
Optimize `read_to_end`.

This patch makes `read_to_end` use Vec's memory-growth pattern rather
than using a custom pattern.

This has some interesting effects:

 - If memory is reserved up front, `read_to_end` can be faster, as it
   starts reading at the buffer size, rather than always starting at 32
   bytes. This speeds up file reading by 2x in one of my use cases.

 - It can reduce the number of syscalls when reading large files.
   Previously, `read_to_end` would settle into a sequence of 8192-byte
   reads. With this patch, the read size follows Vec's allocation
   pattern. For example, on a 16MiB file, it can do 21 read syscalls
   instead of 2057. In simple benchmarks of large files though, overall
   speed is still dominated by the actual I/O.

 - A downside is that Read implementations that don't implement
   `initializer()` may see increased memory zeroing overhead.

I benchmarked this on a variety of data sizes, with and without
preallocated buffers. Most benchmarks see no difference, but reading
a small/medium file with a pre-allocated buffer is faster.
…n, r=petrochenkov

Include rendered diagnostic in json

r? @petrochenkov
…y_never_constructed_for_variants, r=arielb1

dead code lint to say "never constructed" for variants

As reported in rust-lang#19140, rust-lang#44083, and rust-lang#44565, some users were confused when
the dead-code lint reported an enum variant to be "unused" when it was
matched on (but not constructed). This wording change makes it clearer
that the lint is in fact checking for construction.

We continue to say "used" for all other items (it's tempting to say
"called" for functions and methods, but this turns out not to be
correct: functions can be passed as arguments and the dead-code lint
isn't special-casing that or anything).

Resolves rust-lang#19140.

r? @pnkfelix
clean the Debug impl for CrateNum and DefId

Just a tiny quality-of-life improvement because I got tired of noisy debug logs.

```
before: DefId { krate: CrateNum(11), index: DefIndex(0:6) => foo[8787]::Mapper[0]::OtherType[0] } }
after: {crate11:0:6 ~ foo[8787]::Mapper[0]::OtherType[0]})
```

r? @michaelwoerister
…uietMisdreavus

Display negative traits implementation

Fixes rust-lang#45816.

r? @QuietMisdreavus
…=frewsxcv

Fix a typo in ToSocketAddrs documentation

Fix a typo in `ToSocketAddrs` documentation: s/ToSocketsAddr/ToSocketAddrs
Expand a couple points in 1.22.0 release notes

Let’s not give false hopes about `const fn` :)
Revert servo to upstream in cargotest

This is a follow-up to rust-lang#45225 (comment) now that upstream has adjusted: servo/servo#19316
fix some typos

This is the result of me testing out a WIP source code typo-finder
and your project was the random target this time.
@kennytm
Copy link
Member Author

kennytm commented Nov 21, 2017

@bors r+ p=9

@bors
Copy link
Contributor

bors commented Nov 21, 2017

📌 Commit 7c8b36f has been approved by kennytm

@bors
Copy link
Contributor

bors commented Nov 21, 2017

⌛ Testing commit 7c8b36f with merge 63739ab...

bors added a commit that referenced this pull request Nov 21, 2017
Rollup of 11 pull requests

- Successful merges: #45987, #46031, #46050, #46052, #46103, #46120, #46134, #46141, #46148, #46155, #46157
- Failed merges:
@kennytm kennytm added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Nov 21, 2017
@bors
Copy link
Contributor

bors commented Nov 21, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: kennytm
Pushing 63739ab to master...

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 S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.