303456 Commits

Author SHA1 Message Date
github-actions
a42833e0aa cargo update
compiler & tools dependencies:
     Locking 18 packages to latest compatible versions
    Updating anstream v0.6.19 -> v0.6.20
    Updating anstyle-query v1.1.3 -> v1.1.4
    Updating anstyle-svg v0.1.9 -> v0.1.10
    Updating anstyle-wincon v3.0.9 -> v3.0.10
    Updating camino v1.1.10 -> v1.1.11
    Updating clap v4.5.42 -> v4.5.43
    Updating clap_builder v4.5.42 -> v4.5.43
    Updating cxx v1.0.161 -> v1.0.166
    Updating cxx-build v1.0.161 -> v1.0.166
    Updating cxxbridge-cmd v1.0.161 -> v1.0.166
    Updating cxxbridge-flags v1.0.161 -> v1.0.166
    Updating cxxbridge-macro v1.0.161 -> v1.0.166
    Updating derive-where v1.5.0 -> v1.6.0
    Updating hashbrown v0.15.4 -> v0.15.5
    Updating indenter v0.3.3 -> v0.3.4
    Updating rustversion v1.0.21 -> v1.0.22
    Updating scratch v1.0.8 -> v1.0.9
    Updating zerovec v0.11.2 -> v0.11.4
note: pass `--verbose` to see 36 unchanged dependencies behind latest

library dependencies:
     Locking 1 package to latest compatible version
    Updating hashbrown v0.15.4 -> v0.15.5
note: pass `--verbose` to see 2 unchanged dependencies behind latest

rustbook dependencies:
     Locking 10 packages to latest compatible versions
    Updating anstream v0.6.19 -> v0.6.20
    Updating anstyle-query v1.1.3 -> v1.1.4
    Updating anstyle-wincon v3.0.9 -> v3.0.10
    Updating cc v1.2.31 -> v1.2.32
    Updating clap v4.5.42 -> v4.5.43
    Updating clap_builder v4.5.42 -> v4.5.43
    Updating clap_complete v4.5.55 -> v4.5.56
    Updating hashbrown v0.15.4 -> v0.15.5
    Updating rustversion v1.0.21 -> v1.0.22
    Updating zerovec v0.11.2 -> v0.11.4
2025-08-10 00:27:35 +00:00
bors
41ede7bd9b Auto merge of #145146 - fee1-dead-contrib:push-zmqrkurlzrxy, r=nnethercote
remove `P`

Previous work: rust-lang/rust#141603
MCP: https://github.com/rust-lang/compiler-team/issues/878

cc `@nnethercote`
2025-08-09 23:27:55 +00:00
Josh Triplett
feed41c852 Fix an unstable feature comment that wasn't a doc comment
Every other feature in the list uses a doc comment; fix one that used a
regular comment to use a doc comment.
2025-08-09 15:17:02 -07:00
Josh Triplett
c503487a6f Avoid abbreviating "numerator" as "numer", to allow catching typo "numer" elsewhere
`typos.toml` has an exception for "numer", to avoid flagging its use as
an abbreviation for "numerator". Remove the use of that abbrevation,
spelling out "numerator" instead, and remove the exception, so that typo
checks can find future instances of "numer" as a typo for "number".
2025-08-09 15:01:58 -07:00
Ada Alakbarova
06e43655bc
HashMap: also add "Usage with custom key types" heading 2025-08-09 19:41:41 +02:00
Ada Alakbarova
c0a3e4802a
{BTree,Hash}Map: add "Entry API" section heading 2025-08-09 19:41:32 +02:00
binarycat
a59842e4d5 improve "Documentation problem" issue template.
rustdoc has its own issue template now, mention that.

swap the order of the last two sentances so it reads more like
a typical if/else chain (base case listed last).

adjust some labels and descriptions
2025-08-09 12:27:19 -05:00
jyn
f4d3dd0394
Apply suggestions from code review
Co-authored-by: Florian Bartels <108917393+flba-eb@users.noreply.github.com>
Co-authored-by: Mads Marquart <mads@marquart.dk>
2025-08-09 11:49:35 -04:00
Deadbeef
71f6e537fa some derive_more refactors
some clauses can be merged together without requiring an attribute for
each trait derived.

also manually impl `Eq` because the `derive_where` generated code is too
much for my comfort
2025-08-09 22:24:44 +08:00
bit-aloo
bfa6b56920
add review comments 2025-08-09 18:12:05 +05:30
xizheyin
ca1e464ac3
Change days-threshold to 28 in [behind-upstream]
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-08-09 19:58:58 +08:00
Kivooeo
16765639b3 comments 2025-08-09 16:27:20 +05:00
Jakub Beránek
a5ddf5da58
Override custom Cargo build-dir in bootstrap 2025-08-09 11:51:20 +02:00
bors
ca77504943 Auto merge of #145142 - Zalathar:rollup-oi6s8kg, r=Zalathar
Rollup of 23 pull requests

Successful merges:

 - rust-lang/rust#141658 (rustdoc search: prefer stable items in search results)
 - rust-lang/rust#141828 (Add diagnostic explaining STATUS_STACK_BUFFER_OVERRUN not only being used for stack buffer overruns if link.exe exits with that exit code)
 - rust-lang/rust#144823 (coverage: Extract HIR-related helper code out of the main module)
 - rust-lang/rust#144883 (Remove unneeded `drop_in_place` calls)
 - rust-lang/rust#144923 (Move several more float tests to floats/mod.rs)
 - rust-lang/rust#144988 (Add annotations to the graphviz region graph on region origins)
 - rust-lang/rust#145010 (Couple of minor abi handling cleanups)
 - rust-lang/rust#145017 (Explicitly disable vector feature on s390x baseline of bad-reg test)
 - rust-lang/rust#145027 (Optimize `char::is_alphanumeric`)
 - rust-lang/rust#145050 (add member constraints tests)
 - rust-lang/rust#145073 (update enzyme submodule to handle llvm 21)
 - rust-lang/rust#145080 (Escape diff strings in MIR dataflow graphviz)
 - rust-lang/rust#145082 (Fix some bad formatting in `-Zmacro-stats` output.)
 - rust-lang/rust#145083 (Fix cross-compilation of Cargo)
 - rust-lang/rust#145096 (Fix wasm target build with atomics feature)
 - rust-lang/rust#145097 (remove unnecessary `TypeFoldable` impls)
 - rust-lang/rust#145100 (Rank doc aliases lower than equivalently matched items)
 - rust-lang/rust#145103 (rustc_metadata: remove unused private trait impls)
 - rust-lang/rust#145115 (defer opaque type errors, generally greatly reduce tainting)
 - rust-lang/rust#145119 (rustc_public: fix missing parenthesis in pretty discriminant)
 - rust-lang/rust#145124 (Recover `for PAT = EXPR {}`)
 - rust-lang/rust#145132 (Refactor map_unit_fn lint)
 - rust-lang/rust#145134 (Reduce indirect assoc parent queries)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-08-09 08:57:23 +00:00
Kivooeo
b5e2ba6775 Stabilize feature 2025-08-09 13:31:53 +05:00
Deadbeef
ad1113f87e remove P 2025-08-09 15:47:01 +08:00
Chris Denton
89b366955e
Replace unsafe function with safe alternative
The `security_attributes` function is marked as safe despite taking a raw pointer which will later be used. Fortunately this function is only used internally and only in one place that has been basically the same for a decade now.

However, we only ever set one bool so it's easy enough to replace with something that's actually safe.
2025-08-09 07:05:12 +00:00
Deadbeef
2736d66a1f rename TraitRef::from_method to from_assoc
also add a note to `GenericArgs::truncate_to`
2025-08-09 14:22:01 +08:00
WANG Rui
0246245420 rustc_target: Add the 32s target feature for LoongArch 2025-08-09 13:54:09 +08:00
Scott McMurray
8831c5b994 Stop using uadd.with.overflow 2025-08-08 21:59:28 -07:00
bit-aloo
8612db2f3e
extend download context and change functions to directly use that 2025-08-09 10:04:23 +05:30
Stuart Cook
d88a309114
Rollup merge of #145134 - camsteffen:indirect-assoc-parent, r=cjgillot
Reduce indirect assoc parent queries

Simplify some code that uses multiple queries to get the parent of an associated item.
2025-08-09 13:58:55 +10:00
Stuart Cook
484141038a
Rollup merge of #145132 - camsteffen:refactor-map-unit-fn, r=fee1-dead
Refactor map_unit_fn lint

Just some light refactoring.
2025-08-09 13:58:55 +10:00
Stuart Cook
aea608c751
Rollup merge of #145124 - compiler-errors:for-eq, r=lqd
Recover `for PAT = EXPR {}`

I type this constantly, and the existing suggestion to put `in` before the `=` is misleading.
2025-08-09 13:58:54 +10:00
Stuart Cook
a56142cbfb
Rollup merge of #145119 - makai410:pretty-fix, r=compiler-errors
rustc_public: fix missing parenthesis in pretty discriminant
2025-08-09 13:58:54 +10:00
Stuart Cook
9d989bf1cf
Rollup merge of #145115 - lcnr:less-borrowck-tainting, r=compiler-errors
defer opaque type errors, generally greatly reduce tainting

fixes the test for rust-lang/rust#135528, does not actually fix that issue properly.

This is useful as it causes the migration to rust-lang/rust#139587 to be a lot easier.
2025-08-09 13:58:53 +10:00
Stuart Cook
d0ddce8585
Rollup merge of #145103 - fee1-dead-contrib:push-plompruwywvk, r=compiler-errors
rustc_metadata: remove unused private trait impls

These are impls for non-reachable traits that don't appear to be used. Please let me know if there is value in keeping some of them for now.

cc `@cjgillot`
2025-08-09 13:58:52 +10:00
Stuart Cook
cd1e82ac72
Rollup merge of #145100 - GuillaumeGomez:rank-doc-alias-lower, r=lolbinarycat
Rank doc aliases lower than equivalently matched items

Follow-up of https://github.com/rust-lang/rust/pull/143988.

cc `@lolbinarycat`
2025-08-09 13:58:52 +10:00
Stuart Cook
e68d621321
Rollup merge of #145097 - lcnr:type-foldable-yeet, r=wesleywiser
remove unnecessary `TypeFoldable` impls
2025-08-09 13:58:51 +10:00
Stuart Cook
f47557c4a7
Rollup merge of #145096 - Spxg:w/wasm_atomic, r=tgross35
Fix wasm target build with atomics feature

Introduced by https://github.com/rust-lang/rust/pull/115746

close https://github.com/rust-lang/rust/issues/145101
2025-08-09 13:58:51 +10:00
Stuart Cook
0b289784b3
Rollup merge of #145083 - Kobzol:fix-cargo-cross-build, r=jieyouxu
Fix cross-compilation of Cargo

Regressed in https://github.com/rust-lang/rust/pull/144303. I guess this wasn't seen in other `ToolTarget` tools, because they are more dependent on the compiler and are ~always built together with other stuff that also built the std, while Cargo is relatively self-contained.

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

r? ``@jieyouxu``
2025-08-09 13:58:50 +10:00
Stuart Cook
d0ddeb5bfc
Rollup merge of #145082 - nnethercote:macro-stats-fix-widths, r=petrochenkov
Fix some bad formatting in `-Zmacro-stats` output.

r? `@petrochenkov`
2025-08-09 13:58:49 +10:00
Stuart Cook
354ef54204
Rollup merge of #145080 - ashivaram23:graphviz_escape, r=lqd
Escape diff strings in MIR dataflow graphviz

This uses `dot::escape_html` on diff strings so that `<` and `>` are properly escaped in MIR dataflow graphviz.

Previously the output could be malformed. For example, the graphviz for borrow check `MaybeInitializedPlaces` for the example in rust-lang/rust#145032 contained an unescaped `Fork<'_>`.
2025-08-09 13:58:49 +10:00
Stuart Cook
f077257020
Rollup merge of #145073 - ZuseZ4:autodiff-llvm-21, r=jieyouxu
update enzyme submodule to handle llvm 21

This currently has a fix / workaround in our local rust-lang/Enzyme fork, which is needed to unblock a few people contributing to std::autodiff. It also permanently disables a component (BCLoader) which we shouldn't need on the rust side, hence saving a bit of compile time and disk space.

Once upstream Enzyme (EnzymeAD/Enzyme) fixed llvm-21 support I'll probably make another pr to drop our local patch.
2025-08-09 13:58:48 +10:00
Stuart Cook
50ad4c8b44
Rollup merge of #145050 - lcnr:add-opaque-type-tests, r=lqd
add member constraints tests

taken from rust-lang/rust#139587.
2025-08-09 13:58:48 +10:00
Stuart Cook
2a7354e03e
Rollup merge of #145027 - Kmeakin:km/optimize-char-is-alphanumeric, r=scottmcm
Optimize `char::is_alphanumeric`

Avoid an unnecessary call to `unicode::Alphabetic` when `self` is an ASCII digit (ie `0..=9`).
2025-08-09 13:58:47 +10:00
Stuart Cook
aa7cb5396e
Rollup merge of #145017 - pmur:murp/s390x-improve-asm-test, r=nnethercote
Explicitly disable vector feature on s390x baseline of bad-reg test

If the baseline s390x cpu is changed to a newer variant, such as z13, the vector feature may be enabled by default. When rust is packaged on fedora 38 and newer, it is set to z13.

Explicitly disable vector support on the baseline test for consistent results across s390x cpus.
2025-08-09 13:58:47 +10:00
Stuart Cook
61e9c6c686
Rollup merge of #145010 - bjorn3:couple_abi_cleanups, r=compiler-errors
Couple of minor abi handling cleanups

These are extracted out of a wip branch I have to get rid of the `extern "unadjusted"` ABI for anything other than LLVM intrinsics.
2025-08-09 13:58:46 +10:00
Stuart Cook
35f2fb9453
Rollup merge of #144988 - amandasystems:more-detailed-region-graph, r=lcnr
Add annotations to the graphviz region graph on region origins

This adds
- `(ex<'e>)` for regions whose origin is existential, with name if one exists,
- `(for<'p>)` for regions whose origin is a placeholder, with name if one exists

For any region whose name we don't know, use `'_`.

This has helped _my_ debugging and it doesn't create too bad clutter, I feel.

The change  ~~is~~was ridiculously small, but I turned it into a separate PR so we can bikeshed the format.

The following snippet:
```rust
struct Co<'a>(&'a ());
struct Contra<'a>(fn(&'a ()));

// `exists<'e> forall<'p> 'p: 'e` -> ERROR
fn p_outlives_e(
    x: for<'e> fn(for<'p> fn(fn(fn(Contra<'e>, Co<'p>)))),
) -> fn(fn(fn(for<'unify> fn(Contra<'unify>, Co<'unify>)))) {
    x
```

Gives this graph:
![new-naming](https://github.com/user-attachments/assets/f2c8f17c-d29b-4d42-9da7-4b8e520e76a6)
2025-08-09 13:58:45 +10:00
Stuart Cook
7f77dfdda3
Rollup merge of #144923 - rocurley:float_tests_refactor_3, r=tgross35
Move several more float tests to floats/mod.rs

This PR moves several tests to `floats/mod.rs`, as discussed in https://github.com/rust-lang/rust/issues/141726. The tests moved are:

* `test_abs`
* `test_signum`
* `test_is_sign_positive`
* `test_is_sign_negative`
* `test_next_up`
* `test_next_down`
* `test_sqrt_domain`
* `test_clamp_min_greater_than_max`
* `test_clamp_min_is_nan`
* `test_clamp_max_is_nan`
* `test_total_cmp`

This covers all the "easy" tests: the ones that don't have a lot of precision-specific constants. It's not clear to me that it's worth migrating the others.

Each test is its own commit (with the exception of the clamp tests), so it may be easiest to review each commit individually.

r? tgross35
2025-08-09 13:58:45 +10:00
Stuart Cook
e63e769c9b
Rollup merge of #144883 - scottmcm:remove-unneeded-drop_in_place, r=nnethercote
Remove unneeded `drop_in_place` calls

Might as well pull this out from rust-lang/rust#144561 because this is still used in things like `Vec::truncate` where it'd be nice to allow it be removed if inlined enough to see that the type is `Copy`.

So long as perf says it's ok, at least 🤞
2025-08-09 13:58:44 +10:00
Stuart Cook
4f80489767
Rollup merge of #144823 - Zalathar:hir-info, r=oli-obk
coverage: Extract HIR-related helper code out of the main module

This is a decent chunk of helper code with a narrow external interface (one function returning one struct), making it a good candidate to be extracted out of the main `rustc_mir_transform::coverage` module.

No functional changes.
2025-08-09 13:58:44 +10:00
Stuart Cook
2053728d81
Rollup merge of #141828 - Fulgen301:status-stack-buffer-overrun-diagnostic, r=wesleywiser
Add diagnostic explaining STATUS_STACK_BUFFER_OVERRUN not only being used for stack buffer overruns if link.exe exits with that exit code

`STATUS_STACK_BUFFER_OVERRUN` is also used for fast abnormal program termination, e.g. by abort(). Emit a special diagnostic to let people know that this most likely doesn't indicate a stack buffer overrun.

This doesn't look up the crash report in the event log to determine what the fast fail error code is. This is due to the way crashes are logged: When a process crash happens, the system logs an "Application Error" event, which contains the exit code and the process ID, but not the fast fail error code. A second event by Windows Error Reporting does contain that fast fail code, but not the process ID - but that event is not emitted at process exit, but when WER has dealt with it (on my system, it happens roughly two seconds later), so querying the code would have to read the `IntegratorReportId`, wait two seconds or potentially longer for the WER event with the same `ReportID`, and read out the code. (Also, that second event doesn't happen if WER is disabled.)

Fixes rust-lang/rust#100519.
2025-08-09 13:58:43 +10:00
Stuart Cook
48f5929604
Rollup merge of #141658 - lolbinarycat:rustdoc-search-stability-rank-138067, r=GuillaumeGomez
rustdoc search: prefer stable items in search results

fixes https://github.com/rust-lang/rust/issues/138067

this does add a new field to the search index, but since we're only listing unstable items instead of adding a boolean flag to every item, it should only increase the search index size of sysroot crates, since those are the only ones using the `staged_api` feature, at least as far as the rust project is concerned.
2025-08-09 13:58:42 +10:00
bors
2de2456fb7 Auto merge of #143376 - dianne:guard-scope, r=matthewjasper
add a scope for `if let` guard temporaries and bindings

This fixes my concern with `if let` guard drop order, namely that the guard's bindings and temporaries were being dropped after their arm's pattern's bindings, instead of before (https://github.com/rust-lang/rust/pull/141295#issuecomment-2968975596). The guard's bindings and temporaries now live in a new scope, which extends until (but not past) the end of the arm, guaranteeing they're dropped before the arm's pattern's bindings.

This only introduces a new scope for match arms with guards. Perf results (https://github.com/rust-lang/rust/pull/143376#issuecomment-3034922617) seemed to indicate there wasn't a significant hit to introduce a new scope on all match arms, but guard patterns (rust-lang/rust#129967) will likely benefit from only adding new scopes when necessary (with some patterns requiring multiple nested scopes).

Tracking issue for `if_let_guard`: rust-lang/rust#51114

Tests are adapted from examples by `@traviscross,` `@est31,` and myself on rust-lang/rust#141295.
2025-08-09 03:19:26 +00:00
bit-aloo
aad54a8ff4
invoke functions from methods 2025-08-09 08:41:16 +05:30
bit-aloo
621af4a580
add read_file_by_commit function and invoke from parse_inner 2025-08-09 07:53:56 +05:30
bit-aloo
2213b7a8f9
add ci_llvm_root function and invoke from parse_inner 2025-08-09 07:47:26 +05:30
bit-aloo
134fcc8c66
add git_info function and invoke from parse_inner 2025-08-09 07:31:55 +05:30
bit-aloo
7eb8f6001e
add is_system_llvm function and invoke from parse_inner 2025-08-09 07:23:05 +05:30