Commit graph

289069 commits

Author SHA1 Message Date
王宇逸
5fc88de1e2 Update deps of bootstrap for Cygwin 2025-05-10 16:15:44 +08: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
Weihang Lo
88781bc5f6
Update cargo 2025-05-09 17:33:16 -04: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
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
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
Daniel Paoliello
d951c41a68 Enable non-leaf Frame Pointers for Arm64 Windows 2025-05-08 13:18:18 -07:00
Matthias Krüger
4e4d6ad43c
Rollup merge of #140811 - jieyouxu:notes, r=Urgau
Enable triagebot note functionality for rust-lang/rust

Docs: <https://forge.rust-lang.org/triagebot/note.html>.

r? `@Urgau`
2025-05-08 20:22:25 +02:00
Matthias Krüger
196b5cbb9b
Rollup merge of #140802 - BoxyUwU:relnotes_1_87_0, r=pietroalbini
Add release notes for 1.87.0

Originally drafted in #140133

cc `@rust-lang/release`

r? `@pietroalbani` as you're running the release
2025-05-08 20:22:23 +02:00
Matthias Krüger
8d7a4c286b
Rollup merge of #140800 - GuillaumeGomez:rustdoc-tempdir-removal, r=jieyouxu
Make `rustdoc-tempdir-removal` run-make tests work on other platforms than linux

Follow-up of #140706.

r? `@jieyouxu`
2025-05-08 20:22:21 +02:00
Matthias Krüger
1aa0dd2dc8
Rollup merge of #140716 - Urgau:improve-remap_scope-tests, r=jieyouxu
Improve `-Zremap-path-scope` tests with dependency

This PR greatly improves our coverage of `-Zremap-path-scope` for diagnostic paths and macros with dependencies.

r? `@jieyouxu` (since we talked about it)

try-job: x86_64-msvc-1
2025-05-08 20:22:20 +02:00
Matthias Krüger
f7168af76f
Rollup merge of #140707 - compiler-errors:range-pat-struct-norm, r=lcnr
Structurally normalize in range pattern checking in HIR typeck

Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/200

r? lcnr
2025-05-08 20:22:18 +02:00
Matthias Krüger
a054be7434
Rollup merge of #140684 - compiler-errors:unnecessary-assoc, r=lcnr
Only include `dyn Trait<Assoc = ...>` associated type bounds for `Self: Sized` associated types if they are provided

Since #136458, we began filtering out associated types with `Self: Sized` bounds when constructing the list of associated type bounds to put into our `dyn Trait` types. For example, given:

```rust
trait Trait {
    type Assoc where Self: Sized;
}
```

After #136458, even if a user writes `dyn Trait<Assoc = ()>`, the lowered ty would have an empty projection list, and thus be equivalent to `dyn Trait`. However, this has the side effect of no longer constraining any types in the RHS of `Assoc = ...`, not implying any WF implied bounds, and not requiring that they hold when unsizing.

After this PR, we include these bounds, but (still) do not require that they are provided. If the are not provided, they are skipped from the projections list.

This results in `dyn Trait` types that have differing numbers of projection bounds. This will lead to re-introducing type mismatches e.g. between `dyn Trait` and `dyn Trait<Assoc = ()>`. However, this is expected and doesn't suffer from any of the deduplication unsoundness from before #136458.

We may want to begin to ignore thse bounds in the future by bumping `unused_associated_type_bounds` to an FCW. I don't want to tangle that up into the fix that was originally intended in #136458, so I'm doing a "fix-forward" in this PR and deferring thinking about this for the future.

Fixes #140645

r? lcnr
2025-05-08 20:22:16 +02:00
Matthias Krüger
32e3207969
Rollup merge of #140341 - saethlin:black-box-qoi, r=Mark-Simulacrum
Clarify black_box warning a bit

Trying to bring the docs on black_box more in line with the advice that we have discussed in Zulip.

https://github.com/rust-lang/rust/pull/140341#issuecomment-2832592382
2025-05-08 20:22:13 +02:00
Matthias Krüger
6914d83de9
Rollup merge of #140095 - nnethercote:rm-word_or_empty, r=jdonszelmann
Eliminate `word_and_empty` methods.

To remove the last remaining `Ident::empty` uses.

r? `@jdonszelmann`
2025-05-08 20:22:09 +02:00
bors
50aa041807 Auto merge of #140786 - Kobzol:try-builds-no-deny-warnings, r=jieyouxu
Do not deny warnings in "fast" try builds

When we do the classic ``@bors` try` build without specifying `try-job` in the PR description, we want to get a compiler toolchain for perf./crater/local experimentation as fast as possible. We don't run any tests in that case, so it seems reasonable to also ignore warnings.

Fixes: https://github.com/rust-lang/rust/issues/140753

r? `@jieyouxu`

try-job: dist-x86_64-linux
2025-05-08 18:21:54 +00:00
Ralf Jung
0326a2c315 bootstrap: more consistent use of ... when citing configuration snippets 2025-05-08 20:14:10 +02:00
reddevilmidzy
b67549edd3 Add regression test for 125877 2025-05-09 03:08:40 +09:00
Jane Losare-Lusby
71e767f340 also export metrics from librustdoc 2025-05-08 10:58:13 -07:00
bendn
3b4c4938c5
add signed integers to unnecessary_lints to ensure feature parity with clippy 2025-05-08 23:16:49 +07:00
Jieyou Xu
eff20bfd29
Fix tests/rustdoc-json path 2025-05-09 00:08:40 +08:00
Jieyou Xu
c9a96eb379
Enable triagebot note functionality for rust-lang/rust
See <https://forge.rust-lang.org/triagebot/note.html>.
2025-05-09 00:00:52 +08:00
bors
fe348cd1a8 Auto merge of #140797 - matthiaskrgr:rollup-3km95qh, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #140736 (trait selection: check `&` before suggest remove deref)
 - #140755 ([win][arm64] Disable various DebugInfo tests that don't work on Arm64 Windows)
 - #140756 ([arm64] Pointer auth test should link with C static library statically)
 - #140758 ([win][arm64] Disable MSVC Linker 'Arm Hazard' warning)
 - #140759 ([win][arm64] Disable std::fs tests that require symlinks)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-05-08 15:09:05 +00:00
Michael Goulet
9af6ee50ed Structurally resolve in check_ref_cast and calc_adjust_mode 2025-05-08 15:00:17 +00:00
Jakub Beránek
4f9bb8c735
Mention fast try builds in the rustc-dev-guide 2025-05-08 16:00:48 +02:00