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 7 pull requests #101361

Merged
merged 23 commits into from Sep 3, 2022
Merged

Rollup of 7 pull requests #101361

merged 23 commits into from Sep 3, 2022

Conversation

Dylan-DPC
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

lopopolo and others added 23 commits August 27, 2022 13:50
Previously we were just using the parent node as the scope for a
temporary value, but it turns out this is too narrow. For example, in
an expression like

    Foo {
        b: &42,
        a: async { 0 }.await,
    }

the scope for the &42 was set to the ExprField node for `b: &42`, when
we actually want to use the Foo struct expression.

We fix this by recursively searching through parent nodes until we find
a Node::Expr. It may be that we don't find one, and if so that's okay,
we will just fall back on the enclosing temporary scope which is always
sufficient.
revealed by tests, manually add a panic to test for dead code
…ossible...

- ... when creating diagnostics in rustc_metadata
-  use the error_code! macro
- pass macro output to diag.code()
- use fluent from within manual implementation of SessionDiagnostic
- emit the untested errors in case they occur in the wild
- stop panicking in the probably-not-dead code, add fixme to write test
Also briefly document the history of `sys/windows/rand.rs` as they may be relevant to any future changes.
Fuchsia .manifest files do not support a `#` comment syntax. Because of this, if you copy and paste the current example code for this file, and then remove the line you don't need, you still see an error. To make this a bit easier to follow, split this into two code blocks, one for rustc, and one for cargo.
…partial-stabilization-bounds-as-ref, r=dtolnay

Partially stabilize `bound_as_ref` by stabilizing `Bound::as_ref`

Stabilizing `Bound::as_ref` will simplify the implementation for `RangeBounds<usize>` for custom range types:

```rust
impl RangeBounds<usize> for Region {
    fn start_bound(&self) -> Bound<&usize> {
        // TODO: Use `self.start.as_ref()` when upstream `std` stabilizes:
        // rust-lang#80996
        match self.start {
            Bound::Included(ref bound) => Bound::Included(bound),
            Bound::Excluded(ref bound) => Bound::Excluded(bound),
            Bound::Unbounded => Bound::Unbounded,
        }
    }

    fn end_bound(&self) -> Bound<&usize> {
        // TODO: Use `self.end.as_ref()` when upstream `std` stabilizes:
        // rust-lang#80996
        match self.end {
            Bound::Included(ref bound) => Bound::Included(bound),
            Bound::Excluded(ref bound) => Bound::Excluded(bound),
            Bound::Unbounded => Bound::Unbounded,
        }
    }
}
```

See:

- rust-lang#80996
- rust-lang#80996 (comment)

cc `@yaahc` who suggested partial stabilization.
…s, r=davidtwco

Migrate rustc_metadata to SessionDiagnostics

Migrate rustc_metadata to SessionDiagnostics.

Part of rust-lang#100717
[drop tracking] Use parent expression for scope, not parent node

Previously we were just using the parent node as the scope for a temporary value, but it turns out this is too narrow. For example, in an expression like

    Foo {
        b: &42,
        a: async { 0 }.await,
    }

the scope for the &42 was set to the ExprField node for `b: &42`, when we actually want to use the Foo struct expression.

We fix this by recursively searching through parent nodes until we find a Node::Expr. It may be that we don't find one, and if so that's okay, we will just fall back on the enclosing temporary scope which is always sufficient.

Helps with rust-lang#97331

r? ``@jyn514``
… r=thomcc

Windows RNG: Use `BCRYPT_RNG_ALG_HANDLE` by default

This only changes a small amount of actual code, the rest is documentation outlining the history of this module as I feel it will be relevant to any future issues that might crop up.

The code change is to use the `BCRYPT_RNG_ALG_HANDLE` [pseudo-handle](https://docs.microsoft.com/en-us/windows/win32/seccng/cng-algorithm-pseudo-handles) by default, which simply uses the default RNG. Previously we used `BCRYPT_USE_SYSTEM_PREFERRED_RNG` which has to load the system configuration and then find and load that RNG. I suspect this was the cause of failures on some systems (e.g. due to corrupted config). However, this is admittedly speculation as I can't reproduce the issue myself (and it does seem quite rare even in the wild). Still, removing a possible point of failure is likely worthwhile in any case.

r? libs
…n514

Fix `std::collections::HashSet::drain` documentation

Hi!

`std::collections::HashSet::drain` contains small typo in the docstring.

I didn't read too much about the model of contributing to Rust, so merge this PR or close and fix the typo the right way :)

Thanks for Rust!
Fix unsupported syntax in .manifest file

Fuchsia .manifest files do not support a `#` comment syntax. Because of this, if you copy and paste the current example code for this file, and then remove the line you don't need, you still see an error. To make this a bit easier to follow, split this into two code blocks, one for rustc, and one for cargo.
…r=notriddle

Cleanup css theme

Follow-up of rust-lang#100494.

The change for the border color of the search input in the dark mode was actually a weird case: the search input border was unique, it didn't share the same variable with other items with borders. This weird case being unique to the dark theme, I removed it, hence the modification in the GUI test.

Live demo is [here](https://rustdoc.crud.net/imperio/cleanup-css-theme/std/index.html).

cc `@jsha`
r? `@notriddle`
@rustbot rustbot added A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Sep 3, 2022
@Dylan-DPC
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Contributor

bors commented Sep 3, 2022

📌 Commit 7eed25b has been approved by Dylan-DPC

It is now in the queue for this repository.

@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 Sep 3, 2022
@bors
Copy link
Contributor

bors commented Sep 3, 2022

⌛ Testing commit 7eed25b with merge 9208625...

@bors
Copy link
Contributor

bors commented Sep 3, 2022

☀️ Test successful - checks-actions
Approved by: Dylan-DPC
Pushing 9208625 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 3, 2022
@bors bors merged commit 9208625 into rust-lang:master Sep 3, 2022
@rustbot rustbot added this to the 1.65.0 milestone Sep 3, 2022
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Perf Build Sha
#101348 af13a42a17f638361f756c20330be726c29c2be0
#101338 57018b7a19a6249c344913739aab3ac5d8b56511
#101330 6e5d6fd38ab6df45b12a198c9739e06eae59f054
#101325 5c3cef909e4d9eca4be455c5178f82e9630e2245
#101217 8d404c9d78addf08d21be3ae0ab962a3e09d49c8
#100928 08dbcafabc2080956b7ea73f357437825e5f425f
#99736 8fe94dd4d8613fb8f3d997a9b776a9fa4898e6f9

previous master: 0421444f8f

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (9208625): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.7% [0.6%, 0.8%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
5.6% [3.0%, 7.1%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.4% [-3.4%, -3.4%] 1
All ❌✅ (primary) - - 0

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
3.8% [3.8%, 3.8%] 1
Regressions ❌
(secondary)
5.3% [5.3%, 5.3%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.5% [-2.5%, -2.5%] 1
All ❌✅ (primary) 3.8% [3.8%, 3.8%] 1

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@davidtwco davidtwco removed the A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic label Oct 4, 2022
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. 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. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet