34806 Commits

Author SHA1 Message Date
bors
0962555828 Auto merge of #141700 - RalfJung:atomic-intrinsics-part2, r=bjorn3
Atomic intrinsics : use const generic ordering, part 2

This completes what got started in https://github.com/rust-lang/rust/pull/141507 by using a const generic for the ordering for all intrinsics. It is based on that PR; only the last commit is new.

Blocked on:
- https://github.com/rust-lang/rust/pull/141507
- https://github.com/rust-lang/rust/pull/141687
- https://github.com/rust-lang/stdarch/pull/1811
- https://github.com/rust-lang/rust/pull/141964

r? `@bjorn3`
2025-06-08 20:17:28 +00:00
bors
2322ce4fd0 Auto merge of #142095 - joshtriplett:optimize-veccache, r=SparrowLii
Simplify and optimize `VecCache`'s `SlotIndex::from_index`

Simplify and optimize `SlotIndex::from_index`

Break out bucket 0 (containing `idx < 4096`) as an early return, which
simplifies the remainder of the function, and allows optimizing the
`checked_ilog2` since it can no longer return `None`.

This reduces the runtime of `vec_cache::tests::slot_index_exhaustive`
(which calls `SlotIndex::from_index` for every `u32`, twice) from ~15.5s
to ~13.3s.

Separately, simplify the test case as well. (The old and new code passes with
the old and new test case.)

---

Noticed because `slot_index_exhaustive` stood out as taking unusually long compared to other tests, so I started investigating what it was doing.
2025-06-08 15:26:49 +00:00
bors
f3d67558d7 Auto merge of #142088 - compiler-errors:perf-universal-stall, r=lcnr
Filter out universals and lifetimes from `stalled_vars`

lol

r? lcnr
2025-06-08 11:25:24 +00:00
bors
9a805525bf Auto merge of #142085 - compiler-errors:perf-self-obl, r=lcnr
Don't walk into `Certainty::Yes` goals

Don't walk into `Certainty::Yes` goals in the pending obligation finding code, since they will not have been stalled on an infer var anyways
2025-06-08 05:30:59 +00:00
bors
ff596225ec Auto merge of #142074 - oli-obk:its-finally-gone, r=petrochenkov
Remove CollectItemTypesVisitor

I always felt like we were very unnecessarily walking the HIR, let's see if perf agrees

There is lots to ~~improve~~ consolidate further here, as we still have 3 item wfchecks:

* check_item (matching on the hir::ItemKind)
    * actually doing trait solver based checks (by using HIR spans)
* lower_item (matching on the hir::ItemKind after loading it again??)
    * just ensure_ok-ing a bunch of queries
* check_item_type (matching on DefKind)
    * some type based checks, mostly ensure_ok-ing a bunch of queries

fixes rust-lang/rust#121429
2025-06-08 02:04:41 +00:00
bors
753ad2add3 Auto merge of #142181 - GuillaumeGomez:rollup-pn2p1lu, r=GuillaumeGomez
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#140560 (Allow `#![doc(test(attr(..)))]` everywhere)
 - rust-lang/rust#141447 (Document representation of `Option<unsafe fn()>`)
 - rust-lang/rust#141661 (Make the `dangerous_implicit_autorefs` lint deny-by-default)
 - rust-lang/rust#142065 (Stabilize `const_eq_ignore_ascii_case`)
 - rust-lang/rust#142116 (Fix bootstrap tracing imports)
 - rust-lang/rust#142126 (Treat normalizing consts like normalizing types in deeply normalize)
 - rust-lang/rust#142140 (compiler: Sort and doc ExternAbi variants)
 - rust-lang/rust#142148 (compiler: Treat ForceWarning as a Warning for diagnostic level)
 - rust-lang/rust#142154 (get rid of spurious cfg(bootstrap))

r? `@ghost`
`@rustbot` modify labels: rollup
2025-06-07 23:05:07 +00:00
Guillaume Gomez
299104e52e
Rollup merge of #142154 - RalfJung:no-more-cfg-bootstrap, r=oli-obk
get rid of spurious cfg(bootstrap)

r? ```@oli-obk```
2025-06-07 22:23:00 +02:00
Guillaume Gomez
99abdfc0d4
Rollup merge of #142148 - workingjubilee:dont-ice-on-force-warn, r=Urgau
compiler: Treat ForceWarning as a Warning for diagnostic level

This silences an ICE.

No idea if this is the correct solution though tbh.

Fixes rust-lang/rust#142144
2025-06-07 22:22:59 +02:00
Guillaume Gomez
c1ca2c1a0a
Rollup merge of #142140 - workingjubilee:sort-extern-abi-variants, r=bjorn3
compiler: Sort and doc ExternAbi variants

My personal brainworms found this ordering made the most sense while writing the CanonAbi PR.  It is *an* ordering, at least, unlike the current mess. There has been no particular reason for the previous order ever since rust-lang/rust#136901, despite the comment I delete here. I just didn't change it.

Because I feel weird just fussing with variant ordering in the source definition, I also documented a bunch to the best of my ability.
2025-06-07 22:22:59 +02:00
Guillaume Gomez
081d65dc6d
Rollup merge of #142126 - compiler-errors:normalize-uv-via-relate, r=BoxyUwU
Treat normalizing consts like normalizing types in deeply normalize

...so that we don't end up putting a top-level normalizes-to goal in the fulfillment context, which ICEs. This basically just models the normalize-const code off of the normalize-ty code above it, which uses an alias-relate goal instead.

Fixes rust-lang/rust#140571

r? lcnr
2025-06-07 22:22:58 +02:00
Guillaume Gomez
d021de4a9a
Rollup merge of #142116 - jieyouxu:fix-tracing, r=Mark-Simulacrum
Fix bootstrap tracing imports
2025-06-07 22:22:58 +02:00
Guillaume Gomez
42c62678fe
Rollup merge of #142065 - paolobarbolini:stabilize-const_eq_ignore_ascii_case, r=Mark-Simulacrum
Stabilize `const_eq_ignore_ascii_case`

Tracking issue: rust-lang/rust#131719
Closes rust-lang/rust#131719
FCP Completed: https://github.com/rust-lang/rust/issues/131719#issuecomment-2941829167
2025-06-07 22:22:57 +02:00
Guillaume Gomez
bfdb96ea07
Rollup merge of #141661 - Urgau:deny-dangerous_implicit_autorefs, r=traviscross
Make the `dangerous_implicit_autorefs` lint deny-by-default

I intended for the `dangerous_implicit_autorefs` lint to be deny-by-default, the [T-lang nomination comment](https://github.com/rust-lang/rust/pull/123239#issuecomment-2727551097) even clearly mentioned deny-by-default, but somehow I and other missed that it is only warn-by-default.

I think the lint should still be deny-by-default as the implicit aliasing requirements can be quite dangerous.

In any-case, opening this PR for T-lang awareness.

`@rustbot` label +I-lang-nominated +T-lang
r? `@traviscross`
2025-06-07 22:22:57 +02:00
Guillaume Gomez
8a4b23968d
Rollup merge of #141447 - y86-dev:option-layout-docs, r=RalfJung
Document representation of `Option<unsafe fn()>`

https://rust-lang.zulipchat.com/#narrow/channel/136281-t-opsem/topic/Option.20Layout.20with.20.60fn.60.20pointers/with/520055652
2025-06-07 22:22:56 +02:00
Guillaume Gomez
7c8ac0f4ef
Rollup merge of #140560 - Urgau:test_attr-module-level, r=GuillaumeGomez
Allow `#![doc(test(attr(..)))]` everywhere

This PR adds the ability to specify [`#![doc(test(attr(..)))]`](https://doc.rust-lang.org/nightly/rustdoc/write-documentation/the-doc-attribute.html#testattr) ~~at module level~~ everywhere in addition to allowing it at crate-root.

This is motivated by a recent PR #140323 (by ````@tgross35)```` where we have to duplicate 2 attributes to every single `f16` and `f128` doctests, by allowing `#![doc(test(attr(..)))]` at module level (and everywhere else) we can omit them entirely and just have (in both module):

```rust
#![doc(test(attr(feature(cfg_target_has_reliable_f16_f128))))]
#![doc(test(attr(expect(internal_features))))]
```

Those new attributes are appended to the one found at crate-root or at a previous module. Those "global" attributes are compatible with merged doctests (they already were before).

Given the small addition that this is, I'm proposing to insta-stabilize it, but I can feature-gate it if preferred.

Best reviewed commit by commit.

r? ````@GuillaumeGomez````
2025-06-07 22:22:55 +02:00
bors
4e1623e1ad Auto merge of #141950 - oli-obk:big-body-owner-loop, r=compiler-errors
Move coroutine_by_move_body_def_id into the big check_crate body owner loop

This avoids starting a parallel loop in sequence and instead runs all the queries for a specific DefId together.
2025-06-07 20:06:23 +00:00
bors
f7014ef76c Auto merge of #141964 - sayantn:update-stdarch, r=Amanieu
Update stdarch submodule

Updates the stdarch submodule.

## Merged PRs

 - rust-lang/stdarch#1797
 - rust-lang/stdarch#1758
 - rust-lang/stdarch#1798
 - rust-lang/stdarch#1811
 - rust-lang/stdarch#1810
 - rust-lang/stdarch#1807
 - rust-lang/stdarch#1806
 - rust-lang/stdarch#1812
 - rust-lang/stdarch#1795
 - rust-lang/stdarch#1796
 - rust-lang/stdarch#1813
 - rust-lang/stdarch#1816
 - rust-lang/stdarch#1818
 - rust-lang/stdarch#1820
 - rust-lang/stdarch#1819

r? `@Amanieu`
`@rustbot` label T-libs-api

Closes rust-lang/rust#111137
2025-06-07 12:25:59 +00:00
bors
4567c6063e Auto merge of #141917 - petrochenkov:nobinroot, r=jieyouxu
bootstrap: Remove `rustc_snapshot_libdir` from PATH in one more place

Same as https://github.com/rust-lang/rust/pull/141657 but in a different part of the build system, with the same goal of addressing [#t-infra/bootstrap > Build broken in MSYS2 @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Build.20broken.20in.20MSYS2/near/520709527).

It seems to work on windows-{gnu,msvc} and linux-gnu at least.

r? jieyouxu
2025-06-07 09:21:38 +00:00
bors
2965c2bac3 Auto merge of #141910 - Kobzol:new-bors-try-branch-name-doc, r=marcoieni
Fix `create-docs-artifacts.sh` with new bors

The slashes in the branch name (`automation/bors/try`) were causing issues for this script (https://github.com/rust-lang/rust/actions/runs/15391908130/job/43303193243).

r? `@marcoieni`

try-job: `mingw-check*`
2025-06-07 03:21:09 +00:00
bors
dbe094cca6 Auto merge of #141800 - workingjubilee:build-std-with-less-leaf-pointers, r=saethlin
bootstrap: build std sans leaf frame pointers

Sometimes leaf frame-pointers can impact LLVM inlining choices, and that can be a real problem for things like `mul_add`.
2025-06-06 21:21:59 +00:00
bors
4ed388a832 Auto merge of #141774 - oli-obk:naked-fn-queries, r=petrochenkov
Change per-module naked fn checks to happen during typeck instead

cc `@Lokathor` `@Amanieu` `@folkertdev`

just seems nicer this way
2025-06-06 18:22:10 +00:00
bors
e47eed0cd3 Auto merge of #141681 - compiler-errors:fast-path-stalled, r=lcnr
Fast path for stalled obligations on self ty

If we see that the `self` type of a goal is an infer var, then don't try to compute the goal at all, since we know that it'll be forced ambiguous.

This is currently only implemented when there are no opaques in the environment. We could extend it to check that the self type is not related to any already defined opaques via subtyping, but I'll leave that as a follow-up.

---

Also stall coerce and subtype predicates if both of their vars are not resolved to concrete types.

---

~~Also, we don't care if the goal is higher-ranked for the sized and copy/clone fast path.~~ pulling this out into another PR.

r? lcnr
2025-06-06 15:20:21 +00:00
bors
f7df7def7f Auto merge of #141272 - Shourya742:2025-05-18-modularize-config-module, r=Kobzol
modularize the config module bootstrap

Currently, our `config` module is quite large over 3,000 lines, and handles a wide range of responsibilities. This PR aims to break it down into smaller, more focused submodules to improve readability and maintainability:

* **`toml`**: Introduces a dedicated `toml` submodule within the `config` module. Its sole purpose is to define configuration-related structs along with their corresponding deserialization logic. It also contains the `parse_inner` method, which serves as the central function for extracting relevant information from the TOML structs and constructing the final configuration.

* **`rust`, `dist`, `install`, `llvm`, `build`, `gcc`, and others**: Each of these modules contains TOML subsections specific to their domain, along with the logic necessary to convert them into parts of the final configuration struct.

* **`config/mod.rs`**: Contains shared types and enums used across multiple TOML subsections.

* **`config/config.rs`**: Houses the logic that integrates all the TOML subsections into the complete configuration struct.

r? `@kobzol`
2025-06-06 04:32:56 +00:00
bors
707e3cea16 Auto merge of #140872 - bjorn3:elf_use_used_linker, r=nikic
Make #[used(linker)] the default on ELF too

`#[used]` currently is an alias for `#[used(linker)]` on all platforms except ELF based ones where it is an alias for `#[used(compiler)]`. The latter has surprising behavior and the LLVM LangRef explicitly states that it "should only be used in rare circumstances, and should not be exposed to source languages." [^2]

The reason `#[used]` still was an alias to `#[used(compiler)]` on ELF is because the gold linker has issues with it. Luckily gold has been deprecated with GCC 15 [^1] and seems to be unable to bootstrap rustc anyway [^3]. As such we shouldn't really care about supporting gold.

This would also allow re-enabling start-stop-gc with lld.

cc https://github.com/rust-lang/rust/issues/93798
Likely fixes https://github.com/rust-lang/rust/issues/85045

[^1]: https://lists.gnu.org/archive/html/info-gnu/2025-02/msg00001.html
[^2]: https://llvm.org/docs/LangRef.html#the-llvm-compiler-used-global-variable
[^3]: https://github.com/rust-lang/rust/issues/139425
2025-06-05 22:52:17 +00:00
bors
2d0b38e79e Auto merge of #138677 - shepmaster:consistent-elided-lifetime-syntax, r=traviscross,jieyouxu
Add a new `mismatched-lifetime-syntaxes` lint

The lang-team [discussed this](https://hackmd.io/nf4ZUYd7Rp6rq-1svJZSaQ) and I attempted to [summarize](https://github.com/rust-lang/rust/pull/120808#issuecomment-2701863833) their decision. The summary-of-the-summary is:

- Using two different kinds of syntax for elided lifetimes is confusing. In rare cases, it may even [lead to unsound code](https://github.com/rust-lang/rust/issues/48686)! Some examples:

    ```rust
    // Lint will warn about these
    fn(v: ContainsLifetime) -> ContainsLifetime<'_>;
    fn(&'static u8) -> &u8;
    ```

- Matching up references with no lifetime syntax, references with anonymous lifetime syntax, and paths with anonymous lifetime syntax is an exception to the simplest possible rule:

    ```rust
    // Lint will not warn about these
    fn(&u8) -> &'_ u8;
    fn(&'_ u8) -> &u8;
    fn(&u8) -> ContainsLifetime<'_>;
    ```

- Having a lint for consistent syntax of elided lifetimes will make the [future goal](https://github.com/rust-lang/rust/issues/91639) of warning-by-default for paths participating in elision much simpler.

---

This new lint attempts to accomplish the goal of enforcing consistent syntax. In the process, it supersedes and replaces the existing `elided-named-lifetimes` lint, which means it starts out life as warn-by-default.
2025-06-05 19:49:30 +00:00
Paolo Barbolini
69f077653a Stabilize const_eq_ignore_ascii_case 2025-06-05 07:09:16 +00:00
bors
d04f21f2b1 Auto merge of #140466 - amandasystems:move-to-preprocessing-step, r=lcnr
Move placeholder handling to a proper preprocessing step

This commit breaks out the logic of placheolder rewriting into its own preprocessing step. It's one of the more boring
parts of #130227.

The only functional change from this is that the preprocessing step (where extra `r: 'static` constraints are added) is performed upstream of Polonius legacy, finally affecting Polonius. That is mostly a by-product, though.

This should be reviewable by anyone in the compiler team, so
r? rust-lang/compiler
2025-06-05 05:27:41 +00:00
bors
2934249ba8 Auto merge of #141229 - tgross35:builtins-josh-subtree, r=Kobzol
Merge `compiler-builtins` as a Josh subtree

Use the Josh [1] utility to add `compiler-builtins` as a subtree, which
will allow us to stop using crates.io for updates. This is intended to
help resolve some problems when unstable features change and require
code changes in `compiler-builtins`, which sometimes gets trapped in a
bootstrap cycle.

This was done using `josh-filter` built from the r24.10.04 tag:

    git fetch https://github.com/rust-lang/compiler-builtins.git 233434412fe7eced8f1ddbfeddabef1d55e493bd
    josh-filter ":prefix=library/compiler-builtins" FETCH_HEAD
    git merge --allow-unrelated FILTERED_HEAD

The HEAD in the `compiler-builtins` repository is 233434412f ("fix an if
statement that can be collapsed").

[1]: https://github.com/josh-project/josh
2025-06-03 19:52:05 +00:00
bors
76cf3584c3 Auto merge of #141961 - matthiaskrgr:rollup-r09j2sp, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - rust-lang/rust#141724 (fix(rust-lang/rust#141141): When expanding `PartialEq`, check equality of scalar types first.)
 - rust-lang/rust#141833 (`tests/ui`: A New Order [2/N])
 - rust-lang/rust#141861 (Switch `x86_64-msvc-{1,2}` back to Windows Server 2025 images)
 - rust-lang/rust#141914 (redesign stage 0 std follow-ups)
 - rust-lang/rust#141918 (Deconstruct values in the THIR visitor)
 - rust-lang/rust#141923 (Update books)
 - rust-lang/rust#141931 (Deconstruct values in the THIR visitor)
 - rust-lang/rust#141956 (Remove two trait methods from cg_ssa)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-06-03 16:31:44 +00:00
bors
cdcca68936 Auto merge of #136942 - Kobzol:stage0-sccache, r=jieyouxu
Use ccache for stage0 tool builds

Now after the stage0 redesign, we can actually start ccaching the build of the compiler itself. We can also cache the bootstrap tools, since these are also built with the stage0 compiler.

Stage0 compiler builds are now being cached: https://github.com/rust-lang/rust/actions/runs/15397246267#summary-43321151192 (`..bootstrap::core::build_steps::compile::Rustc	483.10s	40.41s	-91.6%`). It's not a gigantic win everywhere, but it should help. It seems to make the Linux jobs ~10 minute faster. It should be especially useful on PR builds after https://github.com/rust-lang/rust/pull/141948.

r? `@jieyouxu`

try-job: `x86_64-gnu-llvm-19*`
try-job: `x86_64-msvc*`
try-job: `x86_64-apple*`
try-job: `dist-x86_64-linux`
2025-06-03 13:09:57 +00:00
bors
96ac9469b1 Auto merge of #141954 - matthiaskrgr:rollup-zptd6t9, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#141554 (Improve documentation for codegen options)
 - rust-lang/rust#141817 (rustc_llvm: add Windows system libs only when cross-compiling from Wi…)
 - rust-lang/rust#141843 (Add `visit_id` to ast `Visitor`)
 - rust-lang/rust#141881 (Subtree update of `rust-analyzer`)
 - rust-lang/rust#141898 ([rustdoc-json] Implement PartialOrd and Ord for rustdoc_types::Id)
 - rust-lang/rust#141921 (Disable f64 minimum/maximum tests for arm 32)
 - rust-lang/rust#141930 (Enable triagebot `[concern]` functionality)
 - rust-lang/rust#141936 (Decouple "reporting in deps" from `FutureIncompatibilityReason`)
 - rust-lang/rust#141949 (move `test-float-parse` tool into `src/tools` dir)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-06-03 09:51:59 +00:00
Matthias Krüger
77bbfd4195
Rollup merge of #141949 - onur-ozkan:move-test-float-parse, r=Kobzol
move `test-float-parse` tool into `src/tools` dir

Obviously `test-float-parse` is a tool like any other in `src/tools`.

cc `@tgross35`
2025-06-03 11:33:37 +02:00
Matthias Krüger
9711a3bd3c
Rollup merge of #141936 - WaffleLapkin:report-in-deps-decoupling, r=oli-obk
Decouple "reporting in deps" from `FutureIncompatibilityReason`

The reason should just be it -- the reason. It never felt right to me that it was also responsible for whatever we include the warning in cargo's reports.

It gets especially unruly if you want to add non-`FutureReleaseError*` warnings which are included in the reports.

I just added a field to `FutureIncompatibleInfo` to control whatever the diagnostic is included in the cargo's reports.
2025-06-03 11:33:36 +02:00
Matthias Krüger
37b8899231
Rollup merge of #141930 - Urgau:triagebot_concern, r=Kobzol
Enable triagebot `[concern]` functionality

Documentation at: https://forge.rust-lang.org/triagebot/concern.html
Example at: https://github.com/rust-lang/triagebot/pull/2024

r? Kobzol
2025-06-03 11:33:36 +02:00
Matthias Krüger
83d145cc77
Rollup merge of #141921 - ehuss:arm-min-max, r=tgross35
Disable f64 minimum/maximum tests for arm 32

This disables the f64 minimum/maximum tests for the arm-unknown-linux-gnueabihf job. The next release will be supporting cross-compiled doctests, and these tests fail on that platform.

It looks like this was just fixed via https://github.com/llvm/llvm-project/pull/142170, but I assume that will not trickle down to our copy of llvm in the next couple of weeks. Assuming that does get fixed when llvm is updated, then these can be removed.

cc https://github.com/rust-lang/rust/issues/141087
2025-06-03 11:33:35 +02:00
Matthias Krüger
1ebd724689
Rollup merge of #141898 - LukeMathWalker:patch-1, r=aDotInTheVoid
[rustdoc-json] Implement PartialOrd and Ord for rustdoc_types::Id

This allows consumers to create collections that required an ordering relationship for their keys—e.g. a `BTreeMap`.
2025-06-03 11:33:35 +02:00
Matthias Krüger
c029c2e8d8
Rollup merge of #141881 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer`

r? `@ghost`
2025-06-03 11:33:34 +02:00
bors
2ccdc409d4 Auto merge of #141210 - RalfJung:miri-std-doctests, r=saethlin
tools-aux ci runner: also cross-test doctests in Miri

Miri now supports running doctests across different targets. Let's use that to run the std doctests on aarch64-apple-darwin, i686-pc-windows-msvc.

try-job: x86_64-gnu-aux
2025-06-03 03:14:19 +00:00
bors
ec7153fad3 Auto merge of #141725 - nnethercote:avoid-UsePath-overcounting, r=BoxyUwU
Avoid over-counting of `UsePath` in the HIR stats.

Currently we over-count. Details in the individual commits.

r? `@BoxyUwU`
2025-06-01 04:21:50 +00:00
bors
1a2aef4465 Auto merge of #141685 - orlp:inplace-tls-drop, r=joboet
Do not move thread-locals before dropping

Fixes rust-lang/rust#140816. I also (potentially) improved the speed of `get_or_init` a bit by having an explicit hot/cold path.

We still move the value before dropping in the event of a recursive initialization (leading to double-initialization with one value being silently dropped). This is the old behavior, but changing this to panic instead would involve changing tests and also the other OS-specific `thread_local/os.rs` implementation, which is more than I'd like in this PR.
2025-05-31 14:56:33 +00:00
Lukas Wirth
2a388d1103
Merge pull request #19900 from Veykril/push-zurosouxqxzz
fix: Fix manual not containing diagnostics documentation
2025-06-02
2025-05-31 12:47:26 +00:00
Lukas Wirth
62bacfc37b fix: Fix manual not containing diagnostics documentation 2025-05-31 14:36:29 +02:00
Lukas Wirth
61f8a8b017
Merge pull request #19899 from SomeoneToIgnore/generate-actions
Account for `Generate` actions when filtering the allowed ones
2025-05-31 12:34:33 +00:00
Kirill Bulatov
4870b6b7c1 Account for Generate actions when filtering the allowed ones 2025-05-31 12:29:50 +03:00
bors
79a2af75f1 Auto merge of #141678 - Kobzol:revert-141516, r=workingjubilee
Revert "increase perf of charsearcher for single ascii characters"

This reverts commit 245bf503e2a948ac98170516d11df632e85a948b (PR https://github.com/rust-lang/rust/pull/141516).

It caused a large `doc` perf. regression in https://github.com/rust-lang/rust/pull/141605.
2025-05-31 08:11:06 +00:00
Lukas Wirth
cdd0ac27e3
Merge pull request #19898 from Veykril/push-ykumpuwmuvmu
refactor: Remove unncessary duplication in highlight_related
2025-05-31 05:35:49 +00:00
Lukas Wirth
9ee761904e refactor: Remove unncessary duplication in highlight_related 2025-05-31 07:25:03 +02:00
bors
24c859a875 Auto merge of #141667 - lqd:lazy-maybe-init, r=matthewjasper
Add fast path for maybe-initializedness in liveness

r? `@matthewjasper`

Correct me if I'm wrong Matthew, but my understanding is that
1. `MaybeInitializedPlaces` is currently eagerly computed, in `do_mir_borrowck`
2. but this data is only used in liveness
3. and `liveness::trace` actually only uses it for drop-liveness

This PR moves the computation to `liveness::trace` which looks to be its only use-site. We also add a fast path there, so that it's only computed by drop-liveness.

This is interesting because 1) liveness is only computed for relevant live locals, 2) drop-liveness is only computed for relevant live locals with >0 drop points; 0 is the common case from our benchmarks, as far as I can tell, so even just computing the entire data lazily helps.

It seems possible to also reduce the domain here, and speed up the analysis for the cases where it has to be computed -- so I've left a fixme for that, and may look into it soon.

(I've come upon this while doing implementation work for polonius, so don't be too enamored with possible wins: the goal is to reduce the eventual polonius overhead and make it more palatable 😓)
2025-05-31 04:52:37 +00:00
Lukas Wirth
987cd076e2
Merge pull request #19896 from Veykril/push-qyutrlxyznum
internal: Restructure some semantics APIs for virtual macro files
2025-05-30 20:15:15 +00:00
Lukas Wirth
38bf4b1fe1 internal: Restructure some semantics APIs for virtual macro files 2025-05-30 22:03:04 +02:00