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

Merged
merged 22 commits into from
May 10, 2024
Merged

Rollup of 7 pull requests #124961

merged 22 commits into from
May 10, 2024

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

Swatinem and others added 22 commits May 1, 2024 09:54
In order to inform future perf improvements and prevent regressions,
lets add some benchmarks that stress `impl Debug for str`.
Also sort the features.
I tried simplifying `RegionCtxt`, which led me to finding that the
fields are printed in `sccs_info`.
The comment mentions that `ReBound` and `ReVar` aren't expected here.
Experimentation with the full test suite indicates this is true, and
that `ReErased` also doesn't occur. So the commit introduces `bug!` for
those cases. (If any of them show up later on, at least we'll have a
test case.)

The commit also remove the first sentence in the comment.
`RePlaceholder` is now handled in the match arm above this comment and
nothing is printed for it, so that sentence is just wrong. Furthermore,
issue rust-lang#13998 was closed some time ago.
xz crate consist of simple reexport of xz2 crate. Why? Idk.
`InferCtxt::next_{ty,const,int,float}_var_id` each have a single call
site, in `InferCtt::next_{ty,const,int,float}_var` respectively.

The only remaining method that creates a var_id is
`InferCtxt::next_ty_var_id_in_universe`, which has one use outside the
crate.
`InferCtxt::next_{ty,const}_var*` all take an origin, but the
`param_def_id` is almost always `None`. This commit changes them to just
take a `Span` and build the origin within the method, and adds new
methods for the rare cases where `param_def_id` might not be `None`.
This avoids a lot of tedious origin building.

Specifically:
- next_ty_var{,_id_in_universe,_in_universe}: now take `Span` instead of
  `TypeVariableOrigin`
- next_ty_var_with_origin: added

- next_const_var{,_in_universe}: takes Span instead of ConstVariableOrigin
- next_const_var_with_origin: added

- next_region_var, next_region_var_in_universe: these are unchanged,
  still take RegionVariableOrigin

The API inconsistency (ty/const vs region) seems worth it for the
large conciseness improvements.
The type name has changed.
The use of `Binder` was removed in the recent rust-lang#123900, but the comment
wasn't removed at the same time.
Thus eliminating a `FIXME` comment.
Add benchmarks for `impl Debug for str`

In order to inform future perf improvements and prevent regressions, lets add some benchmarks that stress `impl Debug for str`.

---

As I am currently working on improving the perf in rust-lang#121150, its nice to have these benchmarks.

Writing them, I also saw that escapes are written out one char at a time, even though other parts of the code are already optimizing that via `as_str`, which I intend to do as well as a followup improvement.

r? ``@cuviper``
☝🏻 as you were also assigned to rust-lang#121150, CC ``@the8472`` if you want to steal the review :-)
… r=bjorn3

`rustc_target` cleanups

Minor improvement I found while looking at this code.

r? ```@lqd```
Eliminate some `FIXME(lcnr)` comments

In some cases this involved changing code. In some cases the comment was able to removed or replaced.

r? ``@lcnr``
opt-dist: use xz2 instead of xz crate

xz crate consist of simple reexport of xz2 crate. Why? Idk.

Totally not a backdoor.
analyse visitor: build proof tree in probe

see inline comments

fixes rust-lang#124791
fixes rust-lang#124702

r? ```@compiler-errors```
…errors

always use `GenericArgsRef`

r? ```@compiler-errors```
Use fewer origins when creating type variables.

To reduce lots of repetitive boilerplate code. Details in the individual commit messages.

r? ``@lcnr``
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative rollup A PR which is a rollup labels May 10, 2024
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=7

@bors
Copy link
Contributor

bors commented May 10, 2024

📌 Commit 0ee2580 has been approved by matthiaskrgr

It is now in the queue for this repository.

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 10, 2024
@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 May 10, 2024
@bors
Copy link
Contributor

bors commented May 10, 2024

⌛ Testing commit 0ee2580 with merge f7b1501...

@bors
Copy link
Contributor

bors commented May 10, 2024

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 10, 2024
@bors bors merged commit f7b1501 into rust-lang:master May 10, 2024
7 checks passed
@rustbot rustbot added this to the 1.80.0 milestone May 10, 2024
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#124551 Add benchmarks for impl Debug for str d687e70dff26927d1095e1c10db47cf6be1469b0 (link)
#124915 rustc_target cleanups 951441a3297bd4db53126359a8ef776b45d626ba (link)
#124918 Eliminate some FIXME(lcnr) comments 482ec7f872d208e06ff4baaf1936a1cc42bb71a4 (link)
#124927 opt-dist: use xz2 instead of xz crate 06739e9fc6a45131b4e5ff118180e8f2920866b1 (link)
#124936 analyse visitor: build proof tree in probe dc8c3d6619c1fcad27c297b6cdff3d056498596d (link)
#124943 always use GenericArgsRef 7549fcc7174ae9730ca47561e7179ddc8327f2ea (link)
#124955 Use fewer origins when creating type variables. b985ca04d230d595e876d2aaf544c7bf1f1958d0 (link)

previous master: 98dabb622a

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 (f7b1501): 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)
2.7% [2.7%, 2.7%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.7% [2.7%, 2.7%] 1

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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.3% [-2.4%, -2.2%] 2
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 676.574s -> 674.951s (-0.24%)
Artifact size: 315.82 MiB -> 315.92 MiB (0.03%)

flip1995 pushed a commit to flip1995/rust that referenced this pull request May 17, 2024
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#124551 (Add benchmarks for `impl Debug for str`)
 - rust-lang#124915 (`rustc_target` cleanups)
 - rust-lang#124918 (Eliminate some `FIXME(lcnr)` comments)
 - rust-lang#124927 (opt-dist: use xz2 instead of xz crate)
 - rust-lang#124936 (analyse visitor: build proof tree in probe)
 - rust-lang#124943 (always use `GenericArgsRef`)
 - rust-lang#124955 (Use fewer origins when creating type variables.)

r? `@ghost`
`@rustbot` modify labels: rollup
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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants