about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2025-08-18Rollup merge of #145451 - WaffleLapkin:norailoveyou, r=NoratriebStuart Cook-0/+1
Add static glibc to the nix dev shell This fixes `tests/ui/process/nofile-limit.rs` which fails to link on nixos for me without this change.
2025-08-18Rollup merge of #144838 - Kivooeo:doc-subtype, r=notriddleStuart Cook-4/+4
Fix outdated doc comment This updates the documentation comment for `Type::is_doc_subtype_of` to more accurately describe its purpose as a subtyping check, rather than equality fixes rust-lang/rust#138572 r? ````````````@tgross35````````````
2025-08-18Update rust maintainers in openharmony.mdhuaihuaidelulu-1/+1
2025-08-17Update cargoWeihang Lo-0/+0
2025-08-17Reorder `lto` options from most to least optimizingSamuel Moelius-1/+1
2025-08-17Add `-Zindirect-branch-cs-prefix` optionMiguel Ojeda-0/+19
This is intended to be used for Linux kernel RETPOLINE builds. Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2025-08-17Auto merge of #144081 - RalfJung:const-ptr-fragments, r=oli-obkbors-69/+104
const-eval: full support for pointer fragments This fixes https://github.com/rust-lang/const-eval/issues/72 and makes `swap_nonoverlapping` fully work in const-eval by enhancing per-byte provenance tracking with tracking of *which* of the bytes of the pointer this one is. Later, if we see all the same bytes in the exact same order, we can treat it like a whole pointer again without ever risking a leak of the data bytes (that encode the offset into the allocation). This lifts the limitation that was discussed quite a bit in https://github.com/rust-lang/rust/pull/137280. For a concrete piece of code that used to fail and now works properly consider this example doing a byte-for-byte memcpy in const without using intrinsics: ```rust use std::{mem::{self, MaybeUninit}, ptr}; type Byte = MaybeUninit<u8>; const unsafe fn memcpy(dst: *mut Byte, src: *const Byte, n: usize) { let mut i = 0; while i < n { *dst.add(i) = *src.add(i); i += 1; } } const _MEMCPY: () = unsafe { let ptr = &42; let mut ptr2 = ptr::null::<i32>(); // Copy from ptr to ptr2. memcpy(&mut ptr2 as *mut _ as *mut _, &ptr as *const _ as *const _, mem::size_of::<&i32>()); assert!(*ptr2 == 42); }; ``` What makes this code tricky is that pointers are "opaque blobs" in const-eval, we cannot just let people look at the individual bytes since *we don't know what those bytes look like* -- that depends on the absolute address the pointed-to object will be placed at. The code above "breaks apart" a pointer into individual bytes, and then puts them back together in the same order elsewhere. This PR implements the logic to properly track how those individual bytes relate to the original pointer, and to recognize when they are in the right order again. We still reject constants where the final value contains a not-fully-put-together pointer: I have no idea how one could construct an LLVM global where one byte is defined as "the 3rd byte of a pointer to that other global over there" -- and even if LLVM supports this somehow, we can leave implementing that to a future PR. It seems unlikely to me anyone would even want this, but who knows.^^ This also changes the behavior of Miri, by tracking the order of bytes with provenance and only considering a pointer to have valid provenance if all bytes are in the original order again. This is related to https://github.com/rust-lang/unsafe-code-guidelines/issues/558. It means one cannot implement XOR linked lists with strict provenance any more, which is however only of theoretical interest. Practically I am curious if anyone will show up with any code that Miri now complains about - that would be interesting data. Cc `@rust-lang/opsem`
2025-08-16tidy: add better error reporting for if typos can't be runbinarycat-1/+0
2025-08-16tidy: run typos check in src root, not current dirbinarycat-4/+17
2025-08-16tidy now installs typos-cli as-needed via cargobinarycat-28/+76
2025-08-16run spellcheck as a tidy extra check in cibinarycat-2/+2
2025-08-16Auto merge of #145304 - m-ou-se:simplify-panic, r=oli-obkbors-9/+1
Revert "Partially outline code inside the panic! macro". This reverts https://github.com/rust-lang/rust/pull/115670 Without any tests/benchmarks that show some improvement, it's hard to know whether the change had any positive effect. (And if it did, whether that effect is still achieved today.)
2025-08-16Only check std in cross-compilation instead of building itJakub Beránek-57/+153
2025-08-16Avoid copying rustc rmeta artifacts into the build compiler sysrootJakub Beránek-65/+189
This helps to avoid polluting the sysroot of the build compiler.
2025-08-16Optimize `copy_src_dirs`Jakub Beránek-39/+42
2025-08-16Do not call `fs::remove_file` in `cp_link_filtered_recurse`Jakub Beránek-1/+0
The target is removed by `copy_link` too, so no need to duplicate the syscall.
2025-08-15Rollup merge of #145455 - Kobzol:bootstrap-copy-src-dirs-dry-run, r=jieyouxuJacob Pratt-0/+6
Do not copy files in `copy_src_dirs` in dry run This reduces the time to run the current 9 dist snapshot tests from ~24s to ~2s on my PC. r? `@jieyouxu`
2025-08-15Rollup merge of #145454 - Kobzol:bootstrap-fix-step-debug-repr, r=jieyouxuJacob Pratt-3/+8
Fix tracing debug representation of steps without arguments in bootstrap I was wondering why I see `lainSourceTarbal` in tracing logs... r? `@jieyouxu`
2025-08-15Rollup merge of #145453 - Kobzol:bootstrap-cmd-span, r=jieyouxuJacob Pratt-3/+0
Remove duplicated tracing span in bootstrap `trace_cmd` is now called also in the `stream` method, so including it also here was duplicating command spans. r? `@jieyouxu`
2025-08-15rustdoc-search: search backend with partitioned suffix treeMichael Howell-4343/+8383
2025-08-15Extend `QueryStability` to handle `IntoIterator` implementationsSamuel Moelius-1/+1
Fix adjacent code Fix duplicate warning; merge test into `tests/ui-fulldeps/internal-lints` Use `rustc_middle::ty::FnSig::inputs` Address two review comments - https://github.com/rust-lang/rust/pull/139345#discussion_r2109006991 - https://github.com/rust-lang/rust/pull/139345#discussion_r2109058588 Use `Instance::try_resolve` Import `rustc_middle::ty::Ty` as `Ty` rather than `MiddleTy` Simplify predicate handling Add more `#[allow(rustc::potential_query_instability)]` following rebase Remove two `#[allow(rustc::potential_query_instability)]` following rebase Address review comment Update compiler/rustc_lint/src/internal.rs Co-authored-by: lcnr <rust@lcnr.de>
2025-08-15Demote x86_64-apple-darwin to Tier 2 with host toolsJake Goulding-32/+20
Switch to only using aarch64 runners (implying we are now cross-compiling) and stop running tests. In the future, we could enable (some?) tests via Rosetta 2.
2025-08-15Do not copy files in `copy_src_dirs` in dry runJakub Beránek-0/+6
2025-08-15Fix tracing debug representation of steps without arguments in bootstrapJakub Beránek-3/+8
2025-08-15Remove duplicated tracing span in bootstrapJakub Beránek-3/+0
2025-08-15Do not strip binaries in bootstrap everytime if they are unchangedJakub Beránek-1/+12
2025-08-15add static glibc to the nix dev shellWaffle Lapkin-0/+1
this fixes `tests/ui/process/nofile-limit.rs` which fails to link on nixos for me without this change
2025-08-15Rollup merge of #145431 - AMS21:fix_141531, r=jieyouxuJakub Beránek-3/+15
Enhance UI test output handling for runtime errors When a UI test runs a compiled binary and an error/forbid pattern check fails, the failure message previously only showed compiler output, hiding the executed programs stdout/stderr. This makes it harder to see near-miss or unexpected runtime lines. Fixed rust-lang/rust#141531 Supersedes rust-lang/rust#141977
2025-08-15Rollup merge of #145413 - joshtriplett:bootstrap-reduce-deps, r=clubby789Jakub Beránek-52/+24
bootstrap: Reduce dependencies Eliminate the `fd-lock` dependency by using the new native locking in std. Eliminate the `xattr` dependency by turning off a feature flag in `tar`, since the tarballs that we extract with bootstrap don't need it.
2025-08-15Rollup merge of #145408 - Kobzol:deduplicate-search-paths, r=petrochenkovJakub Beránek-2/+8
Deduplicate -L search paths For each -L passed to the compiler, we eagerly scan the whole directory. If it has a lot of files, that results in a lot of allocations. So it's needless to do this if some -L paths are actually duplicated (which can happen e.g. in the situation in the linked issue). This PR both deduplicates the args, and also teaches rustdoc not to pass duplicated args to merged doctests. Fixes: https://github.com/rust-lang/rust/issues/145375
2025-08-15Rollup merge of #145340 - Kobzol:bootstrap-codegen-backend-check-split, ↵Jakub Beránek-170/+91
r=jieyouxu Split codegen backend check step into two and don't run it with `x check compiler` This reduces the amount of work that is done during `x check compiler`. We still check both backends during `x check` by defaut, even if they are not in `rust.codegen-backends`, as just checking them shouldn't require expensive preparations, like building GCC. r? `@jieyouxu`
2025-08-15Rollup merge of #145311 - marcoieni:clean-disk-in-background-windows, r=KobzolJakub Beránek-1/+179
ci: clean windows disk space in background
2025-08-15Rollup merge of #145310 - Kobzol:compiler-for-revamp, r=jieyouxuJakub Beránek-90/+83
Reduce usage of `compiler_for` in bootstrap While working on refactoring/fixing `dist` steps, I realized that `build.full-bootstrap` does much more than it should, and that it its documentation is wrong. It seems that the main purpose of this option should be to enable/disable stdlib/compiler uplifting (https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Purpose.20of.20.60build.2Efull-bootstrap.60/with/533985624), but currently it also affects staging, or more precisely which compiler will be used to build selected steps, because this option is used in the cursed `compiler_for` function. I would like to change the option it so that it *only* affects uplifting, and doesn't affect stage selection, which I (partially) did in this PR. I removed the usage of `compiler_for` from the `Std` and `Rustc` steps, and explicitly implemented uplifting, without going through `compiler_for`. The only remaining usages of `compiler_for` are in dist steps (which I'm currently refactoring, will send a PR later) and test steps (which I will take a look at after dist). After that we can finally remove the function. I tried to document the case when uplifting was happening during cross-compilation, which was very implicit before. I also did a slight change in the uplifting logic for rustc when cross-compiling. Before, we would attempt to uplift a stage1 rustc, but that is not really a thing when cross-compiling. r? `@jieyouxu`
2025-08-15Use aarch64-apple-darwin as the fallback doc source for `-apple-`Jake Goulding-1/+1
We are moving away from `x86_64-apple-darwin`, so soon these docs won't be available.
2025-08-15Enhance UI test output handling for runtime errorsAMS21-3/+15
When a UI test runs a compiled binary and an error/forbid pattern check fails, the failure message previously only showed compiler output, hiding the executed programs stdout/stderr. This makes it harder to see near-miss or unexpected runtime lines.
2025-08-15Merge link_name and export_namebjorn3-1/+1
2025-08-15Remove usage of `compiler_for` from the `compile::Rustc` stepJakub Beránek-51/+43
2025-08-15Remove usage of `compiler_for` from the `compile::Std` stepJakub Beránek-28/+27
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-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-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-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.