Commit graph

289092 commits

Author SHA1 Message Date
bors
dbab4e152b Auto merge of #140895 - matthiaskrgr:rollup-rfvqv4t, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #129334 (Implement (part of) ACP 429: add `DerefMut` to `Lazy[Cell/Lock]`)
 - #139562 (rustdoc: add a handle that makes sidebar resizing more obvious)
 - #140151 (remove intrinsics::drop_in_place)
 - #140660 (remove 'unordered' atomic intrinsics)
 - #140783 (Update documentation of OnceLock::get_or_init.)
 - #140789 (Update hermit-abi to 0.5.1)
 - #140879 (1.87.0 release notes: remove nonsensical `~` operator)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-05-10 17:29:42 +00:00
Matthias Krüger
3ca41e2346
Rollup merge of #140879 - pthariensflame:patch-1, r=pietroalbini
1.87.0 release notes: remove nonsensical `~` operator

There is no `~` unary prefix operator, and it definitely shouldn't be in the release notes for a feature whose introducing PR doesn't test for it (because it doesn't exist).  Also fix an unnecessary `}` on the same line.

r? ``@pietroalbini``
2025-05-10 16:26:04 +02:00
Matthias Krüger
86fb03ef1a
Rollup merge of #140789 - hermit-os:hermit-abi-0.5.1, r=Mark-Simulacrum
Update hermit-abi to 0.5.1

This updates hermit-abi to version 0.5.1, bringing the [recent `AF_*`](https://github.com/rust-lang/libc/pull/4344) changes to std.
2025-05-10 16:26:04 +02:00
Matthias Krüger
8186b71fb4
Rollup merge of #140783 - veluca93:oncelock-docs, r=jhpratt
Update documentation of OnceLock::get_or_init.

Explicitly point out that if the function panics the init function might be called multiple times.
2025-05-10 16:26:03 +02:00
Matthias Krüger
b8c55b438d
Rollup merge of #140660 - RalfJung:more-order, r=WaffleLapkin
remove 'unordered' atomic intrinsics

As their doc comment already indicates, these operations do not currently have a place in our memory model. The intrinsics were introduced to support a hack in compiler-builtins, but that hack recently got removed (see https://github.com/rust-lang/compiler-builtins/issues/788).
2025-05-10 16:26:02 +02:00
Matthias Krüger
f28428ea58
Rollup merge of #140151 - RalfJung:drop_in_place-is-not-an-intrinsic, r=Mark-Simulacrum
remove intrinsics::drop_in_place

This was only ever accidentally stable, and has been marked as deprecated since Rust 1.52, released almost 4 years ago. We've removed the old serialization `derive`s, maybe we can remove this one as well?

As suggested by ``@jhpratt,`` let's see what crater says for this one.
2025-05-10 16:26:02 +02:00
Matthias Krüger
2bce1ad86a
Rollup merge of #139562 - notriddle:notriddle/ew-resize, r=GuillaumeGomez
rustdoc: add a handle that makes sidebar resizing more obvious

This aims to make the resizable sidebars more obvious

Preview: <https://notriddle.com/rustdoc-html-demo-12/sidebar-resize-handle/std/index.html>

![image](https://github.com/user-attachments/assets/d4d70982-8045-4fed-818a-982108b0d3b3)

![image](https://github.com/user-attachments/assets/4aaa3663-19f3-4e04-89c6-53db0ddb72ed)

![image](https://github.com/user-attachments/assets/3f612c5b-6be1-4383-801a-067c87425eb9)

This change is based on some discussion on [lolbinarycat's idea], but with a more "traditional" design. Specifically, while very few systems use exactly this design, most of them use [a skeumorph](https://ux.stackexchange.com/questions/80463/what-do-the-3-close-horizontal-bars-not-hamburger-menu-represent-and-what-is-t/80591#80591) of a grip texture:

- This design is similar to the one used in the Rust Playground, and almost identical to UX StackExchange:

  <details><img src="https://github.com/user-attachments/assets/39a6bb69-4895-4fd0-87da-b87913bc7309"></details>

  <details><img src="https://github.com/user-attachments/assets/a41942e1-651b-410b-b855-2aafe8fe54f4"></details>

- In Jira, resizable sidebars have a stack of four dots, but only in one row.

  <details><img src="https://github.com/user-attachments/assets/13047998-02bf-47e6-b796-16f393f870b0"></details>

- In The GIMP, resizable sidebars have a stack of three dots.

  <details><img src="https://github.com/user-attachments/assets/138f5c21-3069-4bbe-b306-0bb9a4bf0318"></details>

- In [old Windows], "panes" are defined to have the same border style as a window, which has a raised appearance. To evoke this, the PR adds a lightweight "shadow" border, darker than the sidebar itself

  <details><img src="https://github.com/user-attachments/assets/301da4b8-6c48-4131-b741-1689af84670a"></details>

- In [NeXT], a drag point usually had an innie, whether the line in a slider or the circle in a scroller; I can also hide and show the favorites bar in Workspace by dragging on a circular "grip spot"

  <details><img src="https://github.com/user-attachments/assets/b13c2d30-a3a8-4672-90fa-58c1fdf19f42"></details>

- In [old Mac], drag handles for things usually had a "grip track" of parallel lines.

  <details><img src="https://github.com/user-attachments/assets/1fbecc67-ffbc-4ed6-a8c5-a9ff085638db"></details>

  *This design is far closer to old Mac than anything else*, though they've put it in the bottom corner instead of the middle.

- [OSX] kept that, but the "Source List" part of the Finder still had the circle grip for a time the same way Workspace did (resulting in an odd mishmash, if you compare the source list sidebar with the other grip tracks embedded in the scrollbars).

  <details><img src="https://github.com/user-attachments/assets/551b8f9d-2dd8-4291-917f-dc88741a2b97"></details>

[lolbinarycat's idea]: https://github.com/rust-lang/rust/pull/139420
[old Windows]: https://archive.org/details/windowsinterface00micr/page/n9/mode/2up
[old Mac]: https://archive.org/details/apple-hig/1996_Human_Interface_Guidelines_for_Mac_OS_8_%28WWDC_Release%29/page/16/mode/2up
[NeXT]: https://archive.org/details/apple-hig/1993%20NeXTSTEP%20User%20Interface%20Guidelines%20-%20Release%203/page/145/mode/2up
[OSX]: https://dn721903.ca.archive.org/0/items/apple-hig/MacOSX_HIG_2005_09_08.pdf#page=267
2025-05-10 16:26:01 +02:00
Matthias Krüger
c6b9253ad5
Rollup merge of #129334 - ChayimFriedman2:more-lazy-methods, r=Amanieu
Implement (part of) ACP 429: add `DerefMut` to `Lazy[Cell/Lock]`

`DerefMut` is instantly stable, as a trait impl. That means this needs an FCP.

``@rustbot`` label +needs-fcp

https://github.com/rust-lang/libs-team/issues/429
2025-05-10 16:26:01 +02:00
bors
b10555674f Auto merge of #140854 - oli-obk:merge-queries, r=nnethercote
Merge typeck loop with static/const item eval loop

r? `@ghost`

Let's try a small one first. Doing this in general has some bad cache coherence issues because the query caches are laid out in `Vec<QueryResult>` lists per query where each index refers to a `DefId` in the same order as we're iterating. Iterating two or more lists at the same time does have cache issues, so I want to poke a bit at it to see if we can't merge just a few of them at a time.
2025-05-10 14:20:43 +00:00
bors
7e432c456b Auto merge of #140880 - nnethercote:Ident-new-debug-assert, r=oli-obk
Make the assertion in `Ident::new` debug-only.

This fixes a perf regression introduced in #140252.

r? `@oli-obk`
2025-05-10 10:01:38 +00:00
bors
bfb44c8155 Auto merge of #140705 - LegNeato:backtracelock, r=Mark-Simulacrum
Update `backtrace` in Cargo.lock

Ran `cargo update -p backtrace`. This is needed to forward port the rust-gpu compiler backend.

Subsumes https://github.com/rust-lang/rust/pull/140631. Was supposed to be fixed by https://github.com/rust-lang/rust/pull/140353, but there were test failures and the backtrace update was backed out.
2025-05-10 06:13:41 +00:00
bors
c6faa1b22e Auto merge of #140876 - weihanglo:update-cargo, r=weihanglo
Update cargo

25 commits in 7918c7eb59614c39f1c4e27e99d557720976bdd7..056f5f4f3c100cb36b5e9aed2d20b9ea70aae295
2025-04-27 09:44:23 +0000 to 2025-05-09 14:54:18 +0000
- Revert "doc: Mention `XDG_DATA_HOME`" (rust-lang/cargo#15512)
- docs: update version notice for deprecation removal (rust-lang/cargo#15511)
- doc: Update instructions on using native-completions (rust-lang/cargo#15480)
- feat(network): use Retry-After header for HTTP 429 responses (rust-lang/cargo#15463)
- CI: Require schema job to pass (rust-lang/cargo#15504)
- chore(config): migrate renovate config (rust-lang/cargo#15501)
- Make cargo script ignore workspaces (rust-lang/cargo#15496)
- fix(rustc): Don't panic on unknown bins (rust-lang/cargo#15497)
- test: Remove unused nightly requirements (rust-lang/cargo#15498)
- Add support for `-Zembed-metadata` (rust-lang/cargo#15378)
- Fix tracking issue template link (rust-lang/cargo#15494)
- Refactor artifact deps in FeatureResolver::deps (rust-lang/cargo#15492)
- Improved error message for versions prefixed with `v` (rust-lang/cargo#15484)
- chore: fix some typos in comment (rust-lang/cargo#15485)
- fix: default to all targets when using `--edition` and ` --edition-idioms` in cargo fix (rust-lang/cargo#15192)
- Update fingerprint footnote (rust-lang/cargo#15478)
- feat(add): suggest similarly named features (rust-lang/cargo#15438)
- In package-workspace, keep dev-dependencies if they have a version (rust-lang/cargo#15470)
- docs: fix a typo in DependencyUI (rust-lang/cargo#15472)
- fix grammar, and remove confusing example (rust-lang/cargo#15457)
- Added tracing spans for rustc invocations (rust-lang/cargo#15464)
- Trivial tweaks to 'target_short_hash' (rust-lang/cargo#15461)
- chore(deps): update msrv (3 versions) to v1.84 (rust-lang/cargo#15456)
- feat(add/install): check if given crate argument would be valid with inserted @ symbol (rust-lang/cargo#15441)
- chang 1 tries to 1 try (rust-lang/cargo#15328)

r? ghost
2025-05-10 02:59:38 +00:00
bors
fd9fad6dbc Auto merge of #140869 - matthiaskrgr:rollup-r5k19w6, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #139863 (rustdoc: Replace unstable flag `--doctest-compilation-args` with a simpler one: `--doctest-build-arg`)
 - #140815 (also export metrics from librustdoc)
 - #140819 (Add regression test for 125877)
 - #140843 (Fix `broken-pipe-no-ice` run-make test for rpath-less builds)
 - #140848 (Improved error message for top-level or-patterns)
 - #140852 (Update the edition guide for let chains)
 - #140864 (Last minute relnotes fix)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-05-09 23:48:54 +00:00
Nicholas Nethercote
4cb9f0309d Make the assertion in Ident::new debug-only.
This fixes a perf regression introduced in #140252.
2025-05-10 09:39:04 +10:00
Laine Taffin Altman
2c5f64d55a
RELEASES.md: fix unbalanced and unneeded } 2025-05-09 16:28:26 -07:00
Laine Taffin Altman
10980be12e
RELEASES.md: fix nonsensical ~ operator
There is no `~` unary prefix operator, and it definitely shouldn't be in the release notes for a feature whose introducing PR doesn't test for it (because it doesn't exist).
2025-05-09 16:26:22 -07:00
Weihang Lo
88781bc5f6
Update cargo 2025-05-09 17:33:16 -04:00
Michael Howell
e6e52063df rustdoc: use a different style of grip track 2025-05-09 12:56:38 -07:00
Matthias Krüger
505e78a29c
Rollup merge of #140864 - pietroalbini:pa-fix-relnotes, r=BoxyUwU
Last minute relnotes fix

This PR applies most of the suggestions in https://github.com/rust-lang/rust/pull/140802#discussion_r2080675967 (except for `as_flattened_mut`, which is indeed a const stabilization this cycle), and replaces all links from nightly to stable.

r? `@BoxyUwU`
2025-05-09 21:50:09 +02:00
Matthias Krüger
ab1f382ca8
Rollup merge of #140852 - est31:edition_guide_let_chains, r=ehuss
Update the edition guide for let chains

Pull https://github.com/rust-lang/edition-guide/pull/337 into the rustc tree.
2025-05-09 21:50:09 +02:00
Matthias Krüger
967a29f4c0
Rollup merge of #140848 - kornelski:not-a-dead-end, r=compiler-errors
Improved error message for top-level or-patterns

I was confused by "top-level or-patterns are not allowed in `let` bindings" error, because it sounded like or-patterns were completely unsupported.

This error has an auto-fix suggestion that shows otherwise, but the auto-fix isn't always visible in IDEs.

I've changed the wording to be consistent with "`Fn` bounds require arguments in parentheses", and it doesn't sound like a dead-end any more.
2025-05-09 21:50:08 +02:00
Matthias Krüger
f9003b7d37
Rollup merge of #140843 - jieyouxu:broken-pipe, r=Kobzol
Fix `broken-pipe-no-ice` run-make test for rpath-less builds

The `broken-pipe-no-ice` run-make test currently fails on rpath-less builds, because host compiler runtime libs are not configured for raw std command usages.

This PR is an alternative approach to #140744. However, instead of duplicating `run_make_support::util::set_host_compiler_dylib_path` logic, we instead support "ejecting" the "configured" underlying std `Command` from `bare_rustc()` and `rustdoc()`, where host compiler runtime libs are already set.

cc `@jchecahi`
r? `@Kobzol`
2025-05-09 21:50:07 +02:00
Matthias Krüger
75fe3bf7b4
Rollup merge of #140819 - reddevilmidzy:add-test, r=petrochenkov
Add regression test for 125877

close: #125877

https://github.com/rust-lang/rust/issues/125877#issuecomment-2143704586  has been resolved https://github.com/rust-lang/rust/pull/128171
2025-05-09 21:50:07 +02:00
Matthias Krüger
9371122459
Rollup merge of #140815 - yaahc:rustdoc-metrics, r=GuillaumeGomez
also export metrics from librustdoc

Addresses the issue mentioned here: [#t-docs-rs > metrics intitiative @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/356853-t-docs-rs/topic/metrics.20intitiative/near/515714331)

The previous implementation only emitted metrics from rustc, but it turns out running `cargo doc` only calls `rustc` for dependencies, and not for the root crate being documented. We are planning to gather a sample dataset from docs.rs ci via `cargo doc` so as things stood this would not emit any metrics for any of the crates themselves that were published.

This change adds the same logic from `rustc_driver_impl` to `librustdoc` to also dump metrics at the end of its execution if they are enabled.

Note: The hash's generated by librustdoc will likely be completely different from the ones generated by rustc. This is because rustc is actually doing the various passes needed to fully calculate the stable version hash. My understanding of how rustdoc works is that the hashes generated will be working with partial information due to it only doing the work required to generate docs. The hashes will still be unique per crate and will work for the purposes of the metrics proof of concept, it would not be possible to correlate metrics generated by rustdoc with those generated by rustc for the same crate. This is fine for the purposes of the PoC but a future full implementation of metrics may want to address this issue.
2025-05-09 21:50:06 +02:00
Matthias Krüger
7a5bbe0527
Rollup merge of #139863 - fmease:simp-doctest-build-arg-passing, r=GuillaumeGomez
rustdoc: Replace unstable flag `--doctest-compilation-args` with a simpler one: `--doctest-build-arg`

Tracking issue: https://github.com/rust-lang/rust/issues/134172.
Context: https://github.com/rust-lang/rust/pull/137096#issuecomment-2776318800

Yeets the ad hoc shell-like lexer for 'nested' program arguments.
No FCP necessary since the flag is unstable.

I've chosen to replace `compilation` with `build` because it's shorter (you now need to pass it multiple times in order to pass many arguments to the doctest compiler, so it matters a bit) and since I prefer it esthetically.

**Issue**: Even though we don't process the argument passed to `--doctest-build-arg`, we end up passing it via an argument file (`rustc `@argfile`)` which delimits arguments by line break (LF or CRLF, [via](https://doc.rust-lang.org/rustc/command-line-arguments.html#path-load-command-line-flags-from-a-path)) meaning ultimately the arguments still get split which is unfortunate. Still, I think this change is an improvement over the status quo.

I'll update the tracking issue if/once this PR merges. I'll also add the (CR)LF issue to 'unresolved question'.

r? GuillaumeGomez
r? notriddle
2025-05-09 21:50:06 +02:00
Michael Howell
3c9e1f97b5 rustdoc: add tooltip to resize track 2025-05-09 12:38:00 -07:00
Michael Howell
3fa98a1507 rustdoc: add a handle that makes sidebar resizing more obvious
This change is based on some discussion on [lolbinarycat's idea],
but with a more "traditional" design. Specifically, this is the
closest thing I could find to a consensus across many systems I
looked at for inspiration:

- In Jira, resizable sidebars have a stack of four dots.
- In The GIMP, resizable sidebars have a stack of three dots.
- In [old Windows], "panes" are defined to have the same border
  style as a window, which has a raised appearance.
- In [NeXT], a drag point usually had an innie, whether the line in a
  slider or the circle in a scroller; I can also hide and show the
  favorites bar in Workspace by dragging on a circular "grip spot"
- In [old Mac], drag handles for things usually had a "grip track"
  of parallel lines.
- [OSX] kept that, but the "Source List" part of the Finder still had
  the circle grip for a time the same way Workspace did

[lolbinarycat's idea]: https://github.com/rust-lang/rust/pull/139420
[old Windows]: https://archive.org/details/windowsinterface00micr/page/n9/mode/2up
[old Mac]: https://archive.org/details/apple-hig/1996_Human_Interface_Guidelines_for_Mac_OS_8_%28WWDC_Release%29/page/16/mode/2up
[NeXT]: https://archive.org/details/apple-hig/1993%20NeXTSTEP%20User%20Interface%20Guidelines%20-%20Release%203/page/145/mode/2up
[OSX]: https://dn721903.ca.archive.org/0/items/apple-hig/MacOSX_HIG_2005_09_08.pdf#page=267
2025-05-09 12:38:00 -07:00
Pietro Albini
3c8efb57bd
update wording 2025-05-09 19:11:17 +02:00
Pietro Albini
cb253490c3
update links to point to stable 2025-05-09 18:59:54 +02:00
Pietro Albini
3caca6dc4e
fix new apis being marked as becoming const this release 2025-05-09 18:57:57 +02:00
Ralf Jung
79dfd0a472 remove 'unordered' atomic intrinsics 2025-05-09 17:39:52 +02:00
Oli Scherer
0b6e493515 Merge typeck loop with static/const item eval loop 2025-05-09 15:31:27 +00:00
est31
577e82f71b Update the edition guide for let chains 2025-05-09 17:11:29 +02:00
Kornel
fc20650c6a
Error message for top-level or-patterns suggesting a solution 2025-05-09 22:16:34 +09:00
bors
dcecb99176 Auto merge of #140839 - pietroalbini:pa-version-bump, r=pietroalbini
Bump version number to 1.89.0

Part of the release process. This PR must not be rolled up.

Closes #129461.

r? `@ghost`
2025-05-09 12:13:38 +00:00
Jieyou Xu
84ed40dc38
tests: fix broken-pipe-no-ice to use bare_rustc/rustc
Where host compiler runtime libs are properly configured, instead of raw
`RUSTC`/`RUSTDOC` commands.

Co-authored-by: Jesus Checa Hidalgo <jchecahi@redhat.com>
2025-05-09 19:54:43 +08:00
Jieyou Xu
d9f513f0da
run-make-support: support "ejecting" the underlying std command
In rare cases, the test may need access to the underlying
`std::process::Command` (e.g. for non-trivial process spawning).

Co-authored-by: Jesus Checa Hidalgo <jchecahi@redhat.com>
2025-05-09 19:54:35 +08:00
Jieyou Xu
7dae31828b
Disarm time bomb (diagnostics)
Revert "Rollup merge of #129343 - estebank:time-version, r=jieyouxu"

This reverts commit 26f75a65d7, reversing
changes made to 2572e0e8c9.

Imports are modified to fix merge conflicts and remove unused ones.
2025-05-09 12:09:15 +02:00
Pietro Albini
767d64da45
bump version number to 1.89.0 2025-05-09 11:13:08 +02:00
bors
da1e442ebd Auto merge of #140838 - Zalathar:rollup-13hybry, r=Zalathar
Rollup of 5 pull requests

Successful merges:

 - #140801 (Use span before macro expansion in lint for-loops-over-falibles)
 - #140804 (add signed ints to unn- transmutes to ensure feature parity)
 - #140812 (Fix `tests/rustdoc-json` triagebot message path)
 - #140817 (bootstrap: more consistent use of `...` when citing configuration snippets)
 - #140828 (Enable non-leaf Frame Pointers for Arm64 Windows)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-05-09 08:31:19 +00:00
Stuart Cook
d91e86e963
Rollup merge of #140828 - dpaoliello:arm64fp, r=workingjubilee
Enable non-leaf Frame Pointers for Arm64 Windows

Microsoft recommends enabling frame pointers for Arm64 Windows as it enables fast stack walking, from <https://learn.microsoft.com/en-us/cpp/build/arm64-windows-abi-conventions?view=msvc-170#integer-registers>:

> The frame pointer (x29) is required for compatibility with fast stack walking used by ETW and other services. It must point to the previous {x29, x30} pair on the stack.

I'm setting this to "non-leaf" as leaf functions shouldn't be spilling registers and so won't touch the frame pointer.
2025-05-09 16:25:06 +10:00
Stuart Cook
e3873f51a1
Rollup merge of #140817 - RalfJung:bootstrap-msg, r=jieyouxu
bootstrap: more consistent use of `...` when citing configuration snippets
2025-05-09 16:25:05 +10:00
Stuart Cook
c922eb9a9d
Rollup merge of #140812 - jieyouxu:typo-fix, r=aDotInTheVoid
Fix `tests/rustdoc-json` triagebot message path

r? ```@aDotInTheVoid```
2025-05-09 16:25:05 +10:00
Stuart Cook
16ca18d1da
Rollup merge of #140804 - bend-n:signed, r=lcnr
add signed ints to unn- transmutes to ensure feature parity

i forgot a few cases https://github.com/rust-lang/rust-clippy/pull/14703/#pullrequestreview-2824194994

adds

- char -> i32
-  i32 -> char
- float -> size ()
-  size -> float
-   i32 -> float
``@rustbot`` label L-unnecessary_transmutes
2025-05-09 16:25:04 +10:00
Stuart Cook
b165a4c280
Rollup merge of #140801 - xizheyin:issue-140747, r=SparrowLii
Use span before macro expansion in lint for-loops-over-falibles

Fixes #140747

I think there are going to be a lot of cases where macros are expanded in the compiler resulting in span offsets, and I'd like to know how that's typically handled. Does it have to be handled specially every time?
2025-05-09 16:25:03 +10:00
bors
a7b1b24587 Auto merge of #140252 - nnethercote:rm-Ident-empty, r=oli-obk
Remove `Ident::empty`

All uses have been removed. And it's nonsensical: an identifier by definition has at least one char.

r? `@oli-obk`
2025-05-09 05:16:40 +00:00
Nicholas Nethercote
0984db553d Remove Ident::empty.
All uses have been removed. And it's nonsensical: an identifier by
definition has at least one char.

The commits adds an is-non-empty assertion to `Ident::new` to enforce
this, and converts some `Ident` constructions to use `Ident::new`.
Adding the assertion requires making `Ident::new` and
`Ident::with_dummy_span` non-const, which is no great loss.

The commit amends a couple of places that do path splitting to ensure no
empty identifiers are created.
2025-05-09 13:57:49 +10:00
bors
c8b7f32434 Auto merge of #140176 - dpaoliello:arm64ecdec, r=wesleywiser
Fix linking statics on Arm64EC

Arm64EC builds recently started to fail due to the linker not finding a symbol:
```
symbols.o : error LNK2001: unresolved external symbol #_ZN3std9panicking11EMPTY_PANIC17hc8d2b903527827f1E (EC Symbol)
          C:\Code\hello-world\target\arm64ec-pc-windows-msvc\debug\deps\hello_world.exe : fatal error LNK1120: 1 unresolved externals
```

It turns out that `EMPTY_PANIC` is a new static variable that was being exported then imported from the standard library, but when exporting LLVM didn't prepend the name with `#` (as only functions are prefixed with this character), whereas Rust was prefixing with `#` when attempting to import it.

The fix is to have Rust not prefix statics with `#` when importing.

Adding tests discovered another issue: we need to correctly mark static exported from dylibs with `DATA`, otherwise MSVC's linker assumes they are functions and complains that there is no exit thunk for them.

CI found another bug: we only apply `DllImport` to non-local statics that aren't foreign items (i.e., in an `extern` block), that is we want to use `DllImport` for statics coming from other Rust crates. However, `__rust_no_alloc_shim_is_unstable` is a static generated by the Rust compiler if required, but downstream crates consider it a foreign item since it is declared in an `extern "Rust"` block, thus they do not apply `DllImport` to it and so fails to link if it is exported by the previous crate as `DATA`. The fix is to apply `DllImport` to foreign items that are marked with the `rustc_std_internal_symbol` attribute (i.e., we assume they aren't actually foreign and will be in some Rust crate).

Fixes #138541

---
try-job: dist-aarch64-msvc
try-job: dist-x86_64-msvc
try-job: x86_64-msvc-1
try-job: x86_64-msvc-2
2025-05-09 00:43:28 +00:00
bors
667247db71 Auto merge of #140818 - matthiaskrgr:rollup-5eaotr2, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #140095 (Eliminate `word_and_empty` methods.)
 - #140341 (Clarify black_box warning a bit)
 - #140684 (Only include `dyn Trait<Assoc = ...>` associated type bounds for `Self: Sized` associated types if they are provided)
 - #140707 (Structurally normalize in range pattern checking in HIR typeck)
 - #140716 (Improve `-Zremap-path-scope` tests with dependency)
 - #140800 (Make `rustdoc-tempdir-removal` run-make tests work on other platforms than linux)
 - #140802 (Add release notes for 1.87.0)
 - #140811 (Enable triagebot note functionality for rust-lang/rust)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-05-08 21:32:19 +00:00
Christian Legnitto
d4862eb690 Update backtrace in Cargo.lock
Ran `cargo update -p backtrace`. This is needed to forward port the rust-gpu compiler backend.

Subsumes https://github.com/rust-lang/rust/pull/140631. Was supposed
to be fixed by https://github.com/rust-lang/rust/pull/140353, but there
were test failures and the fix was backed out.
2025-05-08 16:20:00 -04:00