about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2025-08-15Rename `compiler` to `build_compiler` in the `compile::Std` stepJakub Beránek-11/+13
2025-08-15Split codegen backend check step into two and don't run it with `x check ↵Jakub Beránek-170/+91
compiler`
2025-08-15Rollup merge of #145389 - GuillaumeGomez:unstable-search, r=fmeaseStuart Cook-40/+2
[rustdoc] Revert "rustdoc search: prefer stable items in search results" Reverts https://github.com/rust-lang/rust/pull/141658 and reverts https://github.com/rust-lang/rust/pull/145349. Reopens https://github.com/rust-lang/rust/issues/138067. r? ```@fmease```
2025-08-15Rollup merge of #145275 - StackOverflowExcept1on:fix-wasm32v1-none, ↵Stuart Cook-1/+1
r=alexcrichton fix(compiler/rustc_codegen_llvm): apply `target-cpu` attribute Resolves rust-lang/rust#140174 r? ```@alexcrichton``` try-job: `test-various*`
2025-08-15Rollup merge of #145189 - rust-lang:cargo_update, r=clubby789Stuart Cook-22/+22
Weekly `cargo update` Automation to keep dependencies in `Cargo.lock` current. r? dep-bumps The following is the output from `cargo update`: ```txt 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-15Add the directive `compare-output-by-lines`ywxt-1/+17
2025-08-15Rollup merge of #142640 - Sa4dUs:ad-intrinsic, r=ZuseZ4Stuart Cook-28/+0
Implement autodiff using intrinsics This PR aims to move autodiff logic to `autodiff` intrinsic. Allowing us to delete a great part of our frontend code and overall, simplify the compilation pipeline of autodiff functions.
2025-08-15Rollup merge of #122661 - estebank:assert-macro-span, r=petrochenkovStuart Cook-9/+16
Change the desugaring of `assert!` for better error output In the desugaring of `assert!`, we now expand to a `match` expression instead of `if !cond {..}`. The span of incorrect conditions will point only at the expression, and not the whole `assert!` invocation. ``` error[E0308]: mismatched types --> $DIR/issue-14091.rs:2:13 | LL | assert!(1,1); | ^ expected `bool`, found integer ``` We no longer mention the expression needing to implement the `Not` trait. ``` error[E0308]: mismatched types --> $DIR/issue-14091-2.rs:15:13 | LL | assert!(x, x); | ^ expected `bool`, found `BytePos` ``` Now `assert!(val)` desugars to: ```rust match val { true => {}, _ => $crate::panic::panic_2021!(), } ``` Fix #122159.
2025-08-15Merge ref '3507a749b365' from rust-lang/rustThe Miri Cronjob Bot-838/+1580
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: 3507a749b365aae4eefa96ab700a9315d3280ee7 Filtered ref: 67f9124a1e199effc310447c1c1f9548093bd8f9 This merge was created using https://github.com/rust-lang/josh-sync.
2025-08-15add commentjackh726-0/+7
2025-08-15Add test for webrender-2022 metricsjackh726-0/+32
2025-08-15Prepare for merging from rust-lang/rustThe Miri Cronjob Bot-1/+1
This updates the rust-version file to 3507a749b365aae4eefa96ab700a9315d3280ee7.
2025-08-14bootstrap: Remove dependency on xattrJosh Triplett-14/+3
Extracting the Rust tarballs doesn't require this.
2025-08-14bootstrap: Switch from fd-lock to native locking in stdJosh Triplett-38/+21
In the process, fix a race condition, by never truncating or writing to the file unless we currently hold the lock.
2025-08-15refactor: Add tests for case conversionsKarl Meakin-11/+41
2025-08-15refactor: `generate_tests`Karl Meakin-52/+45
Rewrite `generate_tests` to be more idiomatic.
2025-08-15refactor: rewrite `ranges_from_set`Karl Meakin-66/+17
The `merge_ranges` function was very complicated and hard to understand. Forunately, we can use `slice::chunk_by` to achieve the same thing.
2025-08-15refactor: Include size of case conversion tablesKarl Meakin-13/+35
Include the sizes of the `to_lowercase` and `to_uppercase` tables in the total size calculations.
2025-08-15refactor: Include table sizes in comment at top of `unicode_data.rs`Karl Meakin-11/+9
To make changes in table size obvious from git diffs
2025-08-14Merge pull request #20453 from jackh726/nts-part2Lukas Wirth-2/+9
Fix webrender-2022 metrics - shift vars when mapping dyn
2025-08-14Do not pass duplicated `-L` arguments to merged doctestsJakub Beránek-2/+8
2025-08-14Rollup merge of #145397 - lcnr:lcnr/rustc-dev-guide-3, r=BoxyUwUJakub Beránek-2/+2
Rust documentation, use `rustc-dev-guide` :3 reviving rust-lang/rust#145385 but on my own fork this time r? ``@BoxyUwU``
2025-08-14Rollup merge of #145379 - joshtriplett:bootstrap-timings, r=jieyouxuJakub Beránek-12/+47
bootstrap: Support passing `--timings` to cargo Useful for optimizing the sequencing of the compiler's own build.
2025-08-14Rollup merge of #145353 - CathalMullan:jemalloc-tools, r=KobzolJakub Beránek-0/+9
bootstrap: Fix jemalloc 64K page support for aarch64 tools Resolves rust-lang/rust#133748 The prior page size fix only targeted the compile build step, not the tools step: https://github.com/rust-lang/rust/pull/135081 Also note that since `miri` always uses jemalloc, I didn't copy the `builder.config.jemalloc(target)` check to the tools section. Tested by running `strings` on the compiled `miri` binary to see the LG_PAGE value. Before: ``` > strings miri | grep '^LG_PAGE' LG_PAGE 14 ``` After: ``` > strings miri | grep '^LG_PAGE' LG_PAGE 16 ``` May also need a separate fix for the standalone miri repository: https://github.com/rust-lang/miri/issues/4514 (likely a change needed in miri-script?)
2025-08-14Rollup merge of #145324 - Kobzol:bootstrap-host-only, r=jieyouxuJakub Beránek-119/+119
Rename and document `ONLY_HOSTS` in bootstrap Everytime I examined the `ONLY_HOSTS` flag of bootstrap steps, I was utterly confused. Why is it called ONLY_HOSTS? How does the fact that it is skipped if `--target` is passed, but `--host` is not (which was not accurate) help me? The reality of the flag is that if it is true, the targets for which the given Step will be built is determined based on the `--host` flag, while if it is false, it is determined based on the `--target` flag, that's pretty much it. The previous comment was just a (not very helpful and not even accurate) corollary of that. I clarified the comment, and also renamed the flag to `IS_HOST` (happy to brainstorm better names, but the doc. comment change is IMO the main improvement). r? ``@jieyouxu``
2025-08-14Rollup merge of #145261 - Kobzol:bootstrap-tracing, r=jieyouxuJakub Beránek-412/+560
Improve tracing in bootstrap I was annoyed that bootstrap had like 5 separate ways of debugging/tracing/profiling, and it was hard for me to understand how are individual steps executed. This PR tries to unify severla things behind `BOOTSTRAP_TRACING`, and improve tracing/profiling in general: - All generated tracing outputs are now stored in a single directory to make it easier to examine them, plus bootstrap prepares a `latest` symlink to the latest generated tracing output directory for convenience. - All executed spans are now logged automatically (without requiring usage of `#[tracing::instrument]`). - A custom span/event formatter was implemented, to provide domain-specific output (like location of executed commands or spans) and hopefully also to reduce visual clutter. - `tracing_forest` was removed. While it did some useful postprocessing, it didn't expose enough information for making the dynamic step spans work. - You can now explicitly log steps (`STEP=info`) and/or commands (`COMMAND=info`), to have more granular control over what gets logged. - `print-step-timings` also show when a step starts its execution (not just when it ends it), so that when some step fails in CI, we can actually see what step it was (before we would only see the end of the previous step). - The rustc-dev-guide page on debugging/profiling bootstrap was updated. There are still some things that work outside of tracing (`print-step-timings` and `dump-bootstrap-shims`), but I think that for now this improvement is good enough. I removed the `> step`, `< step` verbose output, because I found it unusable, as verbose bootstrap output also enables verbose Cargo output, and then you simply drown in too much data, and because I think that the new tracing system makes it obsolete (although it does require recompilation with the `tracing` feature). If you want to keep it, happy to revert 690c781475acb890f33d928186bdaea9ef179330. And the information about cached steps is now also shown in the Graphviz step dependency graph. We can modify the tracing output however we want, as we now implement it ourselves. Notably, we could also show exit logs for step spans, currently I only show enter spans. Maybe creating indents for each executed nested command is also not needed. Happy to hear feedback! Some further improvements could be to print step durations, if we decide to also log step exit events. We could also try to enable tracing in CI logs, but it might be too verbose. Best reviewed commit-by-commit. r? ``@jieyouxu`` CC ``@Shourya742``
2025-08-14feat: hint at unterminated strings in unknown prefix errorsRalf Anton Beier-1/+49
When encountering 'unknown literal prefix' errors, check for unbalanced quotes in recent code and suggest checking for unterminated string literals.
2025-08-14Complete functionality and general cleanupMarcelo Domínguez-28/+0
2025-08-14rustc-dev-guide :3lcnr-2/+2
2025-08-14Rename and document `ONLY_HOSTS` in bootstrapJakub Beránek-114/+119
2025-08-14Remove `ONLY_HOSTS` value overrides that just set the default value and had ↵Jakub Beránek-5/+0
no comment
2025-08-14Track diagnostic generations per packageLukas Wirth-24/+32
2025-08-14Revert "rustdoc search: prefer stable items in search results"Guillaume Gomez-37/+2
This reverts commit 1140e90074b0cbcfdea8535e4b51877e2838227e.
2025-08-14Revert "rustdoc: IndexItem::{stability -> is_unstable}"Guillaume Gomez-4/+9
This reverts commit 5e8ebd5ecd8546591a6707ac9e1a3b8a64c72f76.
2025-08-14Revert "rustdoc search: add performance note about searchIndexUnstable check"Guillaume Gomez-6/+0
This reverts commit fdbc8d08a63a3d34b7aebabb2f18a768462a98c4.
2025-08-14Revert "Correctly handle when there are no unstable items in the documented ↵Guillaume Gomez-3/+1
crate" This reverts commit cd79c7189db7b611f9199fd12ba56563afa18642.
2025-08-14ci: clean windows disk space in backgroundMarcoIeni-1/+179
2025-08-14Rollup merge of #145179 - joshtriplett:number, r=RalfJungGuillaume Gomez-2/+2
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-14Rollup merge of #144959 - Marcondiro:master, r=Mark-SimulacrumGuillaume Gomez-1/+1
fix(unicode-table-generator): fix duplicated unique indices unicode-table-generator panicked while populating `distinct_indices` because of duplicated indices. This was introduced in rust-lang/rust#144134, where the order of `canonical_words.push(...)` and `canonical_words.len()` was swapped. Fixes: rust-lang/rust#144134
2025-08-14Rollup merge of #144727 - Stypox:add-tracing-to-resolve, r=RalfJungGuillaume Gomez-0/+2
Add tracing to resolve-related functions Resolve-related functions are not called often but still make up for ~3% of execution time for non-repetitive programs (as seen in the first table below, obtained from running the rust snippet at the bottom with `n=1`). On the other hand, for repetitive programs they become less relevant (I tested the same snippet but with `n=100` and got ~1.5%), and it appears that only `try_resolve` is called more often (see the last two tables). The first table was obtained by opening the trace file in https://ui.perfetto.dev and running the following query: ```sql select "TOTAL PROGRAM DURATION" as name, count(*), max(ts + dur) as "sum(dur)", 100.0 as "%", null as "min(dur)", null as "max(dur)", null as "avg(dur)", null as "stddev(dur)" from slices union select "TOTAL OVER ALL SPANS (excluding events)" as name, count(*), sum(dur), cast(cast(sum(dur) as float) / (select max(ts + dur) from slices) * 1000 as int) / 10.0 as "%", min(dur), max(dur), cast(avg(dur) as int) as "avg(dur)", cast(sqrt(avg(dur*dur)-avg(dur)*avg(dur)) as int) as "stddev(dur)" from slices where parent_id is null and name != "frame" and name != "step" and dur > 0 union select name, count(*), sum(dur), cast(cast(sum(dur) as float) / (select max(ts + dur) from slices) * 1000 as int) / 10.0 as "%", min(dur), max(dur), cast(avg(dur) as int) as "avg(dur)", cast(sqrt(avg(dur*dur)-avg(dur)*avg(dur)) as int) as "stddev(dur)" from slices where parent_id is null and name != "frame" and name != "step" group by name order by sum(dur) desc, count(*) desc ``` <img width="1687" height="242" alt="image" src="https://github.com/user-attachments/assets/4d4bd890-869b-40f3-a473-8e4c42b02da4" /> The following two tables show how many `resolve` spans there per subname/subcategory, and how much time is spent in each. The first is for `n=1` and the second for `n=100`. The query that was used is: ```sql select args.string_value as name, count(*), max(dur), avg(dur), sum(dur) from slices inner join args USING (arg_set_id) where args.key = "args." || slices.name and name = "resolve" group by args.string_value ``` <img width="1688" height="159" alt="image" src="https://github.com/user-attachments/assets/a8749856-c099-492e-a86e-6d67b146af9c" /> <img width="1688" height="159" alt="image" src="https://github.com/user-attachments/assets/ce3ac1b5-5c06-47d9-85a6-9b921aea348e" /> The snippet I tested with Miri to obtain the above traces is: ```rust fn main() { let n: usize = std::env::args().nth(1).unwrap().parse().unwrap(); let mut v = (0..n).into_iter().collect::<Vec<_>>(); for i in &mut v { *i += 1; } } ```
2025-08-14Rollup merge of #142372 - Urgau:improve-remap_path_prefix-doc, r=wesleywiserGuillaume Gomez-14/+61
Improve `--remap-path-prefix` documentation This PR improves the `--remap-path-prefix` documentation by: - moving it into it's own page - adding a small example - mentioning that the remapping is best effort[^1] - mentioning `link.exe`/PDB issues[^2] - mentioning the path separator issue (textual replacement) r? ``@wesleywiser`` [^1]: [#t-compiler > link.exe leaking paths in Windows PDB @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/link.2Eexe.20leaking.20paths.20in.20Windows.20PDB/near/523343774) [^2]: [#t-compiler > link.exe leaking paths in Windows PDB @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/link.2Eexe.20leaking.20paths.20in.20Windows.20PDB/near/523331762)
2025-08-14Rollup merge of #140434 - a4lg:rustdoc-multi-footnote-refs, ↵Guillaume Gomez-9/+24
r=fmease,GuillaumeGomez rustdoc: Allow multiple references to a single footnote Multiple references to a single footnote is a part of GitHub Flavored Markdown syntax (although not explicitly documented as well as regular footnotes, it is implemented in GitHub's fork of CommonMark) and not prohibited by rustdoc. cf. <https://github.com/github/cmark-gfm/blob/587a12bb54d95ac37241377e6ddc93ea0e45439b/test/extensions.txt#L762-L780> However, using it makes multiple `sup` elements with the same `id` attribute, which is invalid per the HTML specification. Still, not only this is a valid GitHub Flavored Markdown syntax, this is helpful on certain cases and actually tested (accidentally) in `tests/rustdoc/footnote-reference-in-footnote-def.rs`. This commit keeps track of the number of references per footnote and gives unique ID to each reference. It also emits *all* back links from a footnote to its references as "↩" (return symbol) plus a numeric list in superscript. As a known limitation, it assumes that all references to a footnote are rendered (this is not always true if a dangling footnote has one or more references but considered a reasonable compromise). Also note that, this commit is designed so that no HTML changes will occur unless multiple references to a single footnote is actually used.
2025-08-14Merge pull request #20455 from A4-Tacks/fix-indent-conv-match-to-let-elseShoyu Vanilla (Flint)-6/+58
Fix indent for convert_match_to_let_else
2025-08-14Merge pull request #20456 from A4-Tacks/match-with-if-let-guardShoyu Vanilla (Flint)-12/+52
Add guard to let-chain for replace_match_with_if_let
2025-08-13bootstrap: Update completions for new --timings argumentJosh Triplett-4/+16
2025-08-13bootstrap: Support passing `--timings` to cargoJosh Triplett-8/+31
Useful for optimizing the sequencing of the compiler's own build.
2025-08-14rustdoc: Allow multiple references to a single footnoteTsukasa OI-9/+24
Multiple references to a single footnote is a part of GitHub Flavored Markdown syntax (although not explicitly documented as well as regular footnotes, it is implemented in GitHub's fork of CommonMark) and not prohibited by rustdoc. cf. <https://github.com/github/cmark-gfm/blob/587a12bb54d95ac37241377e6ddc93ea0e45439b/test/extensions.txt#L762-L780> However, using it makes multiple "sup" elements with the same "id" attribute, which is invalid per the HTML specification. Still, not only this is a valid GitHub Flavored Markdown syntax, this is helpful on certain cases and actually tested (accidentally) in tests/rustdoc/footnote-reference-in-footnote-def.rs. This commit keeps track of the number of references per footnote and gives unique ID to each reference. It also emits *all* back links from a footnote to its references as "↩" (return symbol) plus a numeric list in superscript. As a known limitation, it assumes that all references to a footnote are rendered (this is not always true if a dangling footnote has one or more references but considered a reasonable compromise). Also note that, this commit is designed so that no HTML changes will occur unless multiple references to a single footnote is actually used.
2025-08-14Auto merge of #145131 - Kobzol:bootstrap-clippy, r=jieyouxubors-144/+431
Enforce in bootstrap that clippy must have stage at least 1 This mostly piggybacks on the previous `x check` [rework](https://github.com/rust-lang/rust/pull/143048). The new "rules" follow the new staging logic. So `x clippy <foo>` lints `foo` using stage0 Clippy. `x clippy --stage 2 <foo>` lints `foo` using stage1 Clippy (which is built from in-tree sources). I had to fix some latent issues with `prepare_compiler_for_check` along the way. Checking `rustc_private` tools should now check less compiler crates (or rather not check compiler examples/tests/etc.), potentially speeding it up slightly. I also had to make some manual adjustments to `x clippy ci` so that it doesn't do needless work. r? `@jieyouxu`
2025-08-14Add guard to let-chain for replace_match_with_if_letA4-Tacks-12/+52
```rust fn main() { match$0 Some(0) { Some(n) if n % 2 == 0 && n != 6 => (), _ => code(), } } ``` -> ```rust fn main() { if let Some(n) = Some(0) && n % 2 == 0 && n != 6 { () } else { code() } }
2025-08-14Fix indent for convert_match_to_let_elseA4-Tacks-6/+58
Example --- ``` //- minicore: option fn f() { let x$0 = match Some(()) { Some(it) => it, None => {//comment println!("nope"); return }, }; } ``` **Old output**: ```rust fn f() { let Some(x) = Some(()) else {//comment println!("nope"); return }; } ``` **This PR output**: ```rust fn f() { let Some(x) = Some(()) else {//comment println!("nope"); return }; } ```