302249 Commits

Author SHA1 Message Date
The rustc-josh-sync Cronjob Bot
e296468a47 Merge ref '6bcdcc73bd11' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: 6bcdcc73bd11568fd85f5a38b58e1eda054ad1cd
Filtered ref: 6cc4ce79e1f8dc0ec5a2e18049b9c1a51dee3221

This merge was created using https://github.com/rust-lang/josh-sync.
2025-08-07 04:18:21 +00:00
The rustc-josh-sync Cronjob Bot
4f96b2aa5e Prepare for merging from rust-lang/rust
This updates the rust-version file to 6bcdcc73bd11568fd85f5a38b58e1eda054ad1cd.
2025-08-07 04:18:12 +00:00
bors
6bcdcc73bd Auto merge of #145020 - GuillaumeGomez:rollup-5prs9kw, r=GuillaumeGomez
Rollup of 15 pull requests

Successful merges:

 - rust-lang/rust#144195 (Parser: Recover from attributes applied to types and generic args)
 - rust-lang/rust#144794 (Port `#[coroutine]` to the new attribute system)
 - rust-lang/rust#144835 (Anonymize binders in tail call sig)
 - rust-lang/rust#144861 (Stabilize `panic_payload_as_str` feature)
 - rust-lang/rust#144917 (Enforce tail call type is related to body return type in borrowck)
 - rust-lang/rust#144948 (we only merge candidates for trait and normalizes-to goals)
 - rust-lang/rust#144956 (Gate const trait syntax)
 - rust-lang/rust#144970 (rustdoc: fix caching of intra-doc links on reexports)
 - rust-lang/rust#144972 (add code example showing that file_prefix treats dotfiles as the name of a file, not an extension)
 - rust-lang/rust#144975 (`File::set_times`: Update documentation and example to support setting timestamps on directories)
 - rust-lang/rust#144977 (Fortify generic param default checks)
 - rust-lang/rust#144996 (simplifycfg: Mark as changed when start is modified in collapse goto chain)
 - rust-lang/rust#144998 (mir: Do not modify NonUse in `super_projection_elem`)
 - rust-lang/rust#145000 (Remove unneeded `stage` parameter when setting up stdlib Cargo)
 - rust-lang/rust#145008 (Fix rustdoc scrape examples crash)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-08-06 23:23:26 +00:00
Tshepang Mbambo
976bceeea2
Merge pull request #2538 from lolbinarycat/patch-6
Link from "Overview of the compiler § Queries" to the Queries chapter
2025-08-06 22:16:30 +02:00
lolbinarycat
162b908eb6
Make link relative an link to md not html 2025-08-06 15:01:41 -05:00
Guillaume Gomez
d369a1fe5e
Rollup merge of #145008 - GuillaumeGomez:fix-rustdoc-scrape-examples-crash, r=fmease
Fix rustdoc scrape examples crash

Fixes rust-lang/rust#144752.

The regression was introduced in https://github.com/rust-lang/rust/pull/144600. Although I don't understand why it is an issue currently, this allows to bypass the failure for now until we can figure out what's wrong as it's currently blocking new `bevy`'s release.

cc `@alice-i-cecile`
r? `@fmease`
2025-08-06 21:29:35 +02:00
Guillaume Gomez
c17f50be73
Rollup merge of #145000 - Kobzol:std-cargo-stage, r=jieyouxu
Remove unneeded `stage` parameter when setting up stdlib Cargo

The standard library can't be built using a compiler that has a lower stage than 1 anymore, so the condition was useless (you can test that with e.g. `x doc std --stage 0`, which is broken - I aim to forbid doing that soon).

Found this while doing an unrelated cleanup.

r? `@jieyouxu`
2025-08-06 21:29:34 +02:00
Guillaume Gomez
c152aa87a1
Rollup merge of #144998 - dianqk:visit-no-use-proj, r=cjgillot
mir: Do not modify NonUse in `super_projection_elem`

Split from rust-lang/rust#142771.
r? cjgillot
2025-08-06 21:29:34 +02:00
Guillaume Gomez
e56c24129e
Rollup merge of #144996 - dianqk:simplifycfg-collapse_goto_chain-changed, r=cjgillot
simplifycfg: Mark as changed when start is modified in collapse goto chain

Split from rust-lang/rust#142771.
r? cjgillot
2025-08-06 21:29:33 +02:00
Guillaume Gomez
12d1b173fb
Rollup merge of #144977 - fmease:fortify-param-default-checks, r=compiler-errors
Fortify generic param default checks

* Hard-reject instead of lint-reject type param defaults in generic assoc consts (GACs) (feature: `generic_const_items`).
  * In https://github.com/rust-lang/rust/pull/113522, I explicitly handled the free const item case and forgot about the assoc const one.
  * This led rustc to assume the default of emitting the deny-by-default lint `invalid_type_param_default`.
  * GCIs are unstable, thus we're not bound by backward compat
* Hard-reject instead of lint-reject type param defaults in foreign items.
  * We already hard-reject generic params on foreign items, so this isn't a breaking change.
  * There's no reason why we need to lint-reject.
* Refactor the way we determine where generic param defaults are allowed:
  * Don't default to emitting lint `invalid_type_param_defaults` for nodes that aren't explicitly handled but instead panic.
  * This would've caught my GAC oversight from above much earlier via fuzzing
  * Prevents us from accidentally stabilizing more invalid type param defaults in the future
* Streamline the phrasing of the diagnostic
2025-08-06 21:29:32 +02:00
Guillaume Gomez
094b893f77
Rollup merge of #144975 - joshtriplett:file-times-dir, r=jhpratt
`File::set_times`: Update documentation and example to support setting timestamps on directories

Inspired by https://github.com/rust-lang/rust/issues/123883 .
2025-08-06 21:29:32 +02:00
Guillaume Gomez
09de71b61c
Rollup merge of #144972 - the8472:file-prefix-docs, r=joshtriplett
add code example showing that file_prefix treats dotfiles as the name of a file, not an extension

This came up in a libs-api meeting while we were reviewing rust-lang/rust#144870
2025-08-06 21:29:31 +02:00
Guillaume Gomez
de6c639228
Rollup merge of #144970 - lolbinarycat:rustdoc-macro-wrong-link-144965, r=GuillaumeGomez
rustdoc: fix caching of intra-doc links on reexports

previously two reexports of the same item would share a set of intra-doc links, which would cause problems if they had two different links with the same text.  this was fixed by using the reexport defid as the key, if it is available.

fixes https://github.com/rust-lang/rust/issues/144965
2025-08-06 21:29:31 +02:00
Guillaume Gomez
48d57564cf
Rollup merge of #144956 - fmease:gate-const-trait-syntax, r=BoxyUwU
Gate const trait syntax

Missed this during my review of rust-lang/rust#143879, huge apologies!
Fixes [after beta backport] https://github.com/rust-lang/rust/issues/144958.

cc ``@fee1-dead``
r? ``@BoxyUwU`` or anyone
2025-08-06 21:29:30 +02:00
Guillaume Gomez
f7520353ab
Rollup merge of #144948 - lcnr:change-candidate-handling, r=compiler-errors
we only merge candidates for trait and normalizes-to goals

so change `fn try_merge_responses` to `fn try_merge_candidates` and just use candidates everywhere.

Potentially slightly faster than the alternative :3

r? ``@compiler-errors`` ``@BoxyUwU``
2025-08-06 21:29:29 +02:00
Guillaume Gomez
65479f7353
Rollup merge of #144917 - compiler-errors:tail-call-linked-lifetimes, r=lcnr
Enforce tail call type is related to body return type in borrowck

Like all call terminators, tail call terminators instantiate the binder of the callee signature with region variables and equate the arg operand types with that signature's args to ensure that the call is valid.

However, unlike normal call terminators, we were forgetting to also relate the return type of the call terminator to anything. In the case of tail call terminators, the correct thing is to relate it to the return type of the caller function (or in other words, the return local `_0`).

This meant that if the caller's return type had some lifetime constraint, then that constraint wouldn't flow through the signature and affect the args.

This is what's happening in the example test I committed:

```rust
fn link(x: &str) -> &'static str {
    become passthrough(x);
}

fn passthrough<T>(t: T) -> T { t }

fn main() {
    let x = String::from("hello, world");
    let s = link(&x);
    drop(x);
    println!("{s}");
}
```

Specifically, the type `x` is `'?0 str`, where `'?0` is some *universal* arg. The type of `passthrough` is `fn(&'?1 str) -> &'?1 str`. Equating the args sets `'?0 = '?1`. However, we need to also equate the return type `&'?1 str` to `&'static str` so that we eventually require that `'?0 = 'static`, which is a borrowck error!

-----

Look at the first commit for the functional change, and the second commit is just a refactor because we don't need to pass `Option<BasicBlock>` to `check_call_dest`, but just whether or not the terminator is expected to be diverging (i.e. if the return type is `!`).

Fixes rust-lang/rust#144916
2025-08-06 21:29:29 +02:00
Guillaume Gomez
5209bc6661
Rollup merge of #144861 - Kivooeo:payload-as-str-stabilization, r=ChrisDenton
Stabilize `panic_payload_as_str` feature

Closes [tracking issue](https://github.com/rust-lang/rust/issues/125175).

Part of https://github.com/rust-lang/rust/issues/116005.

FCP ended more than year ago in tracking issue, I'm not sure if we should rerun it.
2025-08-06 21:29:28 +02:00
Guillaume Gomez
940a003985
Rollup merge of #144835 - compiler-errors:tail-call-sig-binder, r=WaffleLapkin
Anonymize binders in tail call sig

See the comment for explanation

Fixes rust-lang/rust#144826

r? WaffleLapkin
2025-08-06 21:29:27 +02:00
Guillaume Gomez
96a41c5aba
Rollup merge of #144794 - scrabsha:push-noqrrttovmwy, r=jdonszelmann
Port `#[coroutine]` to the new attribute system

Related to https://github.com/rust-lang/rust/issues/131229#issue-2565886367.

r? `````@jdonszelmann`````
2025-08-06 21:29:27 +02:00
Guillaume Gomez
d180873be8
Rollup merge of #144195 - Kivooeo:bad-attr, r=fmease,compiler-errors
Parser: Recover from attributes applied to types and generic args

r? compiler

Add clearer error messages for invalid attribute usage in types or generic types

fixes rust-lang/rust#135017
fixes rust-lang/rust#144132
2025-08-06 21:29:26 +02:00
bors
7d82b83ed5 Auto merge of #144509 - cuviper:relnotes-1.89.0, r=BoxyUwU
Add release notes for 1.89.0

r? `@BoxyUwU`
cc `@rust-lang/release`
`@rustbot` ping relnotes-interest-group
2025-08-06 19:28:30 +00:00
Josh Triplett
e597071cbf Reword documentation for set_times to clarify directory handling 2025-08-06 11:41:16 -07:00
lolbinarycat
ef3708bf63
Link from "Overview of the compiler § Queries" to the Queries chapter
There's already a link in the other direction, so this seems fairly logical.
2025-08-06 13:31:52 -05:00
bors
29cdc6a109 Auto merge of #145003 - Kobzol:rollup-kgb216b, r=Kobzol
Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#144552 (Rehome 33 `tests/ui/issues/` tests to other subdirectories under `tests/ui/`)
 - rust-lang/rust#144676 (Add documentation for unstable_feature_bound)
 - rust-lang/rust#144836 (Change visibility of Args new function)
 - rust-lang/rust#144910 (Add regression tests for seemingly fixed issues)
 - rust-lang/rust#144913 ([rustdoc] Fix wrong `i` tooltip icon)
 - rust-lang/rust#144924 (compiletest: add hint for when a ui test produces no errors)
 - rust-lang/rust#144926 (Correct the use of `must_use` on btree::IterMut)
 - rust-lang/rust#144928 (Drop `rust-version` from `rustc_thread_pool`)
 - rust-lang/rust#144945 (Autolabel PRs that change explicit tail call tests as `F-explicit_tail_calls`)
 - rust-lang/rust#144954 (run-make: Allow blessing snapshot files that don't exist yet)
 - rust-lang/rust#144971 (num: Rename `isolate_most_least_significant_one` functions)
 - rust-lang/rust#144978 (Fix some doc links for intrinsics)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-08-06 16:17:02 +00:00
Guillaume Gomez
a2b1714fb2 Add regression test for rustdoc scrape-examples feature crash (#144752) 2025-08-06 17:26:08 +02:00
Guillaume Gomez
768f97748f Fix rustdoc scrape-examples feature crash 2025-08-06 17:14:49 +02:00
Jakub Beránek
66f0f27290
Rollup merge of #144978 - ehuss:intrinsic-doc-links, r=scottmcm
Fix some doc links for intrinsics

This fixes a few intrinsic docs that had a link directly to itself instead of to the correct function in the `mem` module.
2025-08-06 15:55:49 +02:00
Jakub Beránek
84dc97c2b6
Rollup merge of #144971 - okaneco:rename_isolate_ones, r=joshtriplett
num: Rename `isolate_most_least_significant_one` functions

Tracking issue - https://github.com/rust-lang/rust/issues/136909

libs-api has agreed to rename these unstable functions to `isolate_highest_one`/`isolate_lowest_one`
https://github.com/rust-lang/rust/issues/136909#issuecomment-3156005820

`isolate_most_significant_one` -> `isolate_highest_one`
`isolate_least_significant_one` -> `isolate_lowest_one`
2025-08-06 15:55:48 +02:00
Jakub Beránek
a88e29b0d7
Rollup merge of #144954 - Zalathar:run-make-bless, r=jieyouxu
run-make: Allow blessing snapshot files that don't exist yet

This makes it possible to bless the snapshot files used by `diff()` in newly-created run-make tests, without having to create the files manually beforehand.

r? jieyouxu
2025-08-06 15:55:48 +02:00
Jakub Beránek
07e86341a5
Rollup merge of #144945 - WaffleLapkin:autolabeletc, r=WaffleLapkin
Autolabel PRs that change explicit tail call tests as `F-explicit_tail_calls`

mrrrow~
2025-08-06 15:55:47 +02:00
Jakub Beránek
d54fb8364d
Rollup merge of #144928 - cuviper:rustc_thread_pool-msrv, r=lqd
Drop `rust-version` from `rustc_thread_pool`

The current `rust-version = "1.63"` was inherited from rayon, but it
doesn't make sense to limit this in the compiler workspace. Having any
setting at all has effects on tools like `cargo info` that try to infer
the MSRV when the workspace itself doesn't specify it. Since we are the
compiler, our only MSRV is whatever bootstrapping requires.
2025-08-06 15:55:47 +02:00
Jakub Beránek
6afd162762
Rollup merge of #144926 - JonathanBrouwer:fix-mustuse, r=cuviper
Correct the use of `must_use` on btree::IterMut

I'm working on stricter target checking for attributes and found this one
2025-08-06 15:55:46 +02:00
Jakub Beránek
5ac085681b
Rollup merge of #144924 - lolbinarycat:compiletest-pass-directives-hint, r=clubby789
compiletest: add hint for when a ui test produces no errors
2025-08-06 15:55:46 +02:00
Jakub Beránek
4b6971e254
Rollup merge of #144913 - GuillaumeGomez:fix-wrong-i-icon, r=fmease
[rustdoc] Fix wrong `i` tooltip icon

Current wrong display:

<img width="334" height="37" alt="Screenshot From 2025-08-04 17-42-38" src="https://github.com/user-attachments/assets/57046475-6162-487f-998f-ebb2434c111d" />

With the fix:

<img width="334" height="37" alt="image" src="https://github.com/user-attachments/assets/e761a103-dc39-4e30-8c8e-cfc7fab52fde" />

r? ``@fmease``
2025-08-06 15:55:45 +02:00
Jakub Beránek
07007135f2
Rollup merge of #144910 - ShoyuVanilla:add-regression-tests, r=fee1-dead
Add regression tests for seemingly fixed issues

Closes rust-lang/rust#104314
Closes rust-lang/rust#125866
2025-08-06 15:55:44 +02:00
Jakub Beránek
bde39e58d6
Rollup merge of #144836 - chotchki:patch-1, r=tgross35
Change visibility of Args new function

Currently the Args new function is constrained to pub(super) but this stops me from being able to construct Args structs in unit tests.

This pull request is to change this to pub.
2025-08-06 15:55:44 +02:00
Jakub Beránek
21e488c00a
Rollup merge of #144676 - tiif:dev_guide_unstable_bound, r=BoxyUwU
Add documentation for unstable_feature_bound

There is more detail and explanation in https://hackmd.io/``````@tiif/Byd3mq7Ige``````

Original PR that implemented this: rust-lang/rust#140399

r? ``````@BoxyUwU`````` to nominate for types team discussion
2025-08-06 15:55:43 +02:00
Jakub Beránek
e89ae47b97
Rollup merge of #144552 - Oneirical:uncountable-integer-3, r=jieyouxu
Rehome 33 `tests/ui/issues/` tests to other subdirectories under `tests/ui/`

rust-lang/rust#143902 divided into smaller, easier to review chunks.

Part of rust-lang/rust#133895

Methodology:

1. Refer to the previously written `tests/ui/SUMMARY.md`
2. Find an appropriate category for the test, using the original issue thread and the test contents.
3. Add the issue URL at the bottom (not at the top, as that would mess up stderr line numbers)
4. Rename the tests to make their purpose clearer

Inspired by the methodology that ``@Kivooeo`` was using.

r? ``@jieyouxu``
2025-08-06 15:55:42 +02:00
Jakub Beránek
057df26bae
Remove unneeded stage parameter when setting up stdlib Cargo 2025-08-06 15:20:15 +02:00
bors
8fb40f798a Auto merge of #143679 - sebastianpoeplau:preserve-debug-gdb-scripts-section, r=bjorn3
Preserve the .debug_gdb_scripts section

Make sure that compiler and linker don't optimize the section's contents
away by adding the global holding the data to `llvm.used`. This
eliminates the need for a volatile load in the main shim; since the LLVM
codegen backend is the only implementer of the corresponding trait
function, remove it entirely.

Pretty printers in dylib dependencies are now emitted by the main crate
instead of the dylib; apart from matching how rlibs are handled, this
approach has the advantage that `omit_gdb_pretty_printer_section` keeps
working with dylib dependencies.

r? `@bjorn3`
2025-08-06 13:02:36 +00:00
Boxy
607133bed2
Add a few missed entries 2025-08-06 13:57:36 +01:00
dianqk
d55cc9a9bd
mir: Do not modify NonUse in super_projection_elem 2025-08-06 20:41:39 +08:00
Jana Dönszelmann
4a2ef3c1c8
Merge pull request #2537 from jdonszelmann/wasi
Add instructions to test wasi (wasm32-wasip1) specific tests
2025-08-06 14:41:34 +02:00
Jana Dönszelmann
c3ee403322
add note on how to build wasi 2025-08-06 14:40:25 +02:00
dianqk
2909de557c
simplifycfg: Mark as changed when start is modified in collapse goto chain 2025-08-06 20:26:10 +08:00
Sebastian Poeplau
b4d923cea0 Embed GDB pretty printers in rlibs and dylibs
Instead of collecting pretty printers transitively when building
executables/staticlibs/cdylibs, let the debugger find each crate's
pretty printers via its .debug_gdb_scripts section. This covers the case
where libraries defining custom pretty printers are loaded dynamically.
2025-08-06 13:24:43 +02:00
bors
dc0bae1db7 Auto merge of #143684 - nikic:llvm-21, r=cuviper
Update to LLVM 21

Timeline: LLVM 21.1.0 is scheduled to release on Aug 26th. Rust 1.90 branches on Aug 1st and releases September 18.

Depends on:
 * [x] https://github.com/llvm/llvm-project/issues/147781
 * [x] https://github.com/llvm/llvm-project/issues/147935
 * [x] https://github.com/llvm/llvm-project/issues/139443
 * [x] https://github.com/llvm/llvm-project/pull/148207
 * [x] https://github.com/llvm/llvm-project/pull/148607
 * [x] https://github.com/llvm/llvm-project/pull/149046
 * [x] https://github.com/llvm/llvm-project/issues/149097
 * [x] https://github.com/rust-lang/rust/pull/144116

r? `@ghost`
2025-08-06 04:36:54 +00:00
Zalathar
f96fbb214b run-make: Allow blessing snapshot files that don't exist yet
This makes it possible to bless the snapshot files used by `diff()` in
newly-created run-make tests, without having to create the files manually
beforehand.
2025-08-06 11:17:56 +10:00
Eric Huss
2cd5b4928d Fix some doc links for intrinsics
This fixes a few intrinsic docs that had a link directly to itself
instead of to the correct function in the `mem` module.
2025-08-05 17:02:01 -07:00
León Orell Valerian Liehr
02ea38cfff
Fortify generic param default checks 2025-08-06 01:26:26 +02:00