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 12 pull requests #89608

Merged
merged 38 commits into from
Oct 6, 2021
Merged

Rollup of 12 pull requests #89608

merged 38 commits into from
Oct 6, 2021

Conversation

Manishearth
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

kpreid and others added 30 commits August 30, 2021 20:31
I intend these changes to be helpful to readers who are not yet familiar
with the quirks of floating-point numbers. Additionally, I felt it was
misleading to describe `Nan` as being the result of division by zero,
since most divisions by zero (except for 0/0) produce `Infinite` floats,
so I moved that remark to the `Infinite` variant with adjustment.

The first sentence of the `Nan` documentation is copied from `f32`;
I followed the example of the `f64` documentation by referring to `f32`
for general concepts, rather than duplicating the text.
Co-authored-by: kennytm <kennytm@gmail.com>
Co-authored-by: kennytm <kennytm@gmail.com>
- Avoid multiple <h1>s on a page.
- The <h#> tags should follow a semantic hierarchy.
- Cap at h6 (no h7)
Made the fields of VecDeque's IterMut private by creating a IterMut::new(...) function to create a new instance of IterMut and migrating usage to use IterMut::new(...).
Fixes rust-lang#67007

Currently, a 'borrowed data escapes' error does not mention
the specific lifetime involved (except indirectly through a suggestion
about adding a lifetime bound). We now explain the specific lifetime
relationship that failed to hold, which improves otherwise vague
error messages.
…ennytm

Add functions to add unsigned and signed integers

This PR adds methods to unsigned integers to add signed integers with good overflow semantics under `#![feature(mixed_integer_ops)]`.

The added API is:

```rust
// `uX` is `u8`, `u16`, `u32`, `u64`,`u128`, `usize`
impl uX {
    pub const fn checked_add_signed(self, iX) -> Option<Self>;
    pub const fn overflowing_add_signed(self, iX) -> (Self, bool);
    pub const fn saturating_add_signed(self, iX) -> Self;
    pub const fn wrapping_add_signed(self, iX) -> Self;
}

impl iX {
    pub const fn checked_add_unsigned(self, uX) -> Option<Self>;
    pub const fn overflowing_add_unsigned(self, uX) -> (Self, bool);
    pub const fn saturating_add_unsigned(self, uX) -> Self;
    pub const fn wrapping_add_unsigned(self, uX) -> Self;

    pub const fn checked_sub_unsigned(self, uX) -> Option<Self>;
    pub const fn overflowing_sub_unsigned(self, uX) -> (Self, bool);
    pub const fn saturating_sub_unsigned(self, uX) -> Self;
    pub const fn wrapping_sub_unsigned(self, uX) -> Self;
}
```

Maybe it would be interesting to also have `add_signed` that panics in debug and wraps in release ?
Expand documentation for `FpCategory`.

I intend these changes to be helpful to readers who are not yet familiar with the quirks of floating-point numbers. Additionally, I felt it was misleading to describe `Nan` as being the result of division by zero, since most divisions by zero (except for 0/0) produce `Infinite` floats, so I moved that remark to the `Infinite` variant with adjustment.

The first sentence of the `Nan` documentation is copied from `f32`; I followed the example of the `f64` documentation by referring to `f32` for general concepts, rather than duplicating the text.

----

I considered making similar changes to the documentation of the `is_*` methods of floats, but decided that that was a much larger and trickier problem; here, each of the variants' descriptions can be expected to be read in context of being mutually exclusive with the others.
…te, r=joshtriplett

refactor: VecDeques Drain fields to private

Made the fields of VecDeque's Drain private by creating a Drain::new(...) function to create a new instance of Drain and migrating usage to use Drain::new(...).
…ivate, r=joshtriplett

refactor: make VecDeque's IterMut fields module-private, not just crate-private

Made the fields of VecDeque's IterMut private by creating a IterMut::new(...) function to create a new instance of IterMut and migrating usage to use IterMut::new(...).
…davidtwco

Note specific regions involved in 'borrowed data escapes' error

Fixes rust-lang#67007

Currently, a 'borrowed data escapes' error does not mention
the specific lifetime involved (except indirectly through a suggestion
about adding a lifetime bound). We now explain the specific lifetime
relationship that failed to hold, which improves otherwise vague
error messages.
…laumeGomez

librustdoc: Use correct heading levels.

Closes rust-lang#89309

This fixes the `<h#>` header tags throughout the docs to reflect a semantic hierarchy.

- I ran a script to manually check that we don't have any files with multiple `<h1>` tags.
- Also checked that we never incorrectly nest e.g. a `<h2>` under an `<h3>`.
- I also spot-checked a bunch of pages (`trait.Read`, `enum.Ordering`, `primitive.isize`, `trait.Iterator`).
Fix suggestion to borrow when casting from pointer to reference

Fixes rust-lang#89497.
…d, r=dtolnay

library std, libc dependency update

to solve rust-lang#87528 build.
Add a test for generic_const_exprs

Test that const_eval_resolve evaluates consts with unused inference vars in substs

r? ``@lcnr``
fix: alloc-optimisation is only for rust llvm

As discussed at the bottom of rust-lang#83485.

On a separate note I'll take this chance ask, is it worth pulling in that patch (to recognise `__rust_dealloc`) into Debian's system LLVM? The main factors for us to consider would be (1) is the optimisation significant and (2) is there not any significant negative impact to non-rust packages that use LLVM.
@rustbot rustbot added the rollup A PR which is a rollup label Oct 6, 2021
@Manishearth
Copy link
Member Author

@bors p=5 r+ rollup=never

@bors
Copy link
Contributor

bors commented Oct 6, 2021

📌 Commit f31c805 has been approved by Manishearth

@bors
Copy link
Contributor

bors commented Oct 6, 2021

🌲 The tree is currently closed for pull requests below priority 100. This pull request will be tested once the tree is reopened.

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Oct 6, 2021
@Mark-Simulacrum
Copy link
Member

@bors treeclosed-

@bors
Copy link
Contributor

bors commented Oct 6, 2021

⌛ Testing commit f31c805 with merge 0eabf25...

@bors
Copy link
Contributor

bors commented Oct 6, 2021

☀️ Test successful - checks-actions
Approved by: Manishearth
Pushing 0eabf25 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 6, 2021
@bors bors merged commit 0eabf25 into rust-lang:master Oct 6, 2021
@rustbot rustbot added this to the 1.57.0 milestone Oct 6, 2021
@rust-highfive
Copy link
Collaborator

📣 Toolstate changed by #89608!

Tested on commit 0eabf25.
Direct link to PR: #89608

💔 miri on windows: test-pass → test-fail (cc @oli-obk @eddyb @RalfJung).
💔 miri on linux: test-pass → test-fail (cc @oli-obk @eddyb @RalfJung).

rust-highfive added a commit to rust-lang-nursery/rust-toolstate that referenced this pull request Oct 6, 2021
Tested on commit rust-lang/rust@0eabf25.
Direct link to PR: <rust-lang/rust#89608>

💔 miri on windows: test-pass → test-fail (cc @oli-obk @eddyb @RalfJung).
💔 miri on linux: test-pass → test-fail (cc @oli-obk @eddyb @RalfJung).
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (0eabf25): comparison url.

Summary: This change led to moderate relevant regressions 😿 in compiler performance.

  • Moderate regression in instruction counts (up to 0.8% on incr-unchanged builds of externs)

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression

@rustbot rustbot added the perf-regression Performance regression. label Oct 7, 2021
@Manishearth Manishearth deleted the rollup-m7kd76f branch October 7, 2021 05:28
@pnkfelix
Copy link
Member

A large number of doc targets regressed very slightly here.

Apart from that, biggest changes were to externs and deeply-nested-async.

Seems hard to believe from the listed PR's that this isn't just noise, though (unless the overhead is coming from improvements to diagnostics?)

@pnkfelix
Copy link
Member

pnkfelix commented Oct 12, 2021

Ah, the task-clock wasn't affected at all, and the wall-time shows very little change as well.

I think its safe to treat this as noise.

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Oct 12, 2021
@pnkfelix
Copy link
Member

After discussing with other people in perf-triage team, I was advised that the changes to externs might be real regressions.

(I haven't decided the degree of regression is worth looking into yet, but I want the metadata to at least reflect my current understanding of the performance implications of this PR.)

@rustbot label: +perf-regression

@pnkfelix
Copy link
Member

or rather

@rustbot label: -perf-regression-triaged

@rustbot rustbot removed the perf-regression-triaged The performance regression has been triaged. label Oct 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. 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.