Skip to content

Rollup of 15 pull requests #145691

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

Closed
wants to merge 31 commits into from
Closed

Conversation

jhpratt
Copy link
Member

@jhpratt jhpratt commented Aug 21, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

fee1-dead and others added 30 commits July 3, 2025 23:43
Add a few links to the collections mentioned in the module doc for Collections.
Just like we implemented relatively complex rules to imply other extensions
**from** "C" (and some others), this commit implements implication
**to** the "C" extension from others, complying the following text
in the ISA Manual (although there's no direct imply/depend references).

> The C extension is the superset of the following extensions:
>
> - Zca
> - Zcf if F is specified (RV32 only)
> - Zcd if D is specified

This is formally verified so that no other extension combinations
(*not* in this implementation) can (currently) imply the "C" extension.
`ModKind::Loaded` has an `inline` field and a `had_parse_error` field.
If the `inline` field is `Inline::Yes` then `had_parse_error` must be
`Ok(())`.

This commit moves the `had_parse_error` field into the `Inline::No`
variant. This makes it impossible to create the nonsensical combination
of `inline == Inline::Yes` and `had_parse_error = Err(_)`.
…egen-backend` and `--override-codegen-backend`
…t while proving a where-clause

Signed-off-by: xizheyin <[email protected]>
Consolidate all the panicking functions in `slice/index.rs` to use a single
`slice_index_fail` function, similar to how it is done in `str/traits.rs`.
The return type is correct in the source code but incorrect in the docstring
…y, r=dtolnay

stabilize `const_array_each_ref`

cc rust-lang#133289, needs FCP.
[Doc] Add links to the various collections

Add a few links to the collections mentioned in the module doc for Collections.
…quality, r=WaffleLapkin,lcnr

Defer tail call ret ty equality to check_tail_calls

Fixes rust-lang#144892.

Currently the tail call signature check assumes that return types have been accounted for. However, this is not complete for several reasons.

Firstly, we were using subtyping instead of equality in the HIR typeck code:

https://github.com/rust-lang/rust/blob/e1b9081e699065badfc1a9419ec9566e5c8615c4/compiler/rustc_hir_typeck/src/expr.rs#L1096

We could fix this, but it doesn't really do much for us anyways since HIR typeck doesn't care about regions.

That means, secondly, we'd need to fix the terminator type check in MIR typeck to account for variances, since tail call terminators need to relate their arguments invariantly to account for the "signature must be equal" rule. This seems annoying.

All of this seems like a lot of work, and we already are *manually* checking argument equality. Let's just extend the `check_tail_calls` to account for mismatches in return types anyways.

r? ````@WaffleLapkin````
…nicking, r=jhpratt

Consolidate panicking functions in `slice/index.rs`

Consolidate all the panicking functions in `slice/index.rs` to use a single `slice_index_fail` function, similar to how it is done in `str/traits.rs`.

Split off from rust-lang#145024
…gen-backend, r=Kobzol,bjorn3

Add new `--test-codegen-backend` bootstrap option

This new bootstrap command line flag allows to do:

```shell
./x.py test tests/ui/intrinsics/panic-uninitialized-zeroed.rs --stage 1 -j8 --test-codegen-backend gcc
```

This is the last step before running it into the CI.

Supersedes rust-lang#144687.

r? ````@Kobzol````
…wesleywiser

fix(debuginfo): handle false positives in overflow check

Fixes rust-lang#144636.

Duplicate wrappers and normal recursive types can lead to false positives.
```rust
struct Recursive {
	a: Box<Box<Recursive>>,
}
```
The ADT stack can be:
- `Box<Recursive>`
- `Recursive`
- `Box<Box<Recursive>>` (`Box` now detected as expanding)

We can filter them out by tracing the generic arg back through the stack, as true expanding recursive types must have their expanding arg used as generic arg throughout.

r? ``@wesleywiser``
…nieu

std_detect: RISC-V: implement implication to "C"

Just like we implemented relatively complex rules to imply other extensions **from** "C" (and some others), this commit implements implication **to** the "C" extension from others, complying the following text in the ISA Manual (although there's no direct imply/depend references).

> The C extension is the superset of the following extensions:
>
> - Zca
> - Zcf if F is specified (RV32 only)
> - Zcd if D is specified

This is formally verified so that no other extension combinations (*not* in this implementation) can (currently) imply the "C" extension.

Note: this is a `std_detect` change and not main target feature handling.
…ochenkov

Prevent impossible combinations in `ast::ModKind`.

`ModKind::Loaded` has an `inline` field and a `had_parse_error` field. If the `inline` field is `Inline::Yes` then `had_parse_error` must be `Ok(())`.

This commit moves the `had_parse_error` field into the `Inline::No` variant. This makes it impossible to create the nonsensical combination of `inline == Inline::Yes` and `had_parse_error = Err(_)`.

r? `@Urgau`
…enkov

Fix some doc typos

Hi all

Hope the changes are in the correct repo.
If not please point me towards the correct locations.

Cheers
Do not use effective_visibilities query for Adt types of a local trait while proving a where-clause

Partially fix rust-lang#145611, but we should do something make cycle in this situation ICE.

Instead of using a query, call `&tcx.resolutions(()).effective_visibilities`.

r? ```@lcnr```

cc ```@compiler-errors```
…ts-path, r=fmease

Fix JS search scripts path

`rootPath` always end with a `/` so we should not add one. Interestingly enough, it only triggers the bug on a website (like https://doc.rust-lang.org/nightly/std/).

Follow-up of rust-lang#144476.
Fixes rust-lang#145646.

cc ```@notriddle```
r? ```@fmease```
Download CI GCC into the correct directory

While doing various experiments with stage3 cross-compilations, I realized that bootstrap is unable to download LLVM from CI for a non-host target, which is quite annoying. Fixing this for LLVM will take some work, but in the meantime we can easily fix this for `download-ci-gcc`, which was implemented in a much more self-contained way.
…iler-errors

Enforce correct number of arguments for `"x86-interrupt"` functions

Tracking issue: rust-lang#40180

Partially fixes rust-lang#132835

```@rustbot``` label: +F-abi_x86_interrupt +A-LLVM +O-x86_64 +O-x86_32 +A-ABI
…ce, r=Kobzol

Enable triagebot `[review-changes-since]` feature

This PR enables triagebot [`[review-changes-since]` feature](https://forge.rust-lang.org/triagebot/review-changes-since.html).

It's a complement to triagebot `[range-diff]` feature which adds at the end of a review body a link to view the changes that happened since the review.

Asked in [#t-compiler > Experimental range-diff for force-push @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Experimental.20range-diff.20for.20force-push/near/534963522)

r? Kobzol
@rustbot rustbot added A-compiletest Area: The compiletest test runner A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-rustdoc-search Area: Rustdoc's search feature A-testsuite Area: The testsuite used to check the correctness of rustc F-explicit_tail_calls `#![feature(explicit_tail_calls)]` 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-clippy Relevant to the Clippy team. 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-release Relevant to the release subteam, 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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue. labels Aug 21, 2025
@jhpratt
Copy link
Member Author

jhpratt commented Aug 21, 2025

@bors r+ rollup=never p=5

@rustbot rustbot added the rollup A PR which is a rollup label Aug 21, 2025
@bors
Copy link
Collaborator

bors commented Aug 21, 2025

📌 Commit f250b8e has been approved by jhpratt

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 Aug 21, 2025
@bors
Copy link
Collaborator

bors commented Aug 21, 2025

⌛ Testing commit f250b8e with merge b499c5c...

bors added a commit that referenced this pull request Aug 21, 2025
Rollup of 15 pull requests

Successful merges:

 - #143383 (stabilize `const_array_each_ref`)
 - #144758 ([Doc] Add links to the various collections)
 - #144915 (Defer tail call ret ty equality to check_tail_calls)
 - #145137 (Consolidate panicking functions in `slice/index.rs`)
 - #145256 (Add new `--test-codegen-backend` bootstrap option)
 - #145297 (fix(debuginfo): handle false positives in overflow check)
 - #145415 (std_detect: RISC-V: implement implication to "C")
 - #145590 (Prevent impossible combinations in `ast::ModKind`.)
 - #145621 (Fix some doc typos)
 - #145642 (Do not use effective_visibilities query for Adt types of a local trait while proving a where-clause)
 - #145650 (Fix JS search scripts path)
 - #145654 (Download CI GCC into the correct directory)
 - #145662 (Enforce correct number of arguments for `"x86-interrupt"` functions)
 - #145674 (Enable triagebot `[review-changes-since]` feature)
 - #145678 (Fix typo in docstring)

r? `@ghost`
`@rustbot` modify labels: rollup
@rust-log-analyzer
Copy link
Collaborator

The job test-various failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
test [mir-opt] tests/mir-opt/unusual_item_types.rs ... ok

failures:

---- [mir-opt] tests/mir-opt/pre-codegen/slice_index.rs stdout ----
4     debug slice => _1;
5     debug index => _2;
6     let mut _0: &[u32];
+     let mut _3: usize;
+     let mut _4: usize;
7     scope 1 (inlined #[track_caller] core::slice::index::<impl Index<std::ops::Range<usize>> for [u32]>::index) {
+         scope 2 (inlined #[track_caller] <std::ops::Range<usize> as SliceIndex<[u32]>>::index) {
+             let mut _7: usize;
+             let mut _8: bool;
+             let mut _9: *const [u32];
+             let _12: *const [u32];
+             let mut _13: usize;
+             let mut _14: !;
+             scope 3 (inlined core::num::<impl usize>::checked_sub) {
+                 let mut _5: bool;
+                 let mut _6: usize;
+             }
+             scope 4 (inlined core::slice::index::get_offset_len_noubcheck::<u32>) {
+                 let _10: *const u32;
+                 scope 5 {
+                     let _11: *const u32;
+                     scope 6 {
+                     }
+                 }
+             }
+         }
8     }
9 
10     bb0: {

-         _0 = <std::ops::Range<usize> as SliceIndex<[u32]>>::index(move _2, move _1) -> [return: bb1, unwind unreachable];
+         _3 = move (_2.0: usize);
+         _4 = move (_2.1: usize);
+         StorageLive(_5);
+         _5 = Lt(copy _4, copy _3);
+         switchInt(move _5) -> [0: bb1, otherwise: bb4];
12     }
13 
14     bb1: {

+         _6 = SubUnchecked(copy _4, copy _3);
+         StorageDead(_5);
+         StorageLive(_8);
+         StorageLive(_7);
+         _7 = PtrMetadata(copy _1);
+         _8 = Le(copy _4, move _7);
+         switchInt(move _8) -> [0: bb2, otherwise: bb3];
+     }
+ 
+     bb2: {
+         StorageDead(_7);
+         goto -> bb5;
---
+         StorageLive(_9);
+         _9 = &raw const (*_1);
+         StorageLive(_10);
+         StorageLive(_11);
+         _10 = copy _9 as *const u32 (PtrToPtr);
+         _11 = Offset(copy _10, copy _3);
+         _12 = *const [u32] from (copy _11, copy _6);
+         StorageDead(_11);
+         StorageDead(_10);
+         StorageDead(_9);
+         _0 = &(*_12);
+         StorageDead(_12);
---
+     }
+ 
+     bb5: {
+         StorageLive(_13);
+         _13 = PtrMetadata(copy _1);
+         _14 = core::slice::index::slice_index_fail(move _3, move _4, move _13) -> unwind unreachable;
16     }
17 }
18 


thread '[mir-opt] tests/mir-opt/pre-codegen/slice_index.rs' panicked at src/tools/compiletest/src/runtest/mir_opt.rs:84:21:
Actual MIR output differs from expected MIR output /checkout/tests/mir-opt/pre-codegen/slice_index.slice_index_range.PreCodegen.after.panic-abort.mir
stack backtrace:
   0: __rustc::rust_begin_unwind
             at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/std/src/panicking.rs:697:5
   1: core::panicking::panic_fmt
             at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/core/src/panicking.rs:75:14

@bors
Copy link
Collaborator

bors commented Aug 21, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 21, 2025
@jhpratt jhpratt closed this Aug 21, 2025
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 21, 2025
@jhpratt jhpratt deleted the rollup-fekj1bx branch August 21, 2025 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiletest Area: The compiletest test runner A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-rustdoc-search Area: Rustdoc's search feature A-testsuite Area: The testsuite used to check the correctness of rustc F-explicit_tail_calls `#![feature(explicit_tail_calls)]` rollup A PR which is a rollup T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-clippy Relevant to the Clippy team. 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-release Relevant to the release subteam, 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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.