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 #50191

Merged
merged 34 commits into from
Apr 24, 2018
Merged

Rollup of 11 pull requests #50191

merged 34 commits into from
Apr 24, 2018

Conversation

kennytm
Copy link
Member

@kennytm kennytm commented Apr 24, 2018

Successful merges:

Failed merges:

andreastt and others added 30 commits March 28, 2018 18:54
This patch makes it clear in std::process::Child::kill()'s API
documentation that an error is returned if the child process has
already cleanly exited.  This is implied by the example, but not
called out explicitly.
Add documentation links to the original type for various OS-specific
extension traits and normalize the language for introducing such traits.
Also, remove some outdated comments around the extension trait
definitions.
The unstable-feature attribute requires an issue (neglecting it is
E0547), which gets used in the error messages. Unfortunately, there are
some cases where "0" is apparently used a placeholder where no issue
exists, directing the user to see the (nonexistent) issue #0. (It would
have been better to either let `issue` be optional—compare to how issue
is an `Option<u32>` in the feature-gate declarations in
libsyntax/feature-gate.rs—or actually require that an issue be created.)
Rather than endeavoring to change how `#[unstable]` works at this time
(given competing contributor and reviewer priorities), this simple patch
proposes the less-ambitious solution of just not adding the "(see
issue)" note when the number is zero.

Resolves rust-lang#49983.
Because it's faster than HashMap.

This change reduces the time taken for a few of the rustc-perf
benchmarks, mostly the small ones, by up to 5%.
…-Simulacrum

std: Child::kill() returns error if process has already exited

This patch makes it clear in std::process::Child::kill()'s API
documentation that an error is returned if the child process has
already cleanly exited.  This is implied by the example, but not
called out explicitly.
Add Cell::update

This commit adds a new method `Cell::update`, which applies a function to the value inside the cell.

Previously discussed in: rust-lang/rfcs#2171

### Motivation

Updating `Cell`s is currently a bit verbose. Here are several real examples (taken from rustc and crossbeam):

```rust
self.print_fuel.set(self.print_fuel.get() + 1);

self.diverges.set(self.diverges.get() | Diverges::Always);

let guard_count = self.guard_count.get();
self.guard_count.set(guard_count.checked_add(1).unwrap());
if guard_count == 0 {
    // ...
}
```

With the addition of the new method `Cell::update`, this code can be simplified to:

```rust
self.print_fuel.update(|x| x + 1);

self.diverges.update(|x| x | Diverges::Always);

if self.guard_count.update(|x| x.checked_add(1).unwrap()) == 1 {
    // ...
}
```

### Unresolved questions

1. Should we return the old value instead of the new value (like in `fetch_add` and `fetch_update`)?
2. Should the return type simply be `()`?
3. Naming: `update` vs `modify` vs `mutate` etc.

cc @SimonSapin
Add doc links to `std::os` extension traits

Addresses a small subset of rust-lang#29367.

This adds documentation links to the original type for various OS-specific extension traits, and uses a common sentence for introducing such traits (which now consistently ends in a period).
Stabilize `std::hint::unreachable_unchecked`.

Closes rust-lang#43751.
don't see issue #0

The unstable-feature attribute requires an issue (neglecting it is
E0547), which gets used in the error messages. Unfortunately, there are
some cases where "0" is apparently used a placeholder where no issue
exists, directing the user to see the (nonexistent) issue #0. (It would
have been better to either let `issue` be optional—compare to how issue
is an `Option<u32>` in the feature-gate declarations in
libsyntax/feature-gate.rs—or actually require that an issue be created.)
Rather than endeavoring to change how `#[unstable]` works at this time
(given competing contributor and reviewer priorities), this simple patch
proposes the less-ambitious solution of just not adding the "(see
issue)" note when the number is zero.

Resolves rust-lang#49983.
encourage descriptive issue titles

There are two sides to avoiding duplicate issues, searching for existing ones, and making sure existing ones can be searched for. This addresses the later.

r? @steveklabnik
…ichaelwoerister

Use FxHashMap in syntax_pos::symbol::Interner::intern.

Because it's faster than HashMap.

This change reduces the time taken for a few of the rustc-perf
benchmarks, mostly the small ones, by up to 5%.
```
coercions
        avg: -1.3%      min: -5.5%      max: -0.0%
helloworld-check
        avg: -2.3%      min: -3.5%      max: -1.8%
deeply-nested-check
        avg: -1.4%      min: -3.2%      max: -0.5%
tuple-stress-opt
        avg: -0.7%      min: -2.0%      max: -0.1%
unify-linearly-check
        avg: -1.2%      min: -1.9%      max: -0.6%
coercions-check
        avg: -0.8%      min: -1.3%      max: -0.4%
unused-warnings-check
        avg: -1.0%      min: -1.3%      max: -0.8%
deeply-nested-opt
        avg: -0.5%      min: -1.2%      max: -0.2%
deeply-nested
        avg: -0.7%      min: -1.2%      max: -0.4%
helloworld
        avg: -0.8%      min: -1.1%      max: -0.7%
tuple-stress-check
        avg: -0.5%      min: -1.0%      max: -0.1%
unused-warnings
        avg: -0.8%      min: -1.0%      max: -0.7%
unused-warnings-opt
        avg: -0.8%      min: -1.0%      max: -0.7%
coercions-opt
        avg: -0.5%      min: -1.0%      max: -0.1%
helloworld-opt
        avg: -0.7%      min: -1.0%      max: -0.6%
```
core: Fix overflow in `int::mod_euc` when `self < 0 && rhs == MIN`

This commit removes usage of `abs`, which overflows when `self == MIN`.
@rust-highfive
Copy link
Collaborator

Some changes occurred in HTML/CSS.

cc @GuillaumeGomez

@rust-highfive
Copy link
Collaborator

r? @alexcrichton

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 24, 2018
@kennytm
Copy link
Member Author

kennytm commented Apr 24, 2018

@bors r+ p=11

@bors
Copy link
Contributor

bors commented Apr 24, 2018

📌 Commit 893774e has been approved by kennytm

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 24, 2018
@bors
Copy link
Contributor

bors commented Apr 24, 2018

⌛ Testing commit 893774e with merge 52ed3d8...

bors added a commit that referenced this pull request Apr 24, 2018
Rollup of 11 pull requests

Successful merges:

 - #49461 (std: Child::kill() returns error if process has already exited)
 - #49727 (Add Cell::update)
 - #49812 (Fix revision support for UI tests.)
 - #49829 (Add doc links to `std::os` extension traits)
 - #49906 (Stabilize `std::hint::unreachable_unchecked`.)
 - #49970 (Deprecate Read::chars and char::decode_utf8)
 - #49985 (don't see issue #0)
 - #50118 (fix search bar bug)
 - #50139 (encourage descriptive issue titles)
 - #50174 (Use FxHashMap in syntax_pos::symbol::Interner::intern.)
 - #50185 (core: Fix overflow in `int::mod_euc` when `self < 0 && rhs == MIN`)

Failed merges:
@bors
Copy link
Contributor

bors commented Apr 24, 2018

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

@bors bors merged commit 893774e into rust-lang:master Apr 24, 2018
@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 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.

None yet