Commit Graph

46272 Commits

Author SHA1 Message Date
David Tolnay
00d3fdce7c
Allow linking rustc and rustdoc against the same single tracing crate
By consecutively initializing `tracing` and `rustc_log`, Rustdoc assumes
that these involve 2 different tracing crates.

I would like to be able to build rustdoc against the same tracing crate
that rustc_log is also built against. Previously this arrangement would
crash rustdoc:

    thread 'main' panicked at rust/compiler/rustc_log/src/lib.rs:142:65:
    called `Result::unwrap()` on an `Err` value: SetGlobalDefaultError("a global default trace dispatcher has already been set")
    stack backtrace:
       0: rust_begin_unwind
       1: core::panicking::panic_fmt
       2: core::result::unwrap_failed
       3: rustc_log::init_logger
       4: rustc_driver_impl::init_logger
       5: rustdoc::main
    note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

    error: the compiler unexpectedly panicked. this is a bug.

    note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-rustdoc&template=ice.md

    note: please make sure that you have updated to the latest nightly

    query stack during panic:
    end of query stack
2025-05-03 10:18:50 -07:00
bors
d7df5bdf29 Auto merge of #140464 - oli-obk:successors-mut-perf, r=petrochenkov
Use a closure instead of three chained iterators

Fixes the perf regression from #123948

That PR had chained a third option to the iterator which apparently didn't optimize well
2025-05-03 10:43:38 +00:00
Matthias Krüger
185f9e0870
Rollup merge of #140606 - nnethercote:hir-pp, r=dtolnay
Improve hir pretty printing

It's currently pretty bad, so a few small improvements can make a big difference.

r? `@dtolnay`
2025-05-03 08:45:05 +02:00
Matthias Krüger
6cf4fd32bb
Rollup merge of #140548 - BoxyUwU:gci_patterns_user_ty_annotation, r=compiler-errors
Emit user type annotations for free consts in pattern position

This previously wasnt done because free consts couldn't have any generic parameters that need to be preserved for borrowck. This is no longer the case with `feature(generic_const_items)`

r? fmease
2025-05-03 08:45:03 +02:00
Matthias Krüger
9ff7455551
Rollup merge of #140534 - erickt:llvm-21, r=cuviper
PassWrapper: adapt for llvm/llvm-project@f137c3d592e96330e450a8fd63ef…

…7e8877fc1908

In LLVM 21 PR https://github.com/llvm/llvm-project/pull/130940 `TargetRegistry::createTargetMachine` was changed to take a `const Triple&` and has deprecated the old `StringRef` method.

``@rustbot`` label llvm-main
2025-05-03 08:45:02 +02:00
Matthias Krüger
ca67f4da76
Rollup merge of #140505 - petrochenkov:expquote, r=bjorn3
linker: Quote symbol names in .def files

To support weird symbol names, including dots in particular.

cc [#134767](https://github.com/rust-lang/rust/pull/134767#issuecomment-2839397610)
2025-05-03 08:45:02 +02:00
Nicholas Nethercote
9af08429f1 Avoid an indent for labelled loops. 2025-05-03 12:46:51 +10:00
Nicholas Nethercote
809e5b5ed1 Fix some hir pretty-printing over-indenting. 2025-05-03 12:46:51 +10:00
Nicholas Nethercote
e1a177bbba Improve hir pretty-printing of attributes. 2025-05-03 12:46:48 +10:00
bors
2ad5f8607d Auto merge of #140442 - osiewicz:collector-walk-less-fine-grained-locking, r=wesleywiser
mono collector: Reduce # of locking while walking the graph

While profiling Zed's dev build I've noticed that while most of the time `upstream_monomorphizations` takes a lot of time in monomorpization_collector, in some cases (e.g. build of `editor` itself) the rest of monomorphization_collector_graph_walk dominates it. Most of the time is spent in collect_items_rec.

This PR aims to reduce the number of locks taking place; instead of locking output MonoItems once per children of current node, we do so once per *current node*. We also get to reuse locks for mentioned and used items. While this commit does not reduce Wall time of Zed's build, it does shave off CPU time (measured with `cargo build -j1`) from 48s to 47s. I've also tested it with parallel frontend against Zed and ripgrep and found no regressions.
2025-05-03 00:24:14 +00:00
Nicholas Nethercote
aa7bb1c2f5 Enable BoxMarker drop checking.
All the box open/close issues have been fixed.
2025-05-03 09:14:27 +10:00
Nicholas Nethercote
760cf8d3af Fix hir pretty-printing of global_asm!.
One of the boxes isn't closed, and this causes everything after it to be
over-indented.
2025-05-03 09:14:27 +10:00
Nicholas Nethercote
3896ad0acd Remove opaque type printing.
As far as I can tell, this code is not actually reachable.
2025-05-03 09:14:00 +10:00
Nicholas Nethercote
882c74dfcf Remove fake BoxMarkers.
They don't appear to do anything -- no test output is affected -- and no
other pretty-printing code looks like this.
2025-05-03 09:13:28 +10:00
bors
2d5ffc513f Auto merge of #140596 - matthiaskrgr:rollup-s7tzr34, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #140485 (Optimize the codegen for `Span::from_expansion`)
 - #140509 (transmutability: merge contiguous runs with a common destination)
 - #140519 (Use select in projection lookup in `report_projection_error`)
 - #140521 (interpret: better error message for out-of-bounds pointer arithmetic and accesses)
 - #140536 (Rename `*Guard::try_map` to `filter_map`.)
 - #140550 (Stabilize `select_unpredictable`)
 - #140563 (extend the list of registered dylibs on `test::prepare_cargo_test`)
 - #140572 (Add useful comments on `ExprKind::If` variants.)
 - #140574 (Add regression test for 133065)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-05-02 20:59:24 +00:00
Matthias Krüger
bcf2490c64
Rollup merge of #140572 - nnethercote:comment-ExprKind-If, r=compiler-errors
Add useful comments on `ExprKind::If` variants.

Things that aren't obvious and took me a while to work out.

r? `@BoxyUwU`
2025-05-02 19:38:00 +02:00
Matthias Krüger
c796ef00f8
Rollup merge of #140521 - RalfJung:oob-error, r=saethlin
interpret: better error message for out-of-bounds pointer arithmetic and accesses

Fixes https://github.com/rust-lang/rust/issues/93881
r? `@saethlin`
2025-05-02 19:37:58 +02:00
Matthias Krüger
296733d5ac
Rollup merge of #140519 - compiler-errors:name-based-comparison, r=oli-obk
Use select in projection lookup in `report_projection_error`

Using `for_each_relevant_impl` doesn't actually select the correct impl; we can use `select` here to actually get the correct impl with certainty. Follow-up to https://github.com/rust-lang/rust/pull/140278.

r? oli-obk
2025-05-02 19:37:57 +02:00
Matthias Krüger
429341b445
Rollup merge of #140509 - tmiasko:merge-contiguous-ranges, r=jswrenn
transmutability: merge contiguous runs with a common destination

Based on #140380.

r? `@jswrenn` `@joshlf`
2025-05-02 19:37:56 +02:00
Matthias Krüger
a2ae171b97
Rollup merge of #140485 - Jarcho:from_expansion_opt, r=petrochenkov
Optimize the codegen for `Span::from_expansion`

See https://godbolt.org/z/bq65Y6bc4 for the difference. the new version is less than half the number of instructions.

Also tried fully writing the function by hand:
```rust
sp.ctxt_or_parent_or_marker != 0
        && (
            sp.len_with_tag_or_marker == BASE_LEN_INTERNED_MARKER
            || sp.len_with_tag_or_marker & PARENT_TAG == 0
        )
```

But that was no better than this PR's current use of `match_span_kind`.
2025-05-02 19:37:56 +02:00
bors
4824c2bb74 Auto merge of #140406 - Urgau:autorefs-perf, r=nnethercote
perf: delay checking of `#[rustc_no_implicit_autorefs]` in autoref lint

Try to address the regression seen in https://github.com/rust-lang/rust/pull/123239#issuecomment-2835418470 by delaying the checking of `#[rustc_no_implicit_autorefs]` on method call.
2025-05-02 17:35:50 +00:00
Vadim Petrochenkov
842858f765 linker: Quote symbol names in .def files
To support weird symbol names, including dots in particular.
2025-05-02 16:25:00 +03:00
Stuart Cook
19c9b763ba
Rollup merge of #140507 - a4lg:riscv-feature-addition-batch-3, r=Amanieu
rustc_target: RISC-V: feature addition batch 3

This is the last batch (3 of 3) for RISC-V feature enhancements intended for the version 1.88 cycle.

The author's primary criteria are:

1.  The extension is ratified and unprivileged one.
2.  The extension is in the RVA23U64 profile (to be a baseline of the application-class RISC-V software ecosystem in the near future), either mandatory or optional.
3.  Either:
    1.  To be discoverable through a `riscv_hwprobe` system call on (currently unreleased) Linux 6.15 (as of rc4) or
    2.  Helps memory/atomics-related operations more efficient and/or more robust.

This is based on the specifications:

*   [The latest ratified ISA Manuals (version 20240411)](https://lf-riscv.atlassian.net/wiki/spaces/HOME/pages/16154769/RISC-V+Technical+Specifications)
*   [RVA23/RVB23 profiles](https://github.com/riscv/riscv-profiles/releases/tag/rva23-rvb23-ratified)
*   [RISC-V BF16 extensions](https://github.com/riscv/riscv-bfloat16/releases/tag/v183a3dac863d7c18187a739eb52b0c8f0d16854d)

LLVM Definitions:

*   [`Zicbop`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L82-87)
*   [`Zicbom`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L75-L80)
*   [`Zic64b`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L71-L73)
*   [`Ziccamoa`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L97-L99)
*   [`Ziccif`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L101-L103)
*   [`Zicclsm`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L105-L107)
*   [`Ziccrse`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L109-L111)
*   [`Zfbfmin`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L320-L325)
*   [`Zvfbfmin`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L697-L702)
*   [`Zvfbfwma`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L704-L710)

The `Zicbop` extension (mandatory in RVA23U64) adds prefetch hints to prepare for subsequent memory operations (will be executed as no-op if the hardware does not support this extension).

The `Zicbom` extension (mandatory in RVA23U64) adds cache block-management instructions.  The author did not include this in the batch 2 (because of limited use cases compared to the `Zicboz` extension) but added because it will be discoverable from Linux (as of version 6.15-rc4).  Along with `Zicbop`, Rust now supports all CMO extensions.

The `Zic64b` extension (mandatory in RVA23U64) constraints the cache block to be naturally-aligned and exactly 64 bytes.  Along with CMO instructions, it can improve efficiency handling with memory (e.g. efficient memory zeroing using `Zicboz` + `Zic64b`).

The `Zicc*` extensions (mandatory in RVA23U64) add constraints to the main memory properties.  They are normally satisfied in the application environment with regular OSes but profiles like RVA23U64 ensures such properties are satisfied (through those *constraint* extensions).

The `Zfbf*` and `Zvfbf*` extensions (optional in RVA23U64) add instructions to handle BF16 (BFloat16) data.  Although stabilization of FP-related extensions are relatively far due to ABI-related issues, they are included in this batch because they will be discoverable from Linux (as of version 6.15-rc4).

The author also adds the extension implication: `Za64rs` → `Za128rs` (superset) which the author missed to include in #140139.
2025-05-02 22:17:03 +10:00
Stuart Cook
27d419a6b5
Rollup merge of #140389 - sayantn:avx512fp16, r=Amanieu
Remove `avx512dq` and `avx512vl` implication for `avx512fp16`

According to Intel, `avx512fp16` requires only `avx512bw`, but LLVM also enables `avx512vl` and `avx512dq` when `avx512fp16` is active. This is relic code, and will be fixed in LLVM soon. We should remove this from Rust too asap, especially before the stabilization of AVX512

Related:
 - llvm/llvm-project#136209
 - #138940
 - rust-lang/stdarch#1781
 - #111137

``@rustbot`` label O-x86_64 O-x86_32 A-SIMD A-target-feature T-compiler -T-libs
r? ``@Amanieu``

**Update: the LLVM fix has been merged**

cc ``@rust-lang/wg-llvm`` will it be possible to update the rustc llvm version to something after llvm/llvm-project#137450
2025-05-02 22:17:02 +10:00
Stuart Cook
c3f500ec4d
Rollup merge of #139046 - nnethercote:hir-Lifetime-better, r=lcnr
Improve `Lifetime::suggestion`

r? ``@lcnr``
2025-05-02 22:16:58 +10:00
Stuart Cook
b24288ba45
Rollup merge of #138872 - a4lg:riscv-fix-incompatible-abi-zfinx, r=workingjubilee
rustc_target: RISC-V `Zfinx` is incompatible with `{ILP32,LP64}[FD]` ABIs

Because RISC-V Calling Conventions note that:

> This means code targeting the `Zfinx` extension always uses the ILP32,  ILP32E or LP64 integer calling-convention only ABIs as there is no dedicated hardware floating-point register file.

`{ILP32,LP64}[FD]` ABIs with hardware floating-point calling conventions are incompatible with the `Zfinx` extension.

This commit adds `"zfinx"` to the incompatible feature list to those ABIs and tests whether trying to add `"zdinx"` (that is analogous to `"zfinx"` but in double-precision) on a LP64D ABI configuration results in an error (it also tests extension implication; `Zdinx` requires `Zfinx` extension).

Links: RISC-V psABI specification version 1.0
<https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/v1.0/riscv-cc.adoc#named-abis>
<https://github.com/riscv-non-isa/riscv-elf-psabi-doc/releases/tag/v1.0>
2025-05-02 22:16:58 +10:00
Stuart Cook
8619438574
Rollup merge of #137474 - VlaDexa:shebang-placement, r=wesleywiser
pretty-print: Print shebang at the top of the output

Shebang should stay at the top of the file, even after pretty-printing.

Closes #134643
2025-05-02 22:16:57 +10:00
Stuart Cook
96852e2494
Rollup merge of #134034 - bvanjoi:issue-131655, r=petrochenkov
handle paren in macro expand for let-init-else expr

Fixes #131655

This PR modifies the codegen logic of the macro expansion within `let-init-else` expression:
- Before: The expression `let xxx = (mac! {}) else {}` expands to `let xxx = (expanded_ast) else {}`.
- After: The same expression expands to `let xxx = expanded_ast else {}`.

An alternative solution to this issue could involve handling the source code directly when encountering unused parentheses in `let-init-else` expressions. However, this approach might be more cumbersome due to the absence of the necessary data structure.

r? `@petrochenkov`
2025-05-02 22:16:57 +10:00
Nicholas Nethercote
0ea204a5ff Add useful comments on ExprKind::If variants.
Things that aren't obvious and took me a while to work out.
2025-05-02 15:53:39 +10:00
Nicholas Nethercote
d42edee451 Handle Path<> better in error messages.
`Path<>` needs to be distinguished from `Path<T>`. This commit does
that, improving some error messages.
2025-05-02 08:26:39 +10:00
Guillaume Gomez
84ac890ef5
Rollup merge of #140552 - folkertdev:naked-function-rustc_std_internal_symbol, r=bjorn3
allow `#[rustc_std_internal_symbol]` in combination with `#[naked]`

The need for this came up in https://github.com/rust-lang/compiler-builtins/pull/897, but in general this seems useful and valid to allow.

Based on a quick scan, I don't think changes to the generated assembly are needed.

cc ``@bjorn3``
2025-05-01 22:27:25 +02:00
Guillaume Gomez
6cb75d88eb
Rollup merge of #140544 - m-ou-se:format-args-const-cleanup, r=fee1-dead
Clean up "const" situation in format_args!().

This cleans up the "const" situation in the format_args!() expansion/lowering.

Rather than marking the Argument::new_display etc. functions as non-const, this marks the Arguments::new_v1 functions as non-const.

Example expansion/lowering of format_args!() in const:

```rust
// Error: cannot call non-const formatting macro in constant functions
const {
    fmt::Arguments::new_v1( // Now the error is produced here.
        &["Hello, ", "!\n"],
        &[
            fmt::Argument::new_display(&world) // The error used to be produced here.
        ],
    )
}
```
2025-05-01 22:27:24 +02:00
Guillaume Gomez
9d7d782e50
Rollup merge of #140460 - heiher:issue-140455, r=Urgau
Fix handling of LoongArch target features not supported by LLVM 19

Fixes #140455
2025-05-01 22:27:23 +02:00
Guillaume Gomez
c02964f446
Rollup merge of #138703 - pudongair:master, r=workingjubilee
chore: remove redundant words in comment

remove redundant words in comment
2025-05-01 22:27:19 +02:00
Erick Tryzelaar
951412e2f3 PassWrapper: adapt for llvm/llvm-project@f137c3d592
In LLVM 21 PR https://github.com/llvm/llvm-project/pull/130940
`TargetRegistry::createTargetMachine` was changed to take a `const
Triple&` and has deprecated the old `StringRef` method.

@rustbot label llvm-main
2025-05-01 17:59:00 +00:00
bors
3350c1eb3f Auto merge of #139965 - amandasystems:marginally-improved-scc-annotations, r=lcnr
Decouple SCC annotations from SCCs

This rewires SCC annotations to have them be a separate, visitor-type data structure. It was broken out of #130227, which needed them to be able to remove unused annotations after computation without recomputing the SCCs themselves.

As a drive-by it also removes some redundant code from the hot loop in SCC construction for a performance improvement.

r? lcnr
2025-05-01 16:04:19 +00:00
Folkert de Vries
5d308148aa
allow #[rustc_std_internal_symbol] in combination with #[naked] 2025-05-01 16:26:26 +02:00
Boxy
bfe3d54d81 User type annotations for free consts in pattern position 2025-05-01 13:14:53 +01:00
bors
0e517d38ad Auto merge of #138522 - osiewicz:shared-generics-respect-visibility, r=bjorn3
shared-generics: Do not share instantiations that contain local-only types

In Zed shared-generics loading takes up a significant chunk of time in incremental build, as rustc deserializes rmeta of all dependencies of a crate. I've recently realized that shared-generics includes all instantiations of some_generic_function in the following snippet:
```rs
pub fn some_generic_function(_: impl Fn()) {}

pub fn non_generic_function() {
	some_generic_function(|| {});
	some_generic_function(|| {});
	some_generic_function(|| {});
	some_generic_function(|| {});
	some_generic_function(|| {});
	some_generic_function(|| {});
	some_generic_function(|| {});
}
```
even though none of these instantiations can actually be created from outside of `non_generic_function`. This is a dummy example, but we do rely on invoking callbacks with FnOnce a lot in our codebase.

This PR makes shared-generics account for visibilities of generic arguments; an item is only considered for exporting if it is reachable from the outside or if all of it's arguments are visible outside of the local crate.

This PR reduces incremental build time for Zed (touch editor.rs scenario) from 12.4s to 10.4s. I'd love to see a perf run if possible; per my checks this PR does not incur new instantiations in downstream crates, so if there'd be perf regressions, I'd expect them to come from newly-introduced visibility checks.
2025-05-01 11:57:11 +00:00
Mara Bos
36c6633b0f Clean up "const" situation in format_args!().
Rather than marking the Argument::new_display etc. functions as
non-const, this marks the Arguments::new_v1 functions as non-const.
2025-05-01 11:55:23 +02:00
Tsukasa OI
eec6cfb8da rustc_target: RISC-V "Zfinx" is incompatible with {ILP32,LP64}[FD] ABIs
Because RISC-V Calling Conventions note that:

> This means code targeting the Zfinx extension always uses the ILP32,
> ILP32E or LP64 integer calling-convention only ABIs as there is no
> dedicated hardware floating-point register file.

{ILP32,LP64}[FD] ABIs with hardware floating-point calling conventions
are incompatible with the "Zfinx" extension.

This commit adds "zfinx" to the incompatible feature list to those ABIs
and tests whether trying to add "zdinx" (that is analogous to "zfinx" but
in double-precision) on a LP64D ABI configuration results in an error
(it also tests extension implication; "Zdinx" requires "Zfinx" extension).

Link: RISC-V psABI specification version 1.0
<https://github.com/riscv-non-isa/riscv-elf-psabi-doc/releases/tag/v1.0>
2025-05-01 05:05:47 +00:00
bors
6e23095adf Auto merge of #140145 - Zoxc:job-server-proxy, r=SparrowLii
Add a jobserver proxy to ensure at least one token is always held

This adds a jobserver proxy to ensure at least one token is always held by `rustc`. Currently with `-Z threads` `rustc` can temporarily give up all its tokens, causing `cargo` to spawn additional `rustc` instances beyond the job limit.

The current behavior causes an issue with `cargo fix` which has a global lock preventing concurrent `rustc` instances, but it also holds a jobserver token, causing a deadlock when `rustc` gives up its token. That is fixed by this PR.

Fixes https://github.com/rust-lang/rust/issues/67385.
Fixes https://github.com/rust-lang/rust/issues/133873.
Fixes https://github.com/rust-lang/rust/issues/140093.
2025-05-01 04:11:52 +00:00
Tsukasa OI
501a539bbe rustc_target: RISC-V: Add BF16 extensions
This commit adds three ratified unprivileged RISC-V extensions related to
BFloat16 (BF16) handling.

Although that they are far from stabilization due to ABI issues, they are
optional extensions of the RVA23U64 profile (application-class processor
profile) and going to be discoverable from the Linux kernel
(as of version 6.15-rc4).

This commit mainly prepares runtime detection of those extensions.
2025-05-01 00:13:16 +00:00
Tsukasa OI
c6ed7869a1 rustc_target: RISC-V: Add atomics/memory-related extensions
This commit adds a part of RISC-V extensions that are mandatory part of
the RVA23U64 profile (application-class processor profile) and related to
memory/atomic constraints.

The Zic64b extension constrains the cache line to naturally-aligned 64 bytes
that would make certain memory operations (like zeroing the memory using
the Zicboz extension) easier.

The Zicbom and Zicbop extensions enable managing cache block-based
operations (the Zicbop contains hints that will work as a NOP when this
extension is absent and the Zicbom contains control instructions).

Of which, the Zicbom extension is going to be discoverable from the Linux
kernel (as of the version 6.15-rc4) and this commit prepares for
corresponding stdarch changes.

The Zicc* extensions add certain constraints to "the main memory" (usually
true on the user mode application on the application-class processor but
those extensions make sure such constraints exist).
2025-05-01 00:09:46 +00:00
Tsukasa OI
adb92aeb4a rustc_target: Adjust RISC-V feature implication (Za64rs and Za128rs)
The Za64rs extension (reservation set -- a primitive memory unit of LR/SC
atomic operations -- is naturally aligned and *at most* 64 bytes) is a
superset of the Za128rs extension (*at most* 128 bytes; note that smaller
the reservation set is, more fine grained control over atomics).

This commit handles this as a feature implication.
2025-05-01 00:09:45 +00:00
Sayantan Chakraborty
1157b78d62
Remove avx512dq and avx512vl implication for avx512fp16 2025-05-01 05:37:37 +05:30
bors
0c33fe2c3d Auto merge of #121909 - Zoxc:drop-ast-task, r=petrochenkov
Drop AST on a separate thread and prefetch `hir_crate`

This drop AST on a separate thread and prefetches `hir_crate`.

A `spawn` function is added to the `parallel` module which spawn some work on the Rayon thread pool.
2025-04-30 23:57:22 +00:00
Matthias Krüger
a477172ced
Rollup merge of #140494 - ehuss:document-restrictions, r=traviscross,SparrowLii
Parser: Document restrictions

I had trouble easily understanding what these various flags do. This is my attempt to try to explain what these do.
2025-04-30 22:36:44 +02:00
Matthias Krüger
6423d75076
Rollup merge of #140468 - BoxyUwU:normalization_confusings2, r=lcnr
Minor tweaks to make some normalization (adjacent) code less confusing

r? lcnr

sorry for double ping lol
2025-04-30 22:36:41 +02:00
Matthias Krüger
372b15e55e
Rollup merge of #140467 - BoxyUwU:no_fcw_assoc_consts, r=lcnr
Don't FCW assoc consts in patterns

Fixes #140447

See comment in added test. We could also check that the anon const is a const arg by looking at the HIR. I'm not sure that's necessary though 🤔 The only consts that are evaluated "for the type system" are const args (which *should* get FCWs) and const patterns (which cant be anon consts afaik).
2025-04-30 22:36:40 +02:00