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 8 pull requests #136762

Merged
merged 19 commits into from
Feb 9, 2025
Merged

Rollup of 8 pull requests #136762

merged 19 commits into from
Feb 9, 2025

Conversation

workingjubilee
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

bjoernager and others added 19 commits February 7, 2025 13:40
Signed-off-by: Shunpoco <tkngsnsk313320@gmail.com>
Because the neutral element of `<fNN as iter::Sum>` was changed to
`neg_zero`, the documentation needed to be updated, as it was reporting
inadequate information about what should be expected from the return.

Co-authored-by: Jubilee <workingjubilee@gmail.com>
…mutability-cap-violated, r=Nadrieril

Add a comment pointing to ICE-136223

Fixes rust-lang#136223

## Steps how the ICE happen
This explanation is based on the test case `&Some(Some(x)) = &Some(&mut Some(0))`.
The case should fail with E0596 error, but it catches the debug assertion instead.

1. For the first `&`: In check_pat_ref(), the value max_ref_mutbl becomes MutblCap::Not ([here](https://github.com/rust-lang/rust/blob/fdd1a3b02687817cea41f6bacae3d5fbed2b2cd0/compiler/rustc_hir_typeck/src/pat.rs#L2394-L2396)). Once max_ref_mutbl becomes Not, it will never be back to MutblCap::Mut.
2. For `&mut`: In peel_off_references(), because Some(x) doesn't have `&` nor `&mut`, `&mut` in `&mut Some(0)` is not consumed then default_binding_mode (def_br) becomes `ByRef::Yes(Mutability::Mut)` (around [here](https://github.com/rust-lang/rust/blob/fdd1a3b02687817cea41f6bacae3d5fbed2b2cd0/compiler/rustc_hir_typeck/src/pat.rs#L519-L536)). This will be inherited to the next step. So this pattern has the mismatch between `def_br=Yes(Mut)` and `max_ref_mutbl=Not` now.
3. For the value `0`: Because of the step 2, the default_binding_mode is `Yes(Mut)`, but max_ref_mutbl is `Not` from the step 1. It causes the assertion error [here](https://github.com/rust-lang/rust/blob/fdd1a3b02687817cea41f6bacae3d5fbed2b2cd0/compiler/rustc_hir_typeck/src/pat.rs#L427-L430).

## What this PR fixes
Step 1 has happened from [this commit](rust-lang@e2f3ce9) by deleting `no_ref_mut_behind_and` from the if block. In my understanding, after RFC3627 is released, step 1 should happen not only 2024 edition but also other editions to track MutblCap value. But for now, it should not happen for non-2024 edition. So I put it back.

NOTE: I think there is another solution - We should return an E0596 error in calc_default_binding_mode() instead of the debug assertion. Since the assertion is caused by the mismatch between `def_br = Yes(Mut)` and `max_ref_mutbl = Not`, but in my understanding this violation is the same as E0596. check_pat_ident() does returns E0596 by a similar reason [here](https://github.com/rust-lang/rust/blob/fdd1a3b02687817cea41f6bacae3d5fbed2b2cd0/compiler/rustc_hir_typeck/src/pat.rs#L837-L856).
Clean up `HashMap` and `HashSet` docs.

This commit makes some small, pedantic changes to the docs for `HashMap` and `HashSet`, which fixes that:

* "HashMap" is not always formatted as code (as in `HashMap`), and that
* `HashSet` sometimes references `HashMap` instead of itself.
…-updates, r=compiler-errors

compiler: mostly-finish `rustc_abi` updates

This almost-finishes all the updates in the compiler to use `rustc_abi` and removes some of the reexports of `rustc_abi` items in `rustc_target` that were previously available.

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

Document `Sum::sum` returns additive identities for `[]`

Because the neutral element of `<fNN as iter::Sum>` was changed to `neg_zero`, the documentation needed to be updated, as it was reporting inadequate information about what should be expected from the return.

Relevant Commit: rust-lang@4908188
Relevant Pull Request: rust-lang#129321

---

The referenced commit causes unintended side effects on presentation layer applications like using Tera templates, for example. I'm not sure what the motivation was behind the original change, but it seems like more discussion should be put into this issue and potentially have that change reverted.
…r=compiler-errors

Make `AsyncFnOnce`, `AsyncFnMut`, `AsyncFn` non-`#[fundamental]`

Address the issue rust-lang#136723 on nightly (the issue will only *actually* be fixed with a beta backport).
…, r=workingjubilee

Have a break from review rotation

Be busy on the job recently.
transmutability: fix ICE when passing wrong ADT to ASSUME

- Remove an incorrect assert that the `ASSUME` parameter has the type `Assume` and delay a bug instead.
- Since we checked the type of `ASSUME` is `Assume` (an ADT), its valtree must be a branch, so we can just unwrap it.

r? ```@jswrenn```
…ieyouxu

Small resolve refactor

I was looking into how resolve works in order to find a good way for clippy to shorten paths in messages and suggestions, and found a needless `.collect()` and a recursive function that could be written as a loop, also removed a panicky code path.
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-meta Area: Issues & PRs about the rust-lang/rust repository itself 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 Feb 9, 2025
@workingjubilee
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Contributor

bors commented Feb 9, 2025

📌 Commit 45289b7 has been approved by workingjubilee

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 Feb 9, 2025
@bors
Copy link
Contributor

bors commented Feb 9, 2025

⌛ Testing commit 45289b7 with merge 1ff2135...

@bors
Copy link
Contributor

bors commented Feb 9, 2025

☀️ Test successful - checks-actions
Approved by: workingjubilee
Pushing 1ff2135 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 9, 2025
@bors bors merged commit 1ff2135 into rust-lang:master Feb 9, 2025
7 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Feb 9, 2025
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#136397 Add a comment pointing to ICE-136223 fcc6d505e642d9b6cab9139b78de8a24006e037e (link)
#136686 Clean up HashMap and HashSet docs. fb6db3be4af1dd6c2ba921a05e5ba83c2ac2508c (link)
#136706 compiler: mostly-finish rustc_abi updates 104097331f8a68899f30d5850a82bf67a5eb41d2 (link)
#136710 Document Sum::sum returns additive identities for [] 4c9be1f048017cb54528e04ca931804362e0a938 (link)
#136724 Make AsyncFnOnce, AsyncFnMut, AsyncFn non-`#[fundamen… 82f43def7690a552cb2f757638e8bd4100bfef85 (link)
#136727 Have a break from review rotation 34ce9b5eef940fc147fa760e0e3ff5a5fa862b15 (link)
#136730 transmutability: fix ICE when passing wrong ADT to ASSUME 8f824b0d58c4dc04f2b7378110fcf77f9d0e86ba (link)
#136736 Small resolve refactor 9f3e2d4572a98b8e8ffa6879d64c045b358eec64 (link)

previous master: 43ca9d18e3

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 (1ff2135): 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 (secondary 1.6%)

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

Cycles

Results (secondary -2.5%)

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.5% [-2.5%, -2.5%] 1
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 780.488s -> 781.536s (0.13%)
Artifact size: 329.04 MiB -> 329.13 MiB (0.03%)

@workingjubilee workingjubilee deleted the rollup-23fn0nl branch February 9, 2025 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-meta Area: Issues & PRs about the rust-lang/rust repository itself 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants