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 9 pull requests #120375

Merged
merged 137 commits into from
Jan 26, 2024
Merged

Rollup of 9 pull requests #120375

merged 137 commits into from
Jan 26, 2024

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

Jules-Bertholet and others added 30 commits October 30, 2023 21:16
Renamed "group by" to "chunk by" a per rust-lang#80552.

Newly stable items:

* `core::slice::ChunkBy`
* `core::slice::ChunkByMut`
* `[T]::chunk`
* `[T]::chunk_by`

Closes rust-lang#80552.
This commit:
- now makes `HirEqInterExpr::eq_block` take comments into account. Identical code with varying comments will no longer be considered equal.
- makes necessary adjustments to UI tests.
Arc's documentation uses the term "thread", aligning to that terminology. Fix typo in "Rc".
One consequence is that errors returned by
`maybe_new_parser_from_source_str` now must be consumed, so a bunch of
places that previously ignored those errors now cancel them. (Most of
them explicitly dropped the errors before. I guess that was to indicate
"we are explicitly ignoring these", though I'm not 100% sure.)
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#119448 (annotate-snippets: update to 0.10)
 - rust-lang#119813 (Silence some follow-up errors [2/x])
 - rust-lang#119836 (chore: remove unnecessary blank line)
 - rust-lang#119841 (Remove `DiagnosticBuilder::buffer`)
 - rust-lang#119842 (coverage: Add enums to accommodate other kinds of coverage mappings)
 - rust-lang#119845 (rint: further doc tweaks)
 - rust-lang#119852 (give const-err4 a more descriptive name)
 - rust-lang#119853 (rustfmt.toml: don't ignore just any tests path, only root one)

r? `@ghost`
`@rustbot` modify labels: rollup
…dnet

I'm not on vacation (again)

A few weeks ago I opened rust-lang#12011 removing me from `users_on_vacation`, it got merged. The subtree sync reverted this change (weirdly)

changelog: none

r? `@xFrednet`
Fix suggestion for `map_clone` lint on types implementing `Copy`

Follow-up of rust-lang/rust-clippy#12104.

It was missing this check to suggest the correct method.

r? `@llogiq`

changelog: Fix suggestion for `map_clone` lint on types implementing `Copy`
… r=davidtwco

Check rust lints when an unknown lint is detected

Fixes rust-lang#118183
…rsion-false-positive, r=llogiq

Fix false positive in `PartialEq` check in `unconditional_recursion` lint

Fixes rust-lang/rust-clippy#12133.

We needed to check for the type of the previous element <del>in case it's a field</del>.

EDIT: After some extra thoughts, no need to check if it's a field, just if it's the same type as `Self`.

r? `@llogiq`

changelog: Fix false positive in `PartialEq` check in `unconditional_recursion` lint
- lint if the lock was in a nested pattern
- lint if the lock is inside a `Result<Lock, _>`
…_is_some, r=llogiq

Improve help message for `search_is_some` lint

Fixes rust-lang#11681.

Like mentioned in the issue, we tend to use the formulation "consider using", which we didn't in this case. I think it clears both the confusion and also makes help message more coherent overall.

r? `@llogiq`

changelog: Improve help message for `search_is_some` lint
…,lcnr

Delegation implementation: step 1

See rust-lang#118212 for more details.

r? `@petrochenkov`
bjorn3 and others added 10 commits January 26, 2024 12:15
…stmt-expr-attributes, r=petrochenkov

Make `#![allow_internal_unstable(..)]` work with `stmt_expr_attributes`

This is a necessary first step to fixing rust-lang#117304, as explained in rust-lang#117304 (comment).

`@rustbot` label T-compiler
…r=dtolnay

Stabilize `slice_group_by`

Renamed "group by" to "chunk by" a per rust-lang#80552.

Newly stable items:

* `core::slice::ChunkBy`
* `core::slice::ChunkByMut`
* `[T]::chunk`
* `[T]::chunk_by`

Closes rust-lang#80552.
Remove special-case handling of `vec.split_off(0)`

rust-lang#76682 added special handling to `Vec::split_off` for the case where `at == 0`. Instead of copying the vector's contents into a freshly-allocated vector and returning it, the special-case code steals the old vector's allocation, and replaces it with a new (empty) buffer with the same capacity.

That eliminates the need to copy the existing elements, but comes at a surprising cost, as seen in rust-lang#119913. The returned vector's capacity is no longer determined by the size of its contents (as would be expected for a freshly-allocated vector), and instead uses the full capacity of the old vector.

In cases where the capacity is large but the size is small, that results in a much larger capacity than would be expected from reading the documentation of `split_off`. This is especially bad when `split_off` is called in a loop (to recycle a buffer), and the returned vectors have a wide variety of lengths.

I believe it's better to remove the special-case code, and treat `at == 0` just like any other value:
- The current documentation states that `split_off` returns a “newly allocated vector”, which is not actually true in the current implementation when `at == 0`.
- If the value of `at` could be non-zero at runtime, then the caller has already agreed to the cost of a full memcpy of the taken elements in the general case. Avoiding that copy would be nice if it were close to free, but the different handling of capacity means that it is not.
- If the caller specifically wants to avoid copying in the case where `at == 0`, they can easily implement that behaviour themselves using `mem::replace`.

Fixes rust-lang#119913.
… r=m-ou-se

Update `std::io::Error::downcast` return type

and update its doc according to decision made by rust libs-api team in rust-lang#99262 (comment)
…1-dead

RFC 3349 precursors

Some cleanups I found while working on RFC 3349 that are worth landing separately.

r? `@fee1-dead`
…elwoerister

privacy: Refactor top-level visiting in `NamePrivacyVisitor`

Full hierarchical visiting (`nested_filter::All`) is not necessary, visiting all item-likes in isolation is enough.
Tracking current item is not necessary, passing any `HirId` with the same parent module to `adjust_ident_and_get_scope` is enough.

Follow up to rust-lang#120284.
…Manishearth

Clippy subtree update

r? `@Manishearth`

Closes rust-lang/rust-clippy#12148
…lcnr

Don't fire `OPAQUE_HIDDEN_INFERRED_BOUND` on sized return of AFIT

Conceptually, we should probably not fire `OPAQUE_HIDDEN_INFERRED_BOUND` for methods like:

```
trait Foo { async fn bar() -> Self; }
```

Even though we technically cannot prove that `Self: Sized`, which is one of the item bounds of the `Output` type in the `-> impl Future<Output = Sized>` from the async desugaring.

This is somewhat justifiable along the same lines as how we allow regular methods to return `-> Self` even though `Self` isn't sized.

Fixes rust-lang#113538

(side-note: some days i wonder if we should just remove the `OPAQUE_HIDDEN_INFERRED_BOUND` lint... it does make me sad that we have non-well-formed types in signatures, though.)
@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. rollup A PR which is a rollup labels Jan 26, 2024
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=9

@bors
Copy link
Contributor

bors commented Jan 26, 2024

📌 Commit d1c3dde 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 Jan 26, 2024
@bors
Copy link
Contributor

bors commented Jan 26, 2024

⌛ Testing commit d1c3dde with merge e7bbe8c...

@bors
Copy link
Contributor

bors commented Jan 26, 2024

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 26, 2024
@bors bors merged commit e7bbe8c into rust-lang:master Jan 26, 2024
12 checks passed
@rustbot rustbot added this to the 1.77.0 milestone Jan 26, 2024
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#117420 Make #![allow_internal_unstable(..)] work with `stmt_expr… 0705f0b83759462ddc84ce2cf3c01438ce840744 (link)
#117678 Stabilize slice_group_by 48e1307f3d8b2fa74294ebaa23fe48b3c4c5fca3 (link)
#119710 Improve let_underscore_lock ❌ conflicts merging '3b7ba1d10a' into previous master ❌
#119819 Check rust lints when an unknown lint is detected ❌ conflicts merging '1485e5c4da' into previous master ❌
#119869 replace track_errors usages with bubbling up `ErrorGuaran… ❌ conflicts merging '4488653ec6' into previous master ❌
#119917 Remove special-case handling of vec.split_off(0) c0ccc8612911fae15e547d0ce2a9ec80ab284f6d (link)
#119978 Move async closure parameters into the resultant closure's … ❌ conflicts merging 'f7376a0f8c' into previous master ❌
#120000 Ensure callee_ids are body owners ❌ conflicts merging '6a331e37fb' into previous master ❌
#120117 Update std::io::Error::downcast return type 2d26783d651074a6bd4283760e29599e5170f984 (link)
#120329 RFC 3349 precursors ae065d75c0032494574ad25a4c22664ec7590f51 (link)
#120339 privacy: Refactor top-level visiting in NamePrivacyVisitor 932e505fb0eff386b4846af99aac3aaba4a6a2d3 (link)
#120345 Clippy subtree update 8bd66cbaa2ca67f3075b589d9c8011c590328dba (link)
#120360 Don't fire OPAQUE_HIDDEN_INFERRED_BOUND on sized return o… 53dc1c10890ea0625af28a30cff03783db5194e2 (link)
#120372 Fix outdated comment on Box 8af1fa62fc709bed2e995b7a311cbc39f632bd2e (link)

previous master: cdd4ff8d81

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

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

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
cc @rust-lang/wg-compiler-performance

Instruction count

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

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.3% [0.3%, 0.4%] 3
Improvements ✅
(primary)
-0.2% [-0.2%, -0.2%] 6
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.2% [-0.2%, -0.2%] 6

Max RSS (memory usage)

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

Cycles

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

Binary size

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.0% [-0.0%, -0.0%] 3
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.0% [-0.0%, -0.0%] 3

Bootstrap: 663.841s -> 660.662s (-0.48%)
Artifact size: 308.14 MiB -> 308.15 MiB (0.00%)

@rustbot rustbot added the perf-regression Performance regression. label Jan 26, 2024
@Kobzol
Copy link
Contributor

Kobzol commented Jan 26, 2024

Improvements outweigh the regression (also a nice bootstrap win, but that could be noise).

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Jan 26, 2024
@matthiaskrgr matthiaskrgr deleted the rollup-ueakvms branch March 16, 2024 18:19
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. perf-regression-triaged The performance regression has been triaged. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.