Skip to content

Rollup of 8 pull requests - #159985

Closed
JonathanBrouwer wants to merge 25 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-UUq9YVZ
Closed

Rollup of 8 pull requests#159985
JonathanBrouwer wants to merge 25 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-UUq9YVZ

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Contributor

Successful merges:

r? @ghost

Create a similar rollup

ajtribick and others added 25 commits July 19, 2026 11:20
Use the one that's passed in.
- By improving various comments.
- By renaming some fields. This gives a clear split between
  `move_outs`/`move_out_loc_map`/`move_out_path_map` and
  `inits`/`init_loc_map`/`init_path_map`.
By using an iterator instead of a manual loop.
It always has the same value as `mark_inactive_variants_as_uninit`, and
it's only read if `mark_inactive_variants_as_uninit` is true.
Co-authored-by: Dominik Schwaiger <mail@dominik-schwaiger.ch>
The MIPS n64 ABI returns structs that meet the following requirements:

- Up to 128 bits large
- Only one or two fields, all of which are floating point
- Offset of the first field is zero

in floating point registers. This was already accounted for, but the
edge case of a struct with a single f128 field was not handled correctly
and would always be returned in integer registers.

If we tell the backend to use a f128 register here, LLVM will return the
value in two of the 64-bit FPRs, $f0 and $f2. That is equivalent to
how Clang, GCC and also Rustc today would return a long double / f128.

However, both Clang and GCC return a struct with a single long double
field in $f0 and $f1. In order to achieve the same result in Rustc, we
need to set the InReg attribute on the return value.

With this, we now match Clang and GCC.

Clang: https://godbolt.org/z/za8qv9P4n
GCC: https://godbolt.org/z/9qcdGsce6
Rustc currently: https://godbolt.org/z/8sP5G4ash
LLVM IR comparisons: https://godbolt.org/z/ojaTTY9hW
…, r=folkertdev

Fix decoding attributes of `SyntheticCoroutineBody`

Fixes rust-lang#156905 by returning an empty list of attributes for `SyntheticCoroutineBody` when its attributes are decoded
…Mark-Simulacrum

feat: Update method signature of int_from_ascii

* Tracking issue: rust-lang#134821

Following [discussion on Zulip](https://rust-lang.zulipchat.com/#narrow/channel/327149-t-libs-api.2Fapi-changes/topic/How.20to.20proceed.20with.20int_from_ascii/with/611508226) it appears the preference is to change the API for this feature as follows:

```rust
// core::num

impl X {
    pub const fn from_ascii_bytes<T>(src: T) -> Result<X, ParseIntError>
    where
        T: [const] AsRef<[u8]> + [const] core::marker::Destruct;

    pub const fn from_ascii_bytes_radix<T>(src: T, radix: u32) -> Result<X, ParseIntError>
    where
        T: [const] AsRef<[u8]> + [const] core::marker::Destruct;
}
```

and similarly for `NonZero<X>`.

Reasons behind the change:

* Future-proof the naming convention for future string-like types
* Support the upcoming `ByteStr`/`ByteString` types: rust-lang#134915

This pull request applies this change. The const-ness of these functions is now feature gated behind rust-lang#143773
… r=cjgillot

Some place analysis tweaks

Details in individual commits.

r? @cjgillot
…s, r=clarfonthey

sanitize_standard_fds: Miri supports poll now

However, so far it doesn't support it on the standard FDs (0..=2). So let's support those in poll and then remove a Miri special case in std.
…gle-f128, r=folkertdev

rustc_target: callconv: mips64: Return structs with single f128 in FPRs

The MIPS n64 ABI returns structs that meet the following requirements:

- Up to 128 bits large
- Only one or two fields, all of which are floating point
- Offset of the first field is zero

in floating point registers. This was already accounted for, but the edge case of a struct with a single `f128` field was not handled correctly and would always be returned in integer registers.

If we tell the backend to use a `f128` register here, LLVM will return the value in two of the 64-bit FPRs, `$f0` and `$f2`. That is equivalent to how Clang, GCC and also Rustc today would return a `long double` / `f128`.

However, both Clang and GCC return a struct with a single long double field in `$f0` and `$f1`. In order to achieve the same result in Rustc, we need to set the `InReg` attribute on the return value.

With this, we now match Clang and GCC.

Clang: https://godbolt.org/z/za8qv9P4n
GCC: https://godbolt.org/z/9qcdGsce6
Rustc currently: https://godbolt.org/z/8sP5G4ash
LLVM IR comparisons: https://godbolt.org/z/ojaTTY9hW

---

I'm not sure if it is acceptable to use `Reg::f128` since MIPS has no 128-bit floating point registers unless MSA is present. LLVM lowers it correctly to use two FPRs, not sure if this would cause issues with GCC.

`f16` probably also needs some changes here, but I'll do that as a follow-up.

---

r? @folkertdev

and Folkert also told me to cc @tgross35 :)
…athanBrouwer

Add suggestions for using `#[export_name]` instead of `#[link_name]` on static

Fixes rust-lang#159247.

This adds a suggestion for using `#[unsafe(export_name = "...")]` when `#[link_name = "..."]` is applied to a static.

It also handles the existing `#[unsafe(link_name = "...")]` form by replacing only the attribute name.

Tested with:

- `./x test tests/ui/attributes/link-name-on-static.rs`
- `./x test tests/ui/attributes/unsafe-link-name-on-static.rs`
…-mode, r=adwinwhite

Fix opaque type ICE in late lints under the next-generation trait solver

fixes rust-lang/rust-clippy#17411

Under the next trait solver, late lints trigger an ICE due to having non-empty opaque storage when dropping `InferCtxt`.

Rather than forcing all current and future late lints to manually use `ignoring_regions`, use `PostBorrowck` in `LateContext`.

cc @adwinwhite
…23, r=Mark-Simulacrum

Fix observable intermediate state in `thread::add_spawn_hook`

Fixes rust-lang#159923.

Ensures the intermediate state of there being no hooks in `add_spawn_hooks` is not observable by allocating the new head node before taking the current hook list.

Also added a note to the docs of `add_spawn_hook` that hooks are not guaranteed to run and cannot be relied upon for soundness, as there are multiple ways to prevent all/some hooks from running.
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Jul 27, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) O-apple Operating system: Apple / Darwin (macOS, iOS, tvOS, visionOS, watchOS) O-unix Operating system: Unix-like S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 27, 2026
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

A job failed! Check out the build log: (web) (plain enhanced) (plain)

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

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jul 27, 2026
…uwer

Rollup of 8 pull requests

Successful merges:

 - #159085 (Fix decoding attributes of `SyntheticCoroutineBody`)
 - #159554 (feat: Update method signature of int_from_ascii)
 - #159637 (Some place analysis tweaks)
 - #159961 (sanitize_standard_fds: Miri supports poll now)
 - #159967 (rustc_target: callconv: mips64: Return structs with single f128 in FPRs)
 - #159253 (Add suggestions for using `#[export_name]` instead of `#[link_name]` on static)
 - #159840 (Fix opaque type ICE in late lints under the next-generation trait solver)
 - #159956 (Fix observable intermediate state in `thread::add_spawn_hook`)
@rust-bors rust-bors Bot 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 Jul 27, 2026
@rust-bors

rust-bors Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 38d588b failed: CI. Failed jobs:

@jhpratt

jhpratt commented Jul 27, 2026

Copy link
Copy Markdown
Member

@bors retry

@rust-bors rust-bors Bot 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 Jul 27, 2026
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

A job failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
   5 | >>> FROM centos:7
   6 |     
   7 |     WORKDIR /build
--------------------
ERROR: failed to build: failed to solve: DeadlineExceeded: centos:7: failed to resolve source metadata for docker.io/library/centos:7: failed to do request: Head "https://registry-1.docker.io/v2/library/centos/manifests/7": dial tcp 34.236.73.184:443: i/o timeout (did you mean centos?)
Command failed. Attempt 2/5:
#0 building with "awesome_knuth" instance using docker-container driver

#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 3.42kB done
---
   5 | >>> FROM centos:7
   6 |     
   7 |     WORKDIR /build
--------------------
ERROR: failed to build: failed to solve: centos:7: failed to resolve source metadata for docker.io/library/centos:7: failed to do request: Head "https://registry-1.docker.io/v2/library/centos/manifests/7": dial tcp 44.207.198.110:443: i/o timeout (did you mean centos?)
Command failed. Attempt 3/5:
#0 building with "awesome_knuth" instance using docker-container driver

#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 3.42kB done
---
   5 | >>> FROM centos:7
   6 |     
   7 |     WORKDIR /build
--------------------
ERROR: failed to build: failed to solve: DeadlineExceeded: centos:7: failed to resolve source metadata for docker.io/library/centos:7: failed to do request: Head "https://registry-1.docker.io/v2/library/centos/manifests/7": dial tcp 44.205.146.148:443: i/o timeout (did you mean centos?)
Command failed. Attempt 4/5:
#0 building with "awesome_knuth" instance using docker-container driver

#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 3.42kB done
---
   5 | >>> FROM centos:7
   6 |     
   7 |     WORKDIR /build
--------------------
ERROR: failed to build: failed to solve: DeadlineExceeded: centos:7: failed to resolve source metadata for docker.io/library/centos:7: failed to do request: Head "https://registry-1.docker.io/v2/library/centos/manifests/7": dial tcp 54.83.55.124:443: i/o timeout (did you mean centos?)
Command failed. Attempt 5/5:
#0 building with "awesome_knuth" instance using docker-container driver

#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 3.42kB done
---
   5 | >>> FROM centos:7
   6 |     
   7 |     WORKDIR /build
--------------------
ERROR: failed to build: failed to solve: DeadlineExceeded: centos:7: failed to resolve source metadata for docker.io/library/centos:7: failed to do request: Head "https://registry-1.docker.io/v2/library/centos/manifests/7": dial tcp 44.205.146.148:443: i/o timeout (did you mean centos?)
The command has failed after 5 attempts.
##[error]Process completed with exit code 1.
##[group]Run echo "disk usage:"
echo "disk usage:"
df -h

@rust-bors rust-bors Bot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jul 27, 2026
@rust-bors

rust-bors Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 622cb2d failed: CI. Failed job:

@JonathanBrouwer

Copy link
Copy Markdown
Contributor Author

@bors retry

@rust-bors

rust-bors Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

❗ You can only retry pull requests that are approved and have a previously failed auto build.

@JonathanBrouwer

Copy link
Copy Markdown
Contributor Author

@bors p=101

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jul 27, 2026
…uwer

Rollup of 8 pull requests

Successful merges:

 - #159085 (Fix decoding attributes of `SyntheticCoroutineBody`)
 - #159554 (feat: Update method signature of int_from_ascii)
 - #159637 (Some place analysis tweaks)
 - #159961 (sanitize_standard_fds: Miri supports poll now)
 - #159967 (rustc_target: callconv: mips64: Return structs with single f128 in FPRs)
 - #159253 (Add suggestions for using `#[export_name]` instead of `#[link_name]` on static)
 - #159840 (Fix opaque type ICE in late lints under the next-generation trait solver)
 - #159956 (Fix observable intermediate state in `thread::add_spawn_hook`)
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job optional-x86_64-gnu-parallel-frontend failed! Check out the build log: (web) (plain enhanced) (plain)

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

20 LL | |     Self::Item: Baz,
21    | |____________________^
22    = note: ...which again requires coherence checking all impls of trait `Foo`, completing the cycle
- note: cycle used when checking that `<impl at $DIR/next-solver-region-resolution.rs:12:1: 14:20>` is well-formed
-   --> $DIR/next-solver-region-resolution.rs:12:1
+ note: cycle used when checking that `<impl at $DIR/next-solver-region-resolution.rs:18:1: 20:21>` is well-formed
+   --> $DIR/next-solver-region-resolution.rs:18:1
25    |
- LL | / impl<'a, T> Foo for &'a T
+ LL | / impl<'a, T> Foo for &T
27 LL | | where
- LL | |     Self::Item: 'a,
-    | |___________________^
+ LL | |     Self::Item: Baz,
+    | |____________________^
30    = note: for more information, see <https://rustc-dev-guide.rust-lang.org/overview.html#queries> and <https://rustc-dev-guide.rust-lang.org/query.html>
31 
32 error: aborting due to 1 previous error

Note: some mismatched output was normalized before being compared
- note: cycle used when checking that `<impl at /checkout/tests/ui/specialization/min_specialization/next-solver-region-resolution.rs:18:1: 20:21>` is well-formed
-   --> /checkout/tests/ui/specialization/min_specialization/next-solver-region-resolution.rs:18:1
+ note: cycle used when checking that `<impl at $DIR/next-solver-region-resolution.rs:18:1: 20:21>` is well-formed
+   --> $DIR/next-solver-region-resolution.rs:18:1
+ LL | / impl<'a, T> Foo for &T
+ LL | |     Self::Item: Baz,
+    | |____________________^

Compare output by lines enabled, diff by lines:
Expected contains these lines that are not in actual:
   | |___________________^
  --> $DIR/next-solver-region-resolution.rs:12:1
LL | / impl<'a, T> Foo for &'a T
LL | |     Self::Item: 'a,
note: cycle used when checking that `<impl at $DIR/next-solver-region-resolution.rs:12:1: 14:20>` is well-formed
Actual contains these lines that are not in expected:
   | |____________________^
  --> $DIR/next-solver-region-resolution.rs:18:1
LL | / impl<'a, T> Foo for &T
LL | |     Self::Item: Baz,
note: cycle used when checking that `<impl at $DIR/next-solver-region-resolution.rs:18:1: 20:21>` is well-formed

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 specialization/min_specialization/next-solver-region-resolution.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/specialization/min_specialization/next-solver-region-resolution.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=x86_64-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" "-Zthreads=4" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/specialization/min_specialization/next-solver-region-resolution" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Znext-solver=globally"
stdout: none
--- stderr -------------------------------
error[E0391]: cycle detected when coherence checking all impls of trait `Foo`
##[error]  --> /checkout/tests/ui/specialization/min_specialization/next-solver-region-resolution.rs:6:1
   |
LL | trait Foo { //~ ERROR cycle detected when coherence checking all impls of trait `Foo`
   | ^^^^^^^^^
   |
   = note: ...which requires building specialization graph of trait `Foo`...
note: ...which requires computing whether impls specialize one another...
  --> /checkout/tests/ui/specialization/min_specialization/next-solver-region-resolution.rs:12:1
   |
LL | / impl<'a, T> Foo for &'a T
LL | | where
LL | |     Self::Item: 'a,
   | |___________________^
note: ...which requires computing normalized predicates of `<impl at /checkout/tests/ui/specialization/min_specialization/next-solver-region-resolution.rs:18:1: 20:21>`...
  --> /checkout/tests/ui/specialization/min_specialization/next-solver-region-resolution.rs:18:1
   |
LL | / impl<'a, T> Foo for &T
LL | | where
LL | |     Self::Item: Baz,
   | |____________________^
   = note: ...which again requires coherence checking all impls of trait `Foo`, completing the cycle
note: cycle used when checking that `<impl at /checkout/tests/ui/specialization/min_specialization/next-solver-region-resolution.rs:18:1: 20:21>` is well-formed
  --> /checkout/tests/ui/specialization/min_specialization/next-solver-region-resolution.rs:18:1
   |
LL | / impl<'a, T> Foo for &T
LL | | where
LL | |     Self::Item: Baz,
   | |____________________^
   = note: for more information, see <https://rustc-dev-guide.rust-lang.org/overview.html#queries> and <https://rustc-dev-guide.rust-lang.org/query.html>

error: aborting due to 1 previous error

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

@rust-bors rust-bors Bot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 27, 2026
@rust-bors

rust-bors Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

💔 Test for f4ab9de failed: CI. Failed jobs:

@JonathanBrouwer

Copy link
Copy Markdown
Contributor Author

@bors try jobs=x86_64-mingw-1

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jul 27, 2026
Rollup of 8 pull requests


try-job: x86_64-mingw-1
@rust-bors rust-bors Bot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jul 27, 2026
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 27, 2026
@rust-bors

rust-bors Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved due to being closed.

@rust-bors

rust-bors Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: aac2d5e (aac2d5e99dfd989ba388ed8c3eae7b53cf66d729)
Base parent: dfbea5b (dfbea5bc945a9d7ff017d3d4bfbd1af9295fe5b8)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) O-apple Operating system: Apple / Darwin (macOS, iOS, tvOS, visionOS, watchOS) O-unix Operating system: Unix-like 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-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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.