Commit Graph

4285 Commits

Author SHA1 Message Date
Tshepang Mbambo 1d82e1e8d3
Merge pull request #2477 from rust-lang/rustc-pull
Rustc pull update
2025-06-19 22:14:30 +02:00
The rustc-dev-guide Cronjob Bot 4f0329bb19 Merge from rustc 2025-06-19 04:07:39 +00:00
The rustc-dev-guide Cronjob Bot c6bbfe0945 Preparing for merge from rustc 2025-06-19 04:07:21 +00:00
Manuel Drehwald 4c6d66ccb0
Merge pull request #2447 from rust-lang/offload-docs
initial instructions for gpu offload
2025-06-18 17:24:36 -07:00
Manuel Drehwald 4233695fea initial instructions for gpu offload 2025-06-18 17:22:50 -07:00
bors 390d647aec Auto merge of #140772 - mati865:gnullvm-host, r=Kobzol
{aarch64,x86_64}-pc-windows-gnullvm: build host tools

This is a temporary single-release workflow to create stage0 for these targets.

I opted for bootstrapping from Linux because that's the easiest host system to work with, but once this hits beta, having dedicated Windows runners would be sensible and probably preferable.

`--enable-full-tools` for whatever reason doesn't seem to work when cross-compiling, because LLVM tools for the new hosts are not copied into the expected directory.

https://github.com/rust-lang/compiler-team/issues/877
2025-06-19 00:21:07 +00:00
Tshepang Mbambo 33eaf36815
Merge pull request #2476 from rust-lang/tshepang-patch-1
fix markup
2025-06-19 00:04:36 +02:00
Tshepang Mbambo 980acc5eee
fix markup
That was intended to be a list.

Also, the order is not relevant.
2025-06-19 00:03:33 +02:00
bors ad5bc327ff Auto merge of #142689 - Urgau:rollup-4ho6835, r=Urgau
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#135656 (Add `-Z hint-mostly-unused` to tell rustc that most of a crate will go unused)
 - rust-lang/rust#138237 (Get rid of `EscapeDebugInner`.)
 - rust-lang/rust#141614 (lint direct use of rustc_type_ir )
 - rust-lang/rust#142123 (Implement initial support for timing sections (`--json=timings`))
 - rust-lang/rust#142377 (Try unremapping compiler sources)
 - rust-lang/rust#142674 (remove duplicate crash test)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-06-18 21:19:39 +00:00
bors 00305f48f6 Auto merge of #142685 - Kobzol:rollup-8f3g8yf, r=Kobzol
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#140774 (Affirm `-Cforce-frame-pointers=off` does not override)
 - rust-lang/rust#141610 (Stabilize `feature(generic_arg_infer)`)
 - rust-lang/rust#142383 (CodeGen: rework Aggregate implemention for rvalue_creates_operand cases)
 - rust-lang/rust#142591 (Add spawn APIs for BootstrapCommand to support deferred command execution)
 - rust-lang/rust#142619 (apply clippy::or_fun_call)
 - rust-lang/rust#142624 (Actually take `--build` into account in bootstrap)
 - rust-lang/rust#142627 (Add `StepMetadata` to describe steps)
 - rust-lang/rust#142660 (remove joboet from review rotation)
 - rust-lang/rust#142666 (Skip tidy triagebot linkcheck if `triagebot.toml` doesn't exist)
 - rust-lang/rust#142672 (Clarify bootstrap tools description)
 - rust-lang/rust#142674 (remove duplicate crash test)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-06-18 17:57:27 +00:00
Urgau 462eba5845
Rollup merge of #142674 - hkBst:remove-duplicate-crashtest, r=bjorn3
remove duplicate crash test

I noticed near duplication between "library/alloctests/tests/testing/crash_test.rs" and "library/alloctests/testing/crash_test.rs" and wanted to try and remove that. The only difference is the path used to import `Debug`, but it seems not to matter. Perhaps my change is still wrong?

r? ```@bjorn3```
2025-06-18 19:40:33 +02:00
Urgau 2d5b852f0a
Rollup merge of #142377 - Urgau:unremap-rustc-dev, r=jieyouxu
Try unremapping compiler sources

See [#t-compiler/help > Span pointing to wrong file location (`rustc-dev` component)](https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/Span.20pointing.20to.20wrong.20file.20location.20.28.60rustc-dev.60.20component.29/with/521087083).

This PR is a follow-up to rust-lang/rust#141751 regarding the compiler side.

Specifically we now take into account the `CFG_VIRTUAL_RUSTC_DEV_SOURCE_BASE_DIR` env from rust-lang/rust#141751 when trying to unremap sources from `$sysroot/lib/rustlib/rustc-src/rust` (the `rustc-dev` component install directory).

Best reviewed commit by commit.

cc ``@samueltardieu``
r? ``@jieyouxu``
2025-06-18 19:40:32 +02:00
Urgau 42bdf697dd
Rollup merge of #135656 - joshtriplett:hint-mostly-unused, r=saethlin
Add `-Z hint-mostly-unused` to tell rustc that most of a crate will go unused

This hint allows the compiler to optimize its operation based on this assumption, in order to compile faster. This is a hint, and does not guarantee any particular behavior.

This option can substantially speed up compilation if applied to a large dependency where the majority of the dependency does not get used. This flag may slow down compilation in other cases.

Currently, this option makes the compiler defer as much code generation as possible from functions in the crate, until later crates invoke those functions. Functions that never get invoked will never have code generated for them. For instance, if a crate provides thousands of functions, but only a few of them will get called, this flag will result in the compiler only doing code generation for the called functions. (This uses the same mechanisms as cross-crate inlining of functions.) This does not affect `extern` functions, or functions marked as `#[inline(never)]`.

This option has already existed in nightly as `-Zcross-crate-inline-threshold=always` for some time, and has gotten testing in that form. However, this option is still unstable, to give an opportunity for wider testing in this form.

Some performance numbers, based on a crate with many dependencies having just *one* large dependency set to `-Z hint-mostly-unused` (using Cargo's `profile-rustflags` option):

A release build went from 4m07s to 2m04s.

A non-release build went from 2m26s to 1m28s.
2025-06-18 19:40:30 +02:00
Jakub Beránek e2ee7768b2
Rollup merge of #142674 - hkBst:remove-duplicate-crashtest, r=bjorn3
remove duplicate crash test

I noticed near duplication between "library/alloctests/tests/testing/crash_test.rs" and "library/alloctests/testing/crash_test.rs" and wanted to try and remove that. The only difference is the path used to import `Debug`, but it seems not to matter. Perhaps my change is still wrong?

r? ``@bjorn3``
2025-06-18 18:06:55 +02:00
Jakub Beránek a6e70820f5
Rollup merge of #142672 - Kobzol:bootstrap-tool-clarification, r=jieyouxu
Clarify bootstrap tools description

The existence of `stage0-bootstrap-tools` suggests the possiblity of `stage1/N-bootstrap-tools`, but that's not really a thing. Also it doesn't fit the new bootstrap model, where `stageN` essentially means that it was built with a `stageN-1` compiler (except for std).

r? ``@jieyouxu``
2025-06-18 18:06:54 +02:00
Jakub Beránek 9b8e0a94f6
Rollup merge of #142383 - scottmcm:operandref-builder, r=workingjubilee
CodeGen: rework Aggregate implemention for rvalue_creates_operand cases

A non-trivial refactor pulled out from rust-lang/rust#138759
r? workingjubilee

The previous implementation I'd written here based on `index_by_increasing_offset` is complicated to follow and difficult to extend to non-structs.

This changes the implementation, without actually changing any codegen (thus no test changes either), to be more like the existing `extract_field` (<2b0274c71d/compiler/rustc_codegen_ssa/src/mir/operand.rs (L345-L425)>) in that it allows setting a particular field directly.

Notably I've found this one much easier to get right, in particular because having the `OperandRef<Result<V, Scalar>>` gives a really useful thing to include in ICE messages if something did happen to go wrong.
2025-06-18 18:06:50 +02:00
Jakub Beránek 056796e5cf
Rollup merge of #141610 - BoxyUwU:stabilize_generic_arg_infer, r=lcnr,traviscross
Stabilize `feature(generic_arg_infer)`

Fixes rust-lang/rust#85077

r? lcnr

cc ````@rust-lang/project-const-generics````
2025-06-18 18:06:49 +02:00
Jakub Beránek bfbda22620
Rollup merge of #140774 - workingjubilee:should-force-frame-pointers-favor-the-target-or-cli, r=jieyouxu
Affirm `-Cforce-frame-pointers=off` does not override

This PR exists to document that we (that is, the compiler reviewer) implicitly made a decision in rust-lang/rust#86652 that defies the expectations of some programmers. Some programmers believe `-Cforce-frame-pointers=false` should obey the programmer in all cases, forcing the compiler to avoid generating frame pointers, even if the target specification would indicate they must be generated. However, many targets rely on frame pointers for fast or sound unwinding.

T-compiler had a weekly triage meeting on 2025-05-22. This topic was put to discussion because some programmers may expect the target-overriding behavior. In that meeting we decided removing frame pointers, at least with regards to the contract of the `-Cforce-frame-pointers` option, is not required, even if `=off` is passed, and that we will not do so if the target would expect them. This follows from the documentation here: https://doc.rust-lang.org/rustc/codegen-options/index.html#force-frame-pointers

We may separately pursue trying to clarify the situation more emphatically in our documentation, or warn when people pass the option when it doesn't do anything.
2025-06-18 18:06:48 +02:00
Boxy e0a39188f1
Merge pull request #2474 from BoxyUwU/ambig_unambig_ty_consts
Document Ambig vs Unambig Type/Consts
2025-06-18 15:30:14 +01:00
Boxy 9d7ba8573d Reviews 2025-06-18 15:28:44 +01:00
Jakub Beránek 79db838b7a
Fix compiletest and rustc-dev-guide 2025-06-18 15:07:36 +02:00
bors a99666e9bb Auto merge of #130887 - Soveu:repeatn, r=scottmcm
Safer implementation of RepeatN

I've seen the "Use MaybeUninit for RepeatN" commit while reading This Week In Rust and immediately thought about something I've written some time ago - https://github.com/Soveu/repeat_finite/blob/master/src/lib.rs.

Using the fact, that `Option` will find niche in `(T, NonZeroUsize)`, we can construct something that has the same size as `(T, usize)` while completely getting rid of `MaybeUninit`.
This leaves only `unsafe` on `TrustedLen`, which is pretty neat.
2025-06-18 03:18:10 +00:00
bors 9a3eea4b73 Auto merge of #142567 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer`

r? `@ghost`
2025-06-17 21:13:37 +00:00
Boxy c963b4ad93 Add links 2025-06-17 18:09:06 +01:00
Boxy a02af2f135 Write chapter on Unambig vs Ambig Types/Consts 2025-06-17 18:09:06 +01:00
Boxy 4185dca095 Stub chapter and consolidate under `/hir/` 2025-06-17 18:09:02 +01:00
nora a2c80e6e23
Merge pull request #2475 from lolbinarycat/patch-3
Profiling with perf: specify the section of bootstrap settings.
2025-06-17 18:34:03 +02:00
lolbinarycat 7b921990fc
Profiling with perf: specify the section of bootstrap settings. 2025-06-17 11:31:04 -05:00
bors c5d3c49bb0 Auto merge of #142447 - dianqk:llvm-20.1.7, r=nikic
Update to LLVM 20.1.7

Closes rust-lang/rust#141306, closes rust-lang/rust#140686, closes rust-lang/rust#141737, closes rust-lang/rust#140933.
2025-06-16 22:33:38 +00:00
Boxy 2078906630
Merge pull request #2472 from cbloodsworth/fix/tytable_parens
Remove hanging parenthesis from example signature.
2025-06-16 22:59:37 +01:00
Chris Bloodsworth ae0a09eae1 Remove hanging parenthesis from example signature.
Also replaced '→' symbol with '->' for consistency across the table.
2025-06-16 16:08:21 -04:00
nora 2c7a4bdb49
Merge pull request #2471 from Darksonn/patch-1
Use stage 1 for building docs
2025-06-16 19:45:23 +02:00
Alice Ryhl 38f01f117c
Use stage 1 for building docs 2025-06-16 17:03:33 +02:00
bors 86cafc0c5b Auto merge of #142471 - lqd:sparse-borrows, r=nnethercote
use `MixedBitSet` for borrows-in-scope dataflow analysis

The `Borrows` dataflow analysis uses a dense bitset, but a bitset supporting _some_ amount of sparseness is better suited for big functions with a big number of loans.

The cutoff between dense and chunked bitset is around 2K loans IIRC, and we could finesse that value if we wanted to, but as-is it happens to a couple of rustc-perf benchmarks (which IIRC are at least partially generated from macros and the likes.). It's a small win on these two, and shouldn't have any impact on the others.

r? `@matthewjasper`
2025-06-15 21:38:13 +00:00
bors 4f38eff5d0 Auto merge of #142455 - jdonszelmann:attempt-to-mitigate-delayed-lint-perf-problems, r=oli-obk
collect delayed lints in hir_crate_items

r? `@oli-obk`

Attempt to mitigate perf problems in rust-lang/rust#138164
2025-06-15 16:52:31 +00:00
Urgau cb503e8910 Un-remap `rustc-dev` component paths 2025-06-15 17:20:08 +02:00
bors 711044e627 Auto merge of #142430 - compiler-errors:external-constraints, r=lcnr
Don't fold `ExternalConstraintsData` when it's empty

Probably useless, but let's see.

r? lcnr
2025-06-15 12:55:05 +00:00
bors 0e92417173 Auto merge of #142398 - fee1-dead-contrib:push-ynxrtswtkyxw, r=oli-obk
early linting: avoid redundant calls to `check_id`

An attempt to address the regression at https://github.com/rust-lang/rust/pull/142240#issuecomment-2964425460

r? `@oli-obk`

cc `@nnethercote` who might have a better understanding of the performance implications
2025-06-15 09:17:15 +00:00
bors a91b757739 Auto merge of #142388 - cjgillot:span-hash, r=davidtwco
Do not clone Arc when hashing span.

Tiny improvement I was when trying to profile span hashing.
2025-06-15 05:27:08 +00:00
bors 1a2e5a0c30 Auto merge of #142355 - lcnr:fast_reject-reject, r=BoxyUwU
move fast reject into inner

to also fast reject inside of the folder

r? `@BoxyUwU`
2025-06-15 02:25:15 +00:00
bors d0d88f5903 Auto merge of #142335 - nnethercote:rustdoc-json-allocations, r=aDotInTheVoid
rustdoc_json: reduce allocations

These commits reduce the number of allocations done for rustdoc_json, mostly by avoiding unnecessary clones.

Best reviewed one commit at a time.

r? `@aDotInTheVoid`
2025-06-14 23:21:16 +00:00
Tshepang Mbambo 59756939d5
Merge pull request #2468 from rust-lang/query-cleaning
Query cleaning
2025-06-14 23:52:29 +02:00
Tshepang Mbambo 288ea6e730 do not inline links 2025-06-14 22:56:10 +02:00
Tshepang Mbambo 754e07e449 title case 2025-06-14 22:49:46 +02:00
Tshepang Mbambo 19766701f6
Merge pull request #2467 from rust-lang/tshepang-patch-1
use sentence case
2025-06-14 22:46:18 +02:00
Tshepang Mbambo 43cc7cb922
use sentence case 2025-06-14 22:44:47 +02:00
Tshepang Mbambo 5a82d2f82f
Merge pull request #2466 from rust-lang/tshepang-moved
content has moved to another chapter
2025-06-14 22:17:51 +02:00
Tshepang Mbambo febe3e6cab content has moved to another chapter 2025-06-14 22:16:51 +02:00
bors d7607dad2c Auto merge of #142289 - fmease:maybe-perf-gen-args, r=compiler-errors
[perf] `GenericArgs`-related: Change asserts to debug asserts & use more slice interning over iterable interning

1. The 1st commit yields the following perf gains: [#142289 (comment)](https://github.com/rust-lang/rust/pull/142289#issuecomment-2964041303).
2. The 2nd commit might also have a minor positive perf impact, however that one wasn't tested in isolation.

For reference, the initial approach c7e6accd79 (results: https://github.com/rust-lang/rust/pull/142289#issuecomment-2961076587) had a lot more changes (apart from what's now contained in commit 1 and 2) which seemed to be perf irrelevant (cf. the partial countercheck in 6f82bf1cfe (results: https://github.com/rust-lang/rust/pull/142289#issuecomment-2968393647).
2025-06-14 19:42:04 +00:00
Tshepang Mbambo 91ede12d31
Merge pull request #2465 from xizheyin/rustc-query
Adjust some doc for Query System
2025-06-14 21:39:25 +02:00