Commit Graph

321830 Commits

Author SHA1 Message Date
Apersoma d5b941d163 added float masks feature 2026-04-24 23:06:04 +00:00
bors 0312931d8c Auto merge of #154300 - JonathanBrouwer:rollup-MkFxTPv, r=JonathanBrouwer
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#153434 (Use a safe `BucketIndex` abstraction in `VecCache`)
 - rust-lang/rust#154133 (Defer codegen for the VaList Drop impl to actual uses)
 - rust-lang/rust#154297 (fix/extend some mir-opt comments)
 - rust-lang/rust#154299 (document some functions on AttributeExt)
2026-03-24 11:14:58 +00:00
Jonathan Brouwer 6f67067c6f Rollup merge of #154299 - jdonszelmann:document-attribute-ext, r=JonathanBrouwer
document some functions on AttributeExt

r? @jyn514
2026-03-24 10:54:05 +01:00
Jonathan Brouwer a5a286df89 Rollup merge of #154297 - RalfJung:mir-opt-comments, r=dianqk
fix/extend some mir-opt comments

Looks like CopyProp was refactored without updating that comment.

And for GVN, I think this is what you had in mind @cjgillot but would be great if you could have a look.
2026-03-24 10:54:04 +01:00
Jonathan Brouwer fad2a35ebf Rollup merge of #154133 - bjorn3:va_list_drop_defer_codegen, r=nnethercote
Defer codegen for the VaList Drop impl to actual uses

This allows compiling libcore with codegen backends that don't actually implement VaList like cg_clif.
2026-03-24 10:54:04 +01:00
Jonathan Brouwer f02eaf6ea5 Rollup merge of #153434 - Zalathar:bucket-index, r=nnethercote
Use a safe `BucketIndex` abstraction in `VecCache`

The current code for indexing into bucket arrays is quite tricky and unsafe, partly because it has to keep manually assuring the compiler that a bucket index is always less than 21.

By encapsulating that knowledge in a 21-value enum, we can make the code clearer and safer, without giving up performance.

Having a dedicated `BucketIndex` type could also help with further cleanups of `VecCache` indexing.
2026-03-24 10:54:03 +01:00
bjorn3 366cf883c7 Add comments 2026-03-24 10:01:46 +01:00
Jana Dönszelmann c87cd68568 document some functions on AttributeExt 2026-03-24 09:29:26 +01:00
bors cde9cf08d7 Auto merge of #151063 - sgasho:aarch64-dist-enzyme, r=ZuseZ4
Link LLVM dynamically on aarch64-apple-darwin



Follow-up to rust-lang/rust#152768.

* Link LLVM dynamically on MacOS
* Fix a macOS LLVM dylib name mismatch
2026-03-24 08:05:38 +00:00
Ralf Jung fb2b0031d0 GVN: add clarifying example to reference comment 2026-03-24 08:59:29 +01:00
Ralf Jung bd16cd4fb5 CopyProp: fix outdated comment 2026-03-24 08:12:17 +01:00
Zalathar fd3b22a836 Use a safe BucketIndex abstraction in VecCache
The current code for indexing into bucket arrays is quite tricky and unsafe,
partly because it has to keep manually assuring the compiler that a bucket
index is always less than 21.

By encapsulating that knowledge in a 21-value enum, we can make the code
clearer and safer, without giving up performance.

Having a dedicated `BucketIndex` type could also help with further cleanups of
`VecCache` indexing.
2026-03-24 17:52:09 +11:00
bors 9df83179a4 Auto merge of #154289 - jhpratt:rollup-JFDweJT, r=jhpratt
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#153964 (Fix `doc_cfg` not working as expected on trait impls)
 - rust-lang/rust#153979 (Rename various query cycle things.)
 - rust-lang/rust#154132 (Add missing num_internals feature gate to coretests/benches)
 - rust-lang/rust#154153 (core: Implement `unchecked_funnel_{shl,shr}`)
 - rust-lang/rust#154236 (Clean up query-forcing functions)
 - rust-lang/rust#154252 (Don't store current-session side effects in `OnDiskCache`)
 - rust-lang/rust#154017 ( Fix invalid add of duplicated call locations for the rustdoc scraped examples feature)
 - rust-lang/rust#154163 (enzyme submodule update)
 - rust-lang/rust#154264 (Update books)
 - rust-lang/rust#154282 (rustc-dev-guide subtree update)
2026-03-24 04:54:28 +00:00
Jacob Pratt 04975e4182 Rollup merge of #154282 - tshepang:rdg-sync, r=tshepang
rustc-dev-guide subtree update

Subtree update of `rustc-dev-guide` to https://github.com/rust-lang/rustc-dev-guide/commit/a9f3e8e687116a6e733bea8bd461c65861182f45.

Created using https://github.com/rust-lang/josh-sync.

r? @ghost
2026-03-23 23:42:53 -04:00
Jacob Pratt 3574d5748e Rollup merge of #154264 - rustbot:docs-update, r=ehuss
Update books

## rust-embedded/book

1 commits in e88aa4403b4bf2071c8df9509160477e40179099..2463edeb8003c5743918b3739a9f6870b86396f5
2026-03-11 17:49:58 UTC to 2026-03-11 17:49:58 UTC

- Update teaching material duration for bare-metal Rust (rust-embedded/book#409)

## rust-lang/reference

7 commits in c49e89cc8c7c2c43ca625a8d5b7ad9a53a9ce978..7446bf9697c95d155eef33c6a9d91fbd29a5e359
2026-03-18 01:46:01 UTC to 2026-03-10 18:10:22 UTC

- Update `must_use` to use the attribute template (rust-lang/reference#1892)
- Add a rule that enum discriminants may not use generic parameters (rust-lang/reference#2206)
- Actually move out of Box in moving-out-of-Box test (rust-lang/reference#2204)
- Add special cases and links relating to dereferencing boxes (rust-lang/reference#2075)
- Move shebang into its own subchapter (rust-lang/reference#2199)
- Fields of enums and unions should be allowed to overlap (rust-lang/reference#2168)
- [type layout] Clarify size and alignment of pointers to unsized types (rust-lang/reference#2201)
2026-03-23 23:42:52 -04:00
Jacob Pratt f098563a64 Rollup merge of #154163 - ZuseZ4:update-enzyme-march-21-2026, r=oli-obk
enzyme submodule update

Brings a bugfix for https://github.com/EnzymeAD/Enzyme/issues/2492, which had shown up in multiple independent Rust programs.

r? @oli-obk
2026-03-23 23:42:52 -04:00
Jacob Pratt 429c8d4ffb Rollup merge of #154017 - GuillaumeGomez:duplicated-locs-scraped, r=Urgau
Fix invalid add of duplicated call locations for the rustdoc scraped examples feature

Fixes rust-lang/rust#153837.

The bug was visible in the highlighting of the scrape examples code samples: the same part of the code was marked as "highlight" (by the scraped examples feature) twice, eventually leading to a wrong state of the HTML DOM status.

To fix the bug, I added a set to not re-add a location if it's already present.

r? @Urgau
2026-03-23 23:42:52 -04:00
Jacob Pratt 39343f53fd Rollup merge of #154252 - Zalathar:on-disk-cache, r=nnethercote
Don't store current-session side effects in `OnDiskCache`

This PR is a series of related cleanups to `OnDiskCache`, which is responsible for loading query return values (and side effects) that were serialized during the previous incremental-compilation session.

The primary change is to move the `current_side_effects` field out of OnDiskCache and into QuerySystem. That field was awkward because it was the only part of OnDiskCache state related to serializing the *current* compilation session, rather than loading values from the previous session.

The other commits should hopefully be straightforward.

r? nnethercote (or compiler)
2026-03-23 23:42:51 -04:00
Jacob Pratt efa7a5ea4a Rollup merge of #154236 - Zalathar:force-query, r=nnethercote
Clean up query-forcing functions

This PR takes the `force_query` function, inlines it into its only caller `force_from_dep_node_inner`, and renames the resulting function to `force_query_dep_node`. Combining the functions became possible after the removal of `rustc_query_system`, because they are now in the same crate.

There are two other notable cleanups along the way:

- Removing an unhelpful assertion and its verbose comment
  - The removed comment was originally added in https://github.com/rust-lang/rust/commit/0454a41, but is too verbose to be worth preserving inline.
- Removing a redundant cache lookup while forcing, as it is useless in the serial compiler and unnecessary (and probably unhelpful) in the parallel compiler

r? nnethercote
2026-03-23 23:42:51 -04:00
Jacob Pratt 04f63328d6 Rollup merge of #154153 - tgross35:funnel-unchecked, r=Mark-Simulacrum
core: Implement `unchecked_funnel_{shl,shr}`

These methods are just wrappers around the intrinsics.

Tracking issue: https://github.com/rust-lang/rust/issues/145686
2026-03-23 23:42:50 -04:00
Jacob Pratt 355b4f05ce Rollup merge of #154132 - bjorn3:fix_missing_feature_gate, r=Mark-Simulacrum
Add missing num_internals feature gate to coretests/benches

This will allow getting rid of the patch at https://github.com/rust-lang/rustc_codegen_cranelift/blob/main/patches/0030-sysroot_tests-Add-missing-feature-gate.patch
2026-03-23 23:42:50 -04:00
Jacob Pratt 1e2a7dcce4 Rollup merge of #153979 - nnethercote:rename-cycle-things, r=petrochenkov
Rename various query cycle things.

The existing names have bugged me for a while. Changes:

- `CycleError` -> `Cycle`. Because we normally use "error" for a `Diag` with `Level::Error`, and this type is just a precursor to that. Also, many existing locals of this type are already named `cycle`.

- `CycleError::cycle` -> `Cycle::frames`. Because it is a sequence of frames, and we want to avoid `Cycle::cycle` (and `cycle.cycle`).

- `cycle_error` -> `find_and_handle_cycle`. Because that's what it does. The existing name is just a non-descript noun phrase.

- `mk_cycle` -> `handle_cycle`. Because it doesn't make the cycle; the cycle is already made. It handles the cycle, which involves (a) creating the error, and (b) handling the error.

- `report_cycle` -> `create_cycle_error`. Because that's what it does: creates the cycle error (i.e. the `Diag`).

- `value_from_cycle_error` -> `handle_cycle_error_fn`. Because most cases don't produce a value, they just emit an error and quit. And the `_fn` suffix is for consistency with other vtable fns.

- `from_cycle_error` -> `handle_cycle_error`. A similar story for this module.

r? @petrochenkov
2026-03-23 23:42:49 -04:00
Jacob Pratt 8a2bd0fe2f Rollup merge of #153964 - GuillaumeGomez:fix-trait-impl-doc-cfg, r=lolbinarycat
Fix `doc_cfg` not working as expected on trait impls

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

I spent waaaaay too much time on this fix. So the current issue is that rustdoc gets its items in two passes:
1. All items
2. Trait/blanket/auto impls

Because of that, the trait impls are not stored "correctly" in the rustdoc AST, meaning that the `propagate_doc_cfg` pass doesn't work correctly on them. So initially, I tried to "clean" the impls at the same time as the other items. However, it created a monstruous amount of bugs and issues and after two days, I decided to give up on this approach (might be worth fixing that in the future!). You can see what I tried [here](https://github.com/rust-lang/rust/compare/main...GuillaumeGomez:trait-impls-doc_cfg?expand=1).

So instead, since the impls are stored at the end, I create placeholders for impls and in `propagate_doc_cfg`, I store the `cfg` "context" (more clear when reading the code 😛) and re-use it later on when the "real" impl comes up.

r? @lolbinarycat
2026-03-23 23:42:49 -04:00
Zalathar ee15154817 Remove an unhelpful assertion from try_load_query_value
This assertion makes the method body a lot messier, and seems very unlikely to
ever usefully fail.
2026-03-24 12:56:51 +11:00
Zalathar db19c0c3ee Inline TyCtxt::load_side_effect into its only caller 2026-03-24 12:56:51 +11:00
Zalathar afffa7d6e3 Don't store current-session side effects in OnDiskCache
Every other part of `OnDiskCache` deals with loading information from the
_previous_ session, except for this one field.

Moving it out to `QuerySystem` makes more sense, because that's also where
query return values are stored (inside the caches in their vtables).
2026-03-24 12:56:51 +11:00
Zalathar de15ab0065 Store value/side-effect index lists inside CacheEncoder
These lists can be considered part of the encoder state, and bundling them
inside the encoder is certainly more convenient than passing them around
separately.
2026-03-24 12:56:49 +11:00
bors 212b0d480f Auto merge of #154076 - nnethercote:DepNode-improvements, r=Zalathar
`DepNode` use improvements



We can simplify `DepNode` construction during query execution. Details in individual commits.

r? @Zalathar
2026-03-24 01:37:53 +00:00
Tshepang Mbambo 86319b6775 Merge pull request #2803 from rust-lang/tshepang/sembr
sembr a few files
2026-03-24 00:15:07 +01:00
Tshepang Mbambo 61d960f135 more area to click 2026-03-24 00:14:20 +01:00
Tshepang Mbambo d8d68baf4f sembr src/tests/ci.md 2026-03-24 00:14:20 +01:00
Tshepang Mbambo 7a18ffb7c4 improve parallel-rustc.md 2026-03-24 00:06:00 +01:00
Tshepang Mbambo 0ad2ede9b4 sembr src/parallel-rustc.md 2026-03-24 00:03:31 +01:00
Tshepang Mbambo 85e8310c08 improve early-late-parameters.md 2026-03-23 23:51:11 +01:00
Tshepang Mbambo a1e853f285 sembr src/early-late-parameters.md 2026-03-23 23:36:09 +01:00
Tshepang Mbambo c47c07e4f7 whitespace 2026-03-23 23:35:04 +01:00
bors 6f22f61305 Auto merge of #154273 - JonathanBrouwer:rollup-TJZsnIo, r=JonathanBrouwer
Rollup of 8 pull requests

Successful merges:

 - rust-lang/rust#122668 (Add APIs for dealing with titlecase)
 - rust-lang/rust#153041 (Remove `ATTRIBUTE_ORDER`)
 - rust-lang/rust#153912 (Avoid prematurely choosing a glob import)
 - rust-lang/rust#154093 (const validity checking: do not recurse to references inside MaybeDangling)
 - rust-lang/rust#154257 (Revert eagerly normalize in generalize)
 - rust-lang/rust#154179 (tests/ui/async-await/gat-is-send-across-await.rs: New regression test)
 - rust-lang/rust#154224 (Remove more `BuiltinLintDiag` variants)
 - rust-lang/rust#154245 (Allow applying autodiff macros to trait functions.)
2026-03-23 22:28:18 +00:00
Tshepang Mbambo 3ac4ceb5b8 sembr src/borrow-check/region-inference/member-constraints.md 2026-03-23 23:27:31 +01:00
Tshepang Mbambo d029d74b1c add date-check marker to recent section 2026-03-23 23:26:53 +01:00
Tshepang Mbambo 3b82679be0 avoid inline external links 2026-03-23 23:23:31 +01:00
Tshepang Mbambo 320d089578 improve solve/candidate-preference.md 2026-03-23 23:20:20 +01:00
Tshepang Mbambo b638ac4c3b sembr src/solve/candidate-preference.md 2026-03-23 23:07:32 +01:00
Tshepang Mbambo 0c3435c3e1 use the more standard column length 2026-03-23 23:05:39 +01:00
Tshepang Mbambo da645bd0f4 sembr src/diagnostics/lintstore.md 2026-03-23 22:58:53 +01:00
Nicholas Nethercote 3c7ee983eb Compute DepNode for incremental queries.
Prior to #154122 it wasn't used on all paths, so we only computed it
when necessary -- sometimes in `check_if_ensure_can_skip_execution`,
sometimes in one of two places in `execute_job_incr` -- and pass around
`Option<DepNode>` to allow this.

But now it's always used, so this commit makes us compute it earlier,
which simplifies things.
- `check_if_ensure_can_skip_execution` can be made simpler, returning a
  bool and eliminating the need for `EnsureCanSkip`.
- `execute_job_incr` no longer uses two slightly different methods to
  create a `DepNode` (`get_or_insert_with` vs `unwrap_or_else`).
2026-03-24 08:54:10 +11:00
Nicholas Nethercote 1e4b453670 Remove some dep-graph assertions.
The call chain for a non-incremental query includes the following
functions:

- execute_query_non_incr_inner (assert!)
- try_execute_query (assert!)
- execute_job_non_incr (assert!)

And likewise for an incremental query:

- execute_query_incr_inner (assert!)
- try_execute_query (assert!)
- execute_job_incr (expect)

That is five distinct functions. Every one of them has an `assert!` or
`expect` call that checks that the dep-graph is/is not enabled as
expected. Three cheers for defensive programming but this feels like
overkill, particularly when `execute_job{,_non_incr,_incr}` each have a
single call site.

This commit removes the assertions in `execute_query_*` and
`try_execute_query`, leaving a check in each of the `execute_job_*`
functions.
2026-03-24 08:48:50 +11:00
Nicholas Nethercote 90ea993083 Rename various query cycle things.
The existing names have bugged me for a while. Changes:

- `CycleError` -> `Cycle`. Because we normally use "error" for a `Diag`
  with `Level::Error`, and this type is just a precursor to that. Also,
  many existing locals of this type are already named `cycle`.

- `CycleError::cycle` -> `Cycle::frames`. Because it is a sequence of
  frames, and we want to avoid `Cycle::cycle` (and `cycle.cycle`).

- `cycle_error` -> `find_and_handle_cycle`. Because that's what it does.
  The existing name is just a non-descript noun phrase.

- `mk_cycle` -> `handle_cycle`. Because it doesn't make the cycle; the
  cycle is already made. It handles the cycle, which involves (a)
  creating the error, and (b) handling the error.

- `report_cycle` -> `create_cycle_error`. Because that's what it does:
  creates the cycle error (i.e. the `Diag`).

- `value_from_cycle_error` -> `handle_cycle_error_fn`. Because most
  cases don't produce a value, they just emit an error and quit.
  And the `_fn` suffix is for consistency with other vtable fns.

- `from_cycle_error` -> `handle_cycle_error`. A similar story for this
  module.
2026-03-24 08:47:34 +11:00
Eric Huss ae3d87c2a8 Update shebang reference names
This updates the rule names for shebang which were changed in
https://github.com/rust-lang/reference/pull/2192 and
https://github.com/rust-lang/reference/pull/2199.
2026-03-23 14:28:42 -07:00
Guillaume Gomez 19876d196f Simplify code and improve code comments 2026-03-23 21:47:29 +01:00
Guillaume Gomez 24e40f002c Add more comments to explain code 2026-03-23 21:25:46 +01:00