Skip to content

Rollup of 11 pull requests - #46166

Merged
bors merged 29 commits into
rust-lang:masterfrom
kennytm:rollup
Nov 21, 2017
Merged

Rollup of 11 pull requests#46166
bors merged 29 commits into
rust-lang:masterfrom
kennytm:rollup

Conversation

gaurikholkarand 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).
Resolvesrust-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).
Resolvesrust-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
Fixesrust-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
Copy Markdown
MemberAuthor

@bors r+ p=9

@bors

bors commented Nov 21, 2017

Copy link
Copy Markdown
Collaborator

📌 Commit 7c8b36f has been approved by kennytm

@bors

bors commented Nov 21, 2017

Copy link
Copy Markdown
Collaborator

⌛ 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:
@kennytmkennytm 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

bors commented Nov 21, 2017

Copy link
Copy Markdown
Collaborator

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

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rollupA PR which is a rollupS-waiting-on-borsStatus: 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.

13 participants

@kennytm@bors@Centril@gaurikholkar@Keruspe@sunfishcode@zackmdavis@oli-obk@GuillaumeGomez@aqrln@SimonSapin@arielb1@martinlindhe