Skip to content

Rollup of 15 pull requests #142995

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

Conversation

workingjubilee
Copy link
Member

@workingjubilee workingjubilee commented Jun 25, 2025

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

estebank and others added 30 commits June 9, 2025 17:45
If we ever start testing every edition, using a new keyword unnecessarily will cause divergent output, so pre-emptively change `gen` into `generator`.
In order to expose edition dependent divergences in some tests in the test suite, add explicit `edition` annotations. Some of these tests might require additional work to *avoid* the divergences, as they might have been unintentional. These are not exhaustive changes, purely opportunistic while looking at something else.
For things that only change the valid ranges, we can just skip the `LLVMBuildBitCast` call.

I tried to tweak this a bit more and broke stuff, so I also added some extra tests for that as we apparently didn't have coverage.
Co-authored-by: Folkert de Vries <folkert@folkertdev.nl>
It currently reports net size, i.e. size(output) - size(input). After
some use I think this is sub-optimal, and it's better to just report
size(output). Because for derive macros the input size is always 1, and
for attribute macros it's almost always 1.
Ensure rustc_codegen_cranelift doesn't get normalized to rustc. And
handle -Cpanic=abort.
While cg_llvm is very lax about mismatched function signatures, cg_clif
will crash when there is any mismatch. It could be turned into an error,
but without Cranelift changes can't just be ignored.
cg_llvm likely just optimizes out their references for these tests, but
cg_clif doesn't and would thus give a linker error.
Changed "you're" to "your" on line 470.
This brings in a few updates to the bundled `wasm-component-ld`
dependency used by the `wasm32-wasip2` target. This primarily includes
support for upcoming component model async/WASIp3 support which will be
convenient to have native support for a few months from now.
…holk,traviscross

Implement parsing of pinned borrows

This PR implements part of rust-lang#130494.

EDIT: It introduces `&pin mut $place` and `&pin const $place` as sugars for `std::pin::pin!($place)` and its shared reference equivalent, except that `$place` will not be moved when borrowing. The borrow check will be in charge of enforcing places cannot be moved or mutably borrowed since being pinned till dropped.

### Implementation steps:
- [x] parse the `&pin mut $place` and `&pin const $place` syntaxes
- [ ] borrowck of `&pin mut|const`
- [ ] support autoref of `&pin mut|const` when needed
…attr, r=oli-obk,traviscross

Add `#[loop_match]` for improved DFA codegen

tracking issue: rust-lang#132306
project goal: rust-lang/rust-project-goals#258

This PR adds the `#[loop_match]` attribute, which aims to improve code generation for state machines. For some (very exciting) benchmarks, see rust-lang/rust-project-goals#258 (comment)

Currently, a very restricted syntax pattern is accepted. We'd like to get feedback and merge this now before we go too far in a direction that others have concerns with.

## current state

We accept code that looks like this

```rust
#[loop_match]
loop {
    state = 'blk: {
        match state {
            State::A => {
                #[const_continue]
                break 'blk State::B
            }
            State::B => { /* ... */ }
            /* ... */
        }
    }
}
```

- a loop should have the same semantics with and without `#[loop_match]`: normal `continue` and `break` continue to work
- `#[const_continue]` is only allowed in loops annotated with `#[loop_match]`
- the loop body needs to have this particular shape (a single assignment to the match scrutinee, with the body a labelled block containing just a match)

## future work

- perform const evaluation on the `break` value
- support more state/scrutinee types

## maybe future work

- allow `continue 'label value` syntax, which `#[const_continue]` could then use.
- allow the match to be on an arbitrary expression (e.g. `State::Initial`)
- attempt to also optimize `break`/`continue` expressions that are not marked with `#[const_continue]`

r? `@traviscross`
…signature, r=workingjubilee

Error on invalid signatures for interrupt ABIs

We recently added `extern "custom"`, which must have type `fn()`. The various `extern "interrupt"` ABIs impose similar constraints on the signature of functions with that ABI: `x86-interrupt` should not have a return type (linting on the exact argument types is left as future work), and the other interrupt ABIs cannot have any parameters or a return type.

r? `@workingjubilee`
…=WaffleLapkin

Avoid a bitcast FFI call in transmuting

For things that only change the valid ranges, we can just return the input, rather than making the `LLVMBuildBitCast` call and having *it* then do nothing.

I tried to tweak this a bit more and broke stuff, so I also added some extra tests for that as we apparently didn't have coverage.
Port `#[track_caller]` to the new attribute system

r? `@oli-obk`

depends on rust-lang#142493

Closes rust-lang#142783

(didn't add a test for this, this situation should simply never come up again, the code was simply wrong. lmk if I should add it, but it won't test something very useful)
Enable short-ice for Windows

Works fine for x64 without modifications.

x86 MSVC is still failing.

Addresses item in rust-lang#128602

---

try-job: x86_64-mingw-*
try-job: x86_64-msvc-*
try-job: i686-msvc-*
…etrochenkov

Tweak `-Zmacro-stats` measurement.

It currently reports net size, i.e. size(output) - size(input). After some use I think this is sub-optimal, and it's better to just report size(output). Because for derive macros the input size is always 1, and for attribute macros it's almost always 1.

r? ``@petrochenkov``
Couple of test suite fixes for cg_clif

Most of these are required for getting the test suite running with panic=unwind for cg_clif.
…ature, r=GuillaumeGomez

rustdoc: Don't mark `#[target_feature]` functions as ⚠

Closes rust-lang#142952
Corrected spelling mistake in c_str.rs

Changed "you're" to "your" on line 470.
…-ld, r=Mark-Simulacrum

Update wasm-component-ld to 0.5.14

This brings in a few updates to the bundled `wasm-component-ld` dependency used by the `wasm32-wasip2` target. This primarily includes support for upcoming component model async/WASIp3 support which will be convenient to have native support for a few months from now.
Update cargo

2 commits in 84709f085062cbf3c51fa507527c1b2334015178..409fed7dc1553d49cb9a8c0637d12d65571346ce
2025-06-22 23:58:39 +0000 to 2025-06-23 15:55:04 +0000
- Fix potential deadlock in `CacheState::lock` (rust-lang/cargo#15698)
- feat(toml): Parse support for multiple build scripts (rust-lang/cargo#15630)
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-run-make Area: port run-make Makefiles to rmake.rs A-tidy Area: The tidy tool 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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Jun 25, 2025
@workingjubilee
Copy link
Member Author

@bors r+ rollup=never p=5

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

bors commented Jun 25, 2025

📌 Commit d6c0d37 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 25, 2025
@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu-llvm-19-1 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

1 error[E0626]: borrow may still be in use when coroutine yields
2   --> $DIR/auto-trait-regions.rs:45:19
3    |
- LL |     let gen = #[coroutine] move || {
-    |                            ------- within this coroutine
+ LL |     let generator = #[coroutine] move || {
+    |                                  ------- within this coroutine
6 LL |         let a = A(&mut true, &mut true, No);
7    |                   ^^^^^^^^^
8 ...

11    |
12 help: add `static` to mark this coroutine as unmovable
13    |
- LL |     let gen = #[coroutine] static move || {
-    |                            ++++++
+ LL |     let generator = #[coroutine] static move || {
+    |                                  ++++++
16 
17 error[E0626]: borrow may still be in use when coroutine yields
18   --> $DIR/auto-trait-regions.rs:45:30

19    |
- LL |     let gen = #[coroutine] move || {
-    |                            ------- within this coroutine
+ LL |     let generator = #[coroutine] move || {
+    |                                  ------- within this coroutine
22 LL |         let a = A(&mut true, &mut true, No);
23    |                              ^^^^^^^^^
24 ...

27    |
28 help: add `static` to mark this coroutine as unmovable
29    |
- LL |     let gen = #[coroutine] static move || {
-    |                            ++++++
+ LL |     let generator = #[coroutine] static move || {
+    |                                  ++++++
32 
33 error: implementation of `Foo` is not general enough
34   --> $DIR/auto-trait-regions.rs:31:5


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args coroutine/auto-trait-regions.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/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/coroutine/auto-trait-regions.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/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--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/aarch64-unknown-linux-gnu/test/ui/coroutine/auto-trait-regions" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0626]: borrow may still be in use when coroutine yields
##[error]  --> /checkout/tests/ui/coroutine/auto-trait-regions.rs:45:19
   |
LL |     let generator = #[coroutine] move || {
   |                                  ------- within this coroutine
LL |         let a = A(&mut true, &mut true, No);
   |                   ^^^^^^^^^
...
LL |         yield;
   |         ----- possible yield occurs here
   |
help: add `static` to mark this coroutine as unmovable
   |
LL |     let generator = #[coroutine] static move || {
   |                                  ++++++

error[E0626]: borrow may still be in use when coroutine yields
##[error]  --> /checkout/tests/ui/coroutine/auto-trait-regions.rs:45:30
   |
LL |     let generator = #[coroutine] move || {
   |                                  ------- within this coroutine
LL |         let a = A(&mut true, &mut true, No);
   |                              ^^^^^^^^^
...
LL |         yield;
   |         ----- possible yield occurs here
   |
help: add `static` to mark this coroutine as unmovable
   |
LL |     let generator = #[coroutine] static move || {
   |                                  ++++++

error: implementation of `Foo` is not general enough
##[error]  --> /checkout/tests/ui/coroutine/auto-trait-regions.rs:31:5
   |
LL |     assert_foo(generator);
   |     ^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
   |
   = note: `&'0 OnlyFooIfStaticRef` must implement `Foo`, for any lifetime `'0`...
   = note: ...but `Foo` is actually implemented for the type `&'static OnlyFooIfStaticRef`

error: implementation of `Foo` is not general enough
##[error]  --> /checkout/tests/ui/coroutine/auto-trait-regions.rs:51:5
   |
LL |     assert_foo(generator);
   |     ^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
   |
   = note: `Foo` would have to be implemented for the type `A<'0, '1>`, for any two lifetimes `'0` and `'1`...
   = note: ...but `Foo` is actually implemented for the type `A<'_, '2>`, for some specific lifetime `'2`

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0626`.
------------------------------------------

@workingjubilee
Copy link
Member Author

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 25, 2025
@workingjubilee workingjubilee deleted the rollup-mdcmf64 branch June 25, 2025 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-run-make Area: port run-make Makefiles to rmake.rs A-tidy Area: The tidy tool rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.
Projects
None yet
Development

Successfully merging this pull request may close these issues.