Skip to content

Rollup of 13 pull requests #142333

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 36 commits into from

Conversation

workingjubilee
Copy link
Member

@workingjubilee workingjubilee commented Jun 11, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

NotLebedev and others added 30 commits May 27, 2025 11:12
```
error[E0621]: explicit lifetime required in the type of `x`
  --> $DIR/42701_one_named_and_one_anonymous.rs:10:9
   |
LL |         &*x
   |         ^^^ lifetime `'a` required
   |
help: add explicit lifetime `'a` to the type of `x`
   |
LL | fn foo2<'a>(a: &'a Foo, x: &'a i32) -> &'a i32 {
   |                             ++
```
Lets the test still work on different architectures.
We move the vectorcall ABI tests into their own file which is now
only run on x86-64, while replacing them with rust-cold ABI tests
so that aarch64 hosts continue to test an unstable ABI.

A better solution might be cross-compiling or something but
I really don't have time for that right now.
Some architectures gain target-cpu minimums in doing so.
To centralize this hack in one place with a backlink to the issue
tracking this hack, as this logic is also needed by compiletest to
implement a `//@ needs-target-std` directive.
To support tests to condition their (potentially cross-compile)
execution based on whether the target supports std.
Instead of a jumble of `ignore-$target`s, `ignore-none` and
`ignore-nvptx`.
```
error: cannot find attribute `empty_helper` in this scope
  --> $DIR/derive-helper-legacy-limits.rs:17:3
   |
LL | #[empty_helper]
   |   ^^^^^^^^^^^^
   |
help: `empty_helper` is an attribute that can be used by the derive macro `Empty`, you might be missing a `derive` attribute
   |
LL + #[derive(Empty)]
LL | struct S2;
   |
```

Look at proc-macro attributes when encountering unknown attribute

```
error: cannot find attribute `sede` in this scope
  --> src/main.rs:18:7
   |
18 |     #[sede(untagged)]
   |       ^^^^
   |
help: the derive macros `Serialize` and `Deserialize` accept the similarly named `serde` attribute
   |
18 |     #[serde(untagged)]
   |       ~~~~~

error: cannot find attribute `serde` in this scope
  --> src/main.rs:12:7
   |
12 |     #[serde(untagged)]
   |       ^^^^^
   |
   = note: `serde` is in scope, but it is a crate, not an attribute
help: `serde` is an attribute that can be used by the derive macros `Serialize` and `Deserialize`, you might be missing a `derive` attribute
   |
10 | #[derive(Serialize, Deserialize)]
   |
```
No changes; just removing the `self` that wasn't needed.
Look at proc-macro attributes when encountering unknown attribute

```
error: cannot find attribute `sede` in this scope
  --> $DIR/missing-derive-2.rs:22:7
   |
LL |     #[sede(untagged)]
   |       ^^^^
   |
help: the derive macros `Deserialize` and `Serialize` accept the similarly named `serde` attribute
   |
LL |     #[serde(untagged)]
   |         +

error: cannot find attribute `serde` in this scope
  --> $DIR/missing-derive-2.rs:16:7
   |
LL |     #[serde(untagged)]
   |       ^^^^^
   |
note: `serde` is imported here, but it is a crate, not an attribute
  --> $DIR/missing-derive-2.rs:5:1
   |
LL | extern crate serde;
   | ^^^^^^^^^^^^^^^^^^^
help: `serde` is an attribute that can be used by the derive macros `Serialize` and `Deserialize`, you might be missing a `derive` attribute
   |
LL + #[derive(Serialize, Deserialize)]
LL | enum B {
   |
```

Partially address rust-lang#47608. This PR doesn't find [macros that haven't yet been imported by name](rust-lang@af945cb).
Expose discriminant values in stable_mir

Resolves rust-lang/project-stable-mir#93
* Added `Discr` struct to stable mir as stable version of struct with same name
* Added `discriminant_for_variant`  method to `AdtDef` and `CoroutineDef`
…bzol

Configure bootstrap backport nominations through triagebot

Following the discussion in [#t-infra/bootstrap > ✔ Have triagebot create backport nomination threads?](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/.E2.9C.94.20Have.20triagebot.20create.20backport.20nomination.20threads.3F/with/521876500) where we noticed that bootstrap backport nominations were difficult to track, since:

- We don't really have a dedicated person / group of people checking for bootstrap backport nominations.
- We don't really have an establish way of handling bootstrap backports.

This PR configures triagebot to open backport nominations threads (indicated for bootstrap team if a given PR has the suitable team label, https://github.com/rust-lang/rust/labels/T-bootstrap) in [#t-infra/bootstrap/backports](https://rust-lang.zulipchat.com/#narrow/channel/507486-t-infra.2Fbootstrap.2Fbackports). The current configuration is such that **the whole bootstrap team will be pinged for bootstrap backport nominations**[^diverges].

### Steps

- [x] ~~Ping members who opt-in subscribe to backport channel, or ping the whole bootstrap team?~~
    - Poll: [#t-infra/bootstrap > Have triagebot create backport nomination threads? @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Have.20triagebot.20create.20backport.20nomination.20threads.3F/near/522141337)
    - Votes (as of 2025-06-10): 3 votes "no preference", 1 vote "in favor".
- [x] ~~(Best for follow-up) Maybe also document bootstrap team's backport process / decision process in Forge? It's a bit different from [compiler team's backport process](https://forge.rust-lang.org/compiler/backports.html) because we don't have weekly bootstrap triage meetings and thus don't have sync backport decisions.~~
    - Tracked as follow-up in Forge: rust-lang/rust-forge#889.

---

r? Kobzol

[^diverges]: Note that this configuration is similar to the types team backport nominations, but diverges from the compiler team.
…-suggestion, r=compiler-errors

Make E0621 missing lifetime suggestion verbose

```
error[E0621]: explicit lifetime required in the type of `x`
  --> $DIR/42701_one_named_and_one_anonymous.rs:10:9
   |
LL |         &*x
   |         ^^^ lifetime `'a` required
   |
help: add explicit lifetime `'a` to the type of `x`
   |
LL | fn foo2<'a>(a: &'a Foo, x: &'a i32) -> &'a i32 {
   |                             ++
```

Part of rust-lang#141973.
…-per-arch, r=nikic

tests: Split dont-shuffle-bswaps along opt-levels and arches

This duplicates dont-shuffle-bswaps in order to make each opt level its own test. Then -opt3.rs gets split into a revision per arch we want to test, with certain architectures gaining new target-cpu minimums.
Add supported asm types for LoongArch32

r? ```@Amanieu```
…ts, r=aDotInTheVoid

tests: Change ABIs in tests to more future-resilient ones

Eventually we're going to make these tests not work as they are currently written on HEAD, so change them now to get ahead of that.

r? aDotInTheVoid
Only run `citool` tests on the `auto` branch

Proposed here: [#t-infra > PR ci seems much to slow @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/PR.20ci.20seems.20much.20to.20slow/near/523159583). I haven't yet seen these tests failing on CI, so I think it's a good trade-off.

r? ```@marcoieni```
Implement `//@ needs-target-std` compiletest directive

Closes rust-lang#141863.
Needed to unblock rust-lang#139244 and rust-lang#141856.

### Summary

This PR implements a `//@ needs-target-std` compiletest directive that gates test execution based on whether the target supports std or not. For some cases, this should be preferred over e.g. some combination of `//@ ignore-none`, `//@ ignore-nvptx` and more[^none-limit].

### Implementation limitation

Unfortunately, since there is currently [no reliable way to determine from metadata whether a given target supports std or not](rust-lang#142296), we have to resort to a hack. Bootstrap currently determines whether or not a target supports std by a naive target tuple substring comparison: a target supports std if its target tuple does *not* contain one of `["-none", "nvptx", "switch"]` substrings. This PR simply pulls that hack out into `build_helpers` to avoid reimplementing the same hack in compiletest, and uses that logic to inform `//@ needs-target-std`.

### Auxiliary changes

This PR additionally changes a few run-make tests to use `//@ needs-target-std` over an inconsistent combination of target-based `ignore`s. This should help with rust-lang#139244.

---

r? bootstrap

[^none-limit]: Notably, `target_os = "none"` is **not** a sufficient condition for "target does not support std"
…, r=fee1-dead

Make loongarch-none target maintainers more easily pingable

In the same style as rust-lang#139028.
r? compiler
…nv-query, r=lcnr

Dont unwrap and re-wrap typing envs

Just a tiny tweak to make the query less awkward.

r? lcnr
…gjubilee

Remove unneeded `FunctionCx` from some codegen methods

No changes; just removing the `self` that wasn't needed.

r? workingjubilee
cc rust-lang#138759 (comment)
…, r=tgross35

feat: Add `bit_width` for unsigned integer types

- Accepted ACP: rust-lang/libs-team#598
- Tracking issue: rust-lang#142326

This PR adds methods to the primitive unsigned integer types that return the minimum number of bits required to represent an unsigned integer.
@rustbot rustbot added A-compiletest Area: The compiletest test runner A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-run-make Area: port run-make Makefiles to rmake.rs A-rustc-dev-guide Area: rustc-dev-guide A-rustdoc-json Area: Rustdoc JSON backend 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-libs Relevant to the library team, 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. rollup A PR which is a rollup labels Jun 11, 2025
@workingjubilee
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Jun 11, 2025

📌 Commit e250a34 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 Jun 11, 2025
@bors
Copy link
Collaborator

bors commented Jun 11, 2025

⌛ Testing commit e250a34 with merge cd7b2e0...

bors added a commit that referenced this pull request Jun 11, 2025
Rollup of 13 pull requests

Successful merges:

 - #134841 (Look at proc-macro attributes when encountering unknown attribute)
 - #141639 (Expose discriminant values in stable_mir)
 - #141967 (Configure bootstrap backport nominations through triagebot)
 - #142042 (Make E0621 missing lifetime suggestion verbose)
 - #142176 (tests: Split dont-shuffle-bswaps along opt-levels and arches)
 - #142248 (Add supported asm types for LoongArch32)
 - #142272 (tests: Change ABIs in tests to more future-resilient ones)
 - #142282 (Only run `citool` tests on the `auto` branch)
 - #142297 (Implement `//@ needs-target-std` compiletest directive)
 - #142298 (Make loongarch-none target maintainers more easily pingable)
 - #142306 (Dont unwrap and re-wrap typing envs)
 - #142324 (Remove unneeded `FunctionCx` from some codegen methods)
 - #142328 (feat: Add `bit_width` for unsigned integer types)

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

The job dist-i586-gnu-i586-i686-musl failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
---- [ui] tests/ui/macros/missing-derive-2.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/missing-derive-2/missing-derive-2.stderr`
diff of stderr:

4 LL |     #[sede(untagged)]
5    |       ^^^^
6    |
- help: the derive macros `Deserialize` and `Serialize` accept the similarly named `serde` attribute
+ help: the derive macros `Serialize` and `Deserialize` accept the similarly named `serde` attribute
8    |
---
To only update this specific test, also pass `--test-args macros/missing-derive-2.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/macros/missing-derive-2.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=i686-unknown-linux-musl" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/missing-derive-2" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/i686-unknown-linux-musl/native/rust-test-helpers" "-Clinker=/musl-i686/bin/musl-gcc" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/missing-derive-2/auxiliary"
stdout: none
--- stderr -------------------------------
error: cannot find attribute `sede` in this scope
##[error]  --> /checkout/tests/ui/macros/missing-derive-2.rs:22:7
   |
LL |     #[sede(untagged)] //~ ERROR cannot find attribute `sede`
   |       ^^^^
   |
help: the derive macros `Serialize` and `Deserialize` accept the similarly named `serde` attribute
   |
LL |     #[serde(untagged)] //~ ERROR cannot find attribute `sede`
   |         +

error: cannot find attribute `serde` in this scope
##[error]  --> /checkout/tests/ui/macros/missing-derive-2.rs:16:7
   |
LL |     #[serde(untagged)] //~ ERROR cannot find attribute `serde`
   |       ^^^^^
   |
note: `serde` is imported here, but it is a crate, not an attribute
  --> /checkout/tests/ui/macros/missing-derive-2.rs:5:1
   |
LL | extern crate serde;
   | ^^^^^^^^^^^^^^^^^^^
help: `serde` is an attribute that can be used by the derive macros `Serialize` and `Deserialize`, you might be missing a `derive` attribute
   |
LL + #[derive(Serialize, Deserialize)]
LL | enum B { //~ HELP `serde` is an attribute that can be used by the derive macros `Serialize` and `Deserialize`
   |

error: cannot find attribute `serde` in this scope
##[error]  --> /checkout/tests/ui/macros/missing-derive-2.rs:8:3
   |
LL | #[serde(untagged)] //~ ERROR cannot find attribute `serde`
   |   ^^^^^
   |
note: `serde` is imported here, but it is a crate, not an attribute
  --> /checkout/tests/ui/macros/missing-derive-2.rs:5:1
   |
LL | extern crate serde;
   | ^^^^^^^^^^^^^^^^^^^
help: `serde` is an attribute that can be used by the derive macros `Serialize` and `Deserialize`, you might be missing a `derive` attribute
   |
LL + #[derive(Serialize, Deserialize)]
LL | enum A { //~ HELP `serde` is an attribute that can be used by the derive macros `Serialize` and `Deserialize`
   |

error: aborting due to 3 previous errors
------------------------------------------


---- [ui] tests/ui/macros/missing-derive-1.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/missing-derive-1/missing-derive-1.stderr`
diff of stderr:

38 LL |     #[sede(untagged)]
39    |       ^^^^
40    |
- help: the derive macros `Deserialize` and `Serialize` accept the similarly named `serde` attribute
+ help: the derive macros `Serialize` and `Deserialize` accept the similarly named `serde` attribute
42    |
---
To only update this specific test, also pass `--test-args macros/missing-derive-1.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/macros/missing-derive-1.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=i686-unknown-linux-musl" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/missing-derive-1" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/i686-unknown-linux-musl/native/rust-test-helpers" "-Clinker=/musl-i686/bin/musl-gcc" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/missing-derive-1/auxiliary"
stdout: none
--- stderr -------------------------------
error: cannot find attribute `serde` in this scope
##[error]  --> /checkout/tests/ui/macros/missing-derive-1.rs:8:3
   |
LL | #[serde(untagged)] //~ ERROR cannot find attribute `serde`
   |   ^^^^^
   |
note: `serde` is imported here, but it is a crate, not an attribute
  --> /checkout/tests/ui/macros/missing-derive-1.rs:5:1
   |
LL | extern crate serde;
   | ^^^^^^^^^^^^^^^^^^^
help: `serde` is an attribute that can be used by the derive macros `Serialize` and `Deserialize`, you might be missing a `derive` attribute
   |
LL + #[derive(Serialize, Deserialize)]
LL | enum A { //~ HELP `serde` is an attribute that can be used by the derive macros `Serialize` and `Deserialize`
   |

error: cannot find attribute `serde` in this scope
##[error]  --> /checkout/tests/ui/macros/missing-derive-1.rs:16:7
   |
LL |     #[serde(untagged)] //~ ERROR cannot find attribute `serde`
   |       ^^^^^
   |
note: `serde` is imported here, but it is a crate, not an attribute
  --> /checkout/tests/ui/macros/missing-derive-1.rs:5:1
   |
LL | extern crate serde;
   | ^^^^^^^^^^^^^^^^^^^
help: `serde` is an attribute that can be used by the derive macros `Serialize` and `Deserialize`, you might be missing a `derive` attribute
   |
LL + #[derive(Serialize, Deserialize)]
LL | enum B { //~ HELP `serde` is an attribute that can be used by the derive macros `Serialize` and `Deserialize`
   |

error: cannot find attribute `sede` in this scope
##[error]  --> /checkout/tests/ui/macros/missing-derive-1.rs:22:7
   |
LL |     #[sede(untagged)] //~ ERROR cannot find attribute `sede`
   |       ^^^^
   |
help: the derive macros `Serialize` and `Deserialize` accept the similarly named `serde` attribute
   |
LL |     #[serde(untagged)] //~ ERROR cannot find attribute `sede`
   |         +

error: aborting due to 3 previous errors
------------------------------------------

@bors
Copy link
Collaborator

bors commented Jun 11, 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 Jun 11, 2025
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-meta Area: Issues & PRs about the rust-lang/rust repository itself A-run-make Area: port run-make Makefiles to rmake.rs A-rustc-dev-guide Area: rustc-dev-guide A-rustdoc-json Area: Rustdoc JSON backend A-testsuite Area: The testsuite used to check the correctness of rustc rollup A PR which is a rollup 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-libs Relevant to the library team, 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.