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 6 pull requests #115940

Merged
merged 13 commits into from
Sep 18, 2023
Merged

Rollup of 6 pull requests #115940

merged 13 commits into from
Sep 18, 2023

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

Gumichocopengin8 and others added 13 commits September 7, 2023 22:18
Add `minmax{,_by,_by_key}` functions to `core::cmp`

This PR adds the following functions:

```rust
// mod core::cmp
#![unstable(feature = "cmp_minmax")]

pub fn minmax<T>(v1: T, v2: T) -> [T; 2]
where
    T: Ord;

pub fn minmax_by<T, F>(v1: T, v2: T, compare: F) -> [T; 2]
where
    F: FnOnce(&T, &T) -> Ordering;

pub fn minmax_by_key<T, F, K>(v1: T, v2: T, mut f: F) -> [T; 2]
where
    F: FnMut(&T) -> K,
    K: Ord;
```
(they are also `const` under `#[feature(const_cmp)]`, I've omitted `const` stuff for simplicity/readability)

----

Semantically these functions are equivalent to `{ let mut arr = [v1, v2]; arr.sort(); arr }`, but since they operate on 2 elements only, they are implemented as a single comparison.

Even though that's basically a sort, I think "sort 2 elements" operation is useful on it's own in many cases. Namely, it's a common pattern when you have 2 things, and need to know which one is smaller/bigger to operate on them differently.

I've wanted such functions countless times, most recently in rust-lang#109402, so I thought I'd propose them.

----

r? libs-api
…mulacrum

get rid of duplicate primitive_docs

Having this duplicate makes editing that file very annoying. And at least locally the generated docs still look perfectly fine...
…action, r=Mark-Simulacrum

ci: actions/checkout@v3 to actions/checkout@v4

- Bump `actions/checkout` from v3 to v4 since v3 uses Node v16 whose support lasts until `11 Sep 2023` [Ref](https://endoflife.date/nodejs)
  - https://github.com/actions/checkout/releases/tag/v4.0.0
…compiler-errors

Explain revealing of opaque types in layout_of ParamEnv

r? `@compiler-errors`

~~I feel like `layout_of` is doing too many things at once, and I don't really know why. It could allow us to if callers could decide whether to reveal opaque types.~~

Looks like this also exists as a performance optimization. While we could probably figure out a way to do this, all the ones I came up with are fragile as `layout_of` callers now suddenly need to be careful what ParamEnv they pass in.
…r=nnethercote

simplify inject_impl_of_structural_trait

There's a comment at `inject_impl_of_structural_trait` saying we cannot use `TraitDef`, but that comment is outdated -- we *can* use `TraitDef` nowadays since it has the `skip_path_as_bound` flag. (The flag needed some fixing, though.)
…obzol

Expand infra-ci reviewer list

r? `@Kobzol`
@rustbot rustbot added A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure 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. rollup A PR which is a rollup labels Sep 18, 2023
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=6

@bors
Copy link
Contributor

bors commented Sep 18, 2023

📌 Commit 966f240 has been approved by matthiaskrgr

It is now in the queue for this repository.

@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 Sep 18, 2023
@bors
Copy link
Contributor

bors commented Sep 18, 2023

⌛ Testing commit 966f240 with merge 4d69266...

bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 18, 2023
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#109409 (Add `minmax{,_by,_by_key}` functions to `core::cmp`)
 - rust-lang#115494 (get rid of duplicate primitive_docs)
 - rust-lang#115663 (ci: actions/checkout@v3 to actions/checkout@v4)
 - rust-lang#115762 (Explain revealing of opaque types in layout_of ParamEnv)
 - rust-lang#115891 (simplify inject_impl_of_structural_trait)
 - rust-lang#115932 (Expand infra-ci reviewer list)

r? `@ghost`
`@rustbot` modify labels: rollup
@matthiaskrgr matthiaskrgr reopened this Sep 18, 2023
@matthiaskrgr
Copy link
Member Author

@bors r+

@bors
Copy link
Contributor

bors commented Sep 18, 2023

💡 This pull request was already approved, no need to approve it again.

  • This pull request is currently being tested. If there's no response from the continuous integration service, you may use retry to trigger a build again.

@bors
Copy link
Contributor

bors commented Sep 18, 2023

📌 Commit 966f240 has been approved by matthiaskrgr

It is now in the queue for this repository.

@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@bors
Copy link
Contributor

bors commented Sep 18, 2023

⌛ Testing commit 966f240 with merge 65ea825...

@bors
Copy link
Contributor

bors commented Sep 18, 2023

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 65ea825 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 18, 2023
@bors bors merged commit 65ea825 into rust-lang:master Sep 18, 2023
@rustbot rustbot added this to the 1.74.0 milestone Sep 18, 2023
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#109409 Add minmax{,_by,_by_key} functions to core::cmp c6992dd7d0734ed45cef4c408a728871529bb638 (link)
#115494 get rid of duplicate primitive_docs 66ccbecce28c61369a9a55f4749f9e813db60d46 (link)
#115663 ci: actions/checkout@v3 to actions/checkout@v4 92406afc2cfb51ded91d79fa61fa472d4eb73148 (link)
#115762 Explain revealing of opaque types in layout_of ParamEnv 8ce22a024ebcf438704853d63c8adb7782b861b1 (link)
#115891 simplify inject_impl_of_structural_trait 59304054054576f310ad1db598b6d9a43f72a8d6 (link)
#115932 Expand infra-ci reviewer list 5315aeb8c573610fb990f5a4eacc9e16c222a77a (link)

previous master: cebb9cfd4f

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 (65ea825): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.4% [0.9%, 4.8%] 3
Improvements ✅
(primary)
-2.3% [-2.3%, -2.3%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.3% [-2.3%, -2.3%] 1

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 631.896s -> 632.986s (0.17%)
Artifact size: 317.84 MiB -> 317.88 MiB (0.01%)

@matthiaskrgr matthiaskrgr deleted the rollup-5ps9ln1 branch March 16, 2024 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-testsuite Area: The testsuite used to check the correctness of rustc 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-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants