summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-07-30Run `compiletest` self-tests against stage 1 rustcJieyou Xu-2/+2
And move `./x test compiletest --stage=1` to `pr-check-2`, where testing library artifacts already requires building the stage 1 compiler.
2025-07-30Deny `compiletest` self-tests being run against stage 0 rustc unless ↵Jieyou Xu-1/+18
explicitly allowed Otherwise, `compiletest` would have to know e.g. how to parse two different target spec, if target spec format was changed between beta `rustc` and in-tree `rustc`.
2025-07-30Update `codegen_{cranelift,gcc}` and `opt-dist` to use ↵Jieyou Xu-5/+7
`build.compiletest-allow-stage0`
2025-07-30Introduce proper `build.compiletest-allow-stage0` config optionJieyou Xu-6/+24
In favor of the adhoc `COMPILETEST_FORCE_STAGE0` env var.
2025-07-30Auto merge of #144673 - Zalathar:rollup-0kpeq3n, r=Zalatharbors-439/+730
Rollup of 6 pull requests Successful merges: - rust-lang/rust#144042 (Verify llvm-needs-components are not empty and match the --target value) - rust-lang/rust#144268 (Add method `find_ancestor_not_from_macro` and `find_ancestor_not_from_extern_macro` to supersede `find_oldest_ancestor_in_same_ctxt`) - rust-lang/rust#144411 (Remove `hello_world` directory) - rust-lang/rust#144662 (compiletest: Move directive names back into a separate file) - rust-lang/rust#144666 (Make sure to account for the right item universal regions in borrowck) - rust-lang/rust#144668 ([test][run-make] add needs-llvm-components) r? `@ghost` `@rustbot` modify labels: rollup
2025-07-30Rollup merge of #144668 - daltenty:daltenty/runmake-llvm-components, r=jieyouxuStuart Cook-0/+5
[test][run-make] add needs-llvm-components Add some constraints to run-make tests that require specific target support and will fail without them.
2025-07-30Rollup merge of #144666 - compiler-errors:correct-late, r=lqdStuart Cook-6/+97
Make sure to account for the right item universal regions in borrowck Fixes https://github.com/rust-lang/rust/issues/144608. The ICE comes from a mismatch between the liberated late bound regions (i.e. "`ReLateParam`"s) that come from promoting closure outlives, and the regions we have in our region vid mapping from `UniversalRegions`. When building `UniversalRegions`, we end up using the liberated regions from the binder of the closure's signature: https://github.com/rust-lang/rust/blob/c8bb4e8a126cf38cff70cea488a3a423a5321954/compiler/rustc_borrowck/src/universal_regions.rs#L521 Notably, this signature may be anonymized if the closure signature being deduced comes from an external constraints: https://github.com/rust-lang/rust/blob/c8bb4e8a126cf38cff70cea488a3a423a5321954/compiler/rustc_hir_typeck/src/closure.rs#L759-L762 This is true in the test file I committed, where the signature is influenced by the `impl FnMut(&mut ())` RPIT. However, when promoting a type outlives constraint we end up creating a late bound lifetime mapping that disagrees with those liberated late bound regions we constructed in `UniversalRegions`: https://github.com/rust-lang/rust/blob/c8bb4e8a126cf38cff70cea488a3a423a5321954/compiler/rustc_borrowck/src/universal_regions.rs#L299 Specifically, in `for_each_late_bound_region_in_item` (which is called by `for_each_late_bound_region_in_recursive_scope`), we were using `tcx.late_bound_vars` which uses the late bound regions *from the HIR*. This query both undercounts the late bound regions (e.g. those that end up being deduced from bounds), and also doesn't account for the fact that we anonymize them in the signature as mentioned above. https://github.com/rust-lang/rust/blob/c8bb4e8a126cf38cff70cea488a3a423a5321954/compiler/rustc_borrowck/src/universal_regions.rs#L977 This PR fixes that function to use the *correct signature*, which properly considers the bound vars that come from deducing the signature of the closure, and which comes from the closure's args from the `type_of` query.
2025-07-30Rollup merge of #144662 - Zalathar:directive-names, r=fmeaseStuart Cook-290/+293
compiletest: Move directive names back into a separate file This list no longer needs to be included in multiple crates, but having the list in its own file makes it easier to find and update when necessary. As discussed at https://github.com/rust-lang/rust/pull/143850#issuecomment-3130307023.
2025-07-30Rollup merge of #144411 - Kivooeo:remove-world, r=jieyouxuStuart Cook-4/+0
Remove `hello_world` directory Move `tests/ui/hello_world/main.rs` and retire the single-file `tests/ui/hello_world/` directory. Part of https://github.com/rust-lang/rust/issues/133895. r? `@jieyouxu`
2025-07-30Rollup merge of #144268 - xizheyin:find-oldest-ancestor, r=jieyouxuStuart Cook-42/+58
Add method `find_ancestor_not_from_macro` and `find_ancestor_not_from_extern_macro` to supersede `find_oldest_ancestor_in_same_ctxt` As I was using it, I realized that the function is supposed to walk up to expand the chain? This seems to be the opposite of what I understood. r? `@jieyouxu`
2025-07-30Rollup merge of #144042 - dpaoliello:verifyllvmcomp, r=jieyouxuStuart Cook-97/+277
Verify llvm-needs-components are not empty and match the --target value I recently discovered a test with an empty `llvm-needs-components` entry (fixed in rust-lang/rust#143979) which meant that it didn't work correctly when building Rust with a limited set of LLVM targets. This change makes a pair of improvements to prevent this issue from creeping in again: * When parsing directives with values, `compiletest` will now raise an error if there is an empty value. * Improved the `target_specific_tests` tidy checker to map targets to LLVM components, to verify that any existing `llvm-needs-components` contains the target being used. I also fixed all the issues flagged by the improved tidy checker.
2025-07-30Auto merge of #144305 - ChrisDenton:win-free-disk-space, r=marcoienibors-274/+316
Free disk space on Windows 2025 runners I've managed to reduce the time deletion takes by: - Using powershell, which is generally faster for filesystem operations than msys2 - Performing deletions concurrently then waiting for them all to complete It still takes 2-10 mins but that's not too bad.
2025-07-30[test][run-make] add needs-llvm-componentsDavid Tenty-0/+5
Add some constraints to run-make tests that require specific target support and will fail without them.
2025-07-30Free disk space on Windows 2025 runnersChris Denton-274/+316
2025-07-30Make sure to account for the right item universal regions in borrowckMichael Goulet-6/+97
2025-07-29Re-block SRoA on SIMD typesScott McMurray-1/+55
Fixes 144621
2025-07-30coverage: Re-land "Enlarge empty spans during MIR instrumentation"Zalathar-73/+57
This allows us to assume that coverage spans will only be discarded during codegen in very unusual situations.
2025-07-30Auto merge of #144577 - oli-obk:wrapping-niche, r=scottmcmbors-33/+342
Pick the largest niche even if the largest niche is wrapped around fixes rust-lang/rust#144388 r? `@scottmcm`
2025-07-30compiletest: Move directive names back into a separate fileZalathar-290/+293
This list no longer needs to be included in multiple crates, but having it in its own file makes it easier to find and update when necessary.
2025-07-29Auto merge of #144658 - jhpratt:rollup-jdzhz27, r=jhprattbors-54/+234
Rollup of 8 pull requests Successful merges: - rust-lang/rust#144034 (tests: Test line number in debuginfo for diverging function calls) - rust-lang/rust#144510 (Fix Ord, Eq and Hash implementation of panic::Location) - rust-lang/rust#144583 (Enable T-compiler backport nomination) - rust-lang/rust#144586 (Update wasi-sdk to 27.0 in CI) - rust-lang/rust#144605 (Resolve: cachify `ExternPreludeEntry.binding` through a `Cell`) - rust-lang/rust#144632 (Update some tests for LLVM 21) - rust-lang/rust#144639 (Update rustc-perf submodule) - rust-lang/rust#144640 (Add support for the m68k architecture in 'object_architecture') r? `@ghost` `@rustbot` modify labels: rollup
2025-07-29Rollup merge of #144640 - FractalFir:m68k_arch, r=UrgauJacob Pratt-0/+1
Add support for the m68k architecture in 'object_architecture' This is a tiny PR that adds the m68k architecture to `object_architecture`. This allows us to build rmeta files for that ISA(we use the object crate to pack metadata into object files).
2025-07-29Rollup merge of #144639 - Kobzol:x-perf-tui, r=lqdJacob Pratt-27/+24
Update rustc-perf submodule Mostly to include https://github.com/rust-lang/rustc-perf/pull/2204.
2025-07-29Rollup merge of #144632 - nikic:llvm-21-tests, r=durin42Jacob Pratt-8/+18
Update some tests for LLVM 21 Fixes https://github.com/rust-lang/rust/issues/144604. Fixes https://github.com/rust-lang/rust/issues/144606. r? `@durin42`
2025-07-29Rollup merge of #144605 - LorrensP-2158466:cache-extern-prelude, r=petrochenkovJacob Pratt-12/+11
Resolve: cachify `ExternPreludeEntry.binding` through a `Cell` Provides interior mutability to the `binding` field of `ExternPreludeEntry` as this field behaves like a cache. Per [zulip thread](https://rust-lang.zulipchat.com/#narrow/channel/421156-gsoc/topic/Project.3A.20Parallel.20Macro.20Expansion/near/531390914). A little preparatory work for batched import resolution, which is part of [#gsoc > Project: Parallel Macro Expansion](https://rust-lang.zulipchat.com/#narrow/channel/421156-gsoc/topic/Project.3A.20Parallel.20Macro.20Expansion). r? `@petrochenkov`
2025-07-29Rollup merge of #144586 - alexcrichton:update-weasi-sdk, r=Mark-SimulacrumJacob Pratt-4/+4
Update wasi-sdk to 27.0 in CI This updates the wasi-sdk used in CI to build release binaries and run CI with. No major motivation beyond keeping things up-to-date and following the development of wasi-sdk.
2025-07-29Rollup merge of #144583 - apiraino:enable-t-compiler-backport-nomination, ↵Jacob Pratt-0/+15
r=jieyouxu,Urgau Enable T-compiler backport nomination This patches the triagebot.toml so that it will trigger a backport label on pull requests fixing regressions. Applying a backport label will trigger creating a Zulip thread. For now the configuration only for `T-compiler` labeled regressions. Comments in the code explain how it works. Documentation [on the forge](https://forge.rust-lang.org/triagebot/backport.html). ``` [backport.foo] # The pull request MUST have one of these labels required_pr_labels = ["T-compiler"] # The regression MUST have this label required_issue_label = "regression-from-stable-to-beta" # if the above conditions matches, the PR will receive these labels add_labels = ["beta-nominated"] ``` Anything to think about before merging this? thanks for a review
2025-07-29Rollup merge of #144510 - orlp:fix-location-ord, r=ibraheemdevJacob Pratt-3/+123
Fix Ord, Eq and Hash implementation of panic::Location Fixes https://github.com/rust-lang/rust/issues/144486. Now properly compares/hashes the filename rather than the pointer to the string.
2025-07-29Rollup merge of #144034 - Enselic:diverging-function-call-debuginfo, ↵Jacob Pratt-0/+38
r=wesleywiser tests: Test line number in debuginfo for diverging function calls Closes rust-lang/rust#59558 which just [E-needs-test](https://github.com/rust-lang/rust/issues/59558#issuecomment-1322236891). The bug seems to have been fixed in **nightly-2021-05-10**: ```sh for toolchain in nightly-2021-05-09 \ nightly-2021-05-10 \ 1.88; do echo -e "\nWith $toolchain:" rustc +$toolchain tests/codegen/diverging-function-call-debuginfo.rs --emit llvm-ir -o /tmp/out.ll -g -Clto -Copt-level=0 build/x86_64-unknown-linux-gnu/ci-llvm/bin/FileCheck --input-file /tmp/out.ll tests/codegen/diverging-function-call-debuginfo.rs --check-prefix=CHECK --dump-input-context 10 2>/dev/null && echo OK || echo FAIL done ``` ``` With nightly-2021-05-09: FAIL With nightly-2021-05-10: OK With 1.88: OK ``` which gives the following list of candidate commits. Not clear which one it is exactly but it doesn't matter much since we can confirm that the test works. I have confirmed locally that with **nightly-2021-05-09** we get `line: 0` for the last call. <details> <summary>click to expand</summary> ``` $ git log ^881c1ac408d93bb7adaa3a51dabab9266e82eee8 ca82264ec7556a6011b9d3f1b2fd4c7cd0bc8ae2 --no-merges --oneline ``` f25aa5767f0 Remove unused `opt_span_warn` function ebbc9495755 Note why `Handler::fatal` is different from `Sesssion::fatal` 96509b48358 Make `Diagnostic::span_fatal` unconditionally raise an error e49f4471aae Remove some unnecessary uses of `struct_span_fatal` 955fdaea4a1 Rename `Parser::span_fatal_err` -> `Parser::span_err` 4b7c8b0b53c Add `#[track_caller]` to `FakeDefId::expect_real()` ba13225ba1e Remove `FakeDefId::expect_local()` 020d83d9f5f Enable `-W semicolon_in_expressions_from_macros` in bootstrap 1b928ff8f8b Update LLVM submodule c2b15a6b641 Support -C passes in NewPM 5519cbfe334 Don't force -O1 with ThinLTO 7c4989ab707 Drop -opt-bisect-limit=0 flag from test db140de8f29 Explicitly register GCOV profiling pass as well 5ecbe7fcf8b Explicitly register instrprof pass 0318883cd62 Make -Z new-llvm-pass-manager an Option<bool> 0367e24f944 Avoid predecessors having Drop impls </details>
2025-07-29Auto merge of #144393 - heiher:str-contains-lsx, r=tgross35bors-3/+16
LoongArch64 LSX fast-path for `str.contains(&str)` Benchmark results with LLVM 21 on LA664: ``` OLD: test bench_is_contained_in ... bench: 43.63 ns/iter (+/- 0.04) NEW: test bench_is_contained_in ... bench: 12.81 ns/iter (+/- 0.01) ```
2025-07-29Fix Ord, Eq and Hash implementation of panic::LocationOrson Peters-3/+123
Faster equality compare Add tests Add missing files for tests
2025-07-30remove hello world directoryKivooeo-4/+0
2025-07-29Verify llvm-needs-components are not empty and match the --target valueDaniel Paoliello-97/+277
2025-07-29Auto merge of #144557 - cjgillot:lower-more-span, r=compiler-errorsbors-16/+45
Complete span AST lowering. r? `@ghost`
2025-07-29tests: Test line number in debuginfo for diverging function callsMartin Nordholts-0/+38
2025-07-29Update wasi-sdk to 27.0 in CIAlex Crichton-4/+4
This updates the wasi-sdk used in CI to build release binaries and run CI with. No major motivation beyond keeping things up-to-date and following the development of wasi-sdk.
2025-07-29Remove no longer needed handling of nonstandard licensesJakub Beránek-19/+0
2025-07-29Update license exceptions for rustc-perfJakub Beránek-1/+1
2025-07-29Improve tidy error on dependency license exceptionsJakub Beránek-7/+23
2025-07-29Update rustc-perf submoduleJakub Beránek-0/+0
2025-07-29Reuse `sign_extend` helperOli Scherer-3/+3
2025-07-29Pick the largest niche even if the largest niche is wrapped aroundOli Scherer-35/+91
2025-07-29Auto merge of #144637 - Zalathar:rollup-t1yo1jy, r=Zalatharbors-226/+1100
Rollup of 6 pull requests Successful merges: - rust-lang/rust#144560 (coverage: Treat `#[automatically_derived]` as `#[coverage(off)]`) - rust-lang/rust#144566 (Simplify `align_of_val::<[T]>(…)` → `align_of::<T>()`) - rust-lang/rust#144587 (expand: Micro-optimize prelude injection) - rust-lang/rust#144589 (Account for `.yield` in illegal postfix operator message) - rust-lang/rust#144615 (Make resolve_fn_signature responsible for its own rib.) - rust-lang/rust#144634 (Fix typo in `DropGuard` doc) r? `@ghost` `@rustbot` modify labels: rollup
2025-07-29Rollup merge of #144634 - lucaswerkmeister:patch-1, r=lqdStuart Cook-1/+1
Fix typo in `DropGuard` doc Follows-up rust-lang/rust#144236 (I happened to see the typo yesterday but didn’t think it should delay the PR’s merge so I kept quiet, sorryyyyy).
2025-07-29Rollup merge of #144615 - cjgillot:fn-sig-rib, r=petrochenkovStuart Cook-75/+54
Make resolve_fn_signature responsible for its own rib. Small simplification in late resolver rib bookkeeping. r? `@petrochenkov`
2025-07-29Rollup merge of #144589 - compiler-errors:postfix-yield-after-cast, ↵Stuart Cook-1/+28
r=petrochenkov Account for `.yield` in illegal postfix operator message Fixes rust-lang/rust#144527
2025-07-29Rollup merge of #144587 - petrochenkov:optstdprel, r=nnethercoteStuart Cook-107/+105
expand: Micro-optimize prelude injection Use `splice` to avoid shifting the other items twice. Put `extern crate std;` first so it's already resolved when we resolve `::std::prelude::rust_20XX`.
2025-07-29Rollup merge of #144566 - scottmcm:align-of-slice, r=oli-obkStuart Cook-0/+516
Simplify `align_of_val::<[T]>(…)` → `align_of::<T>()` I spotted this while working on the inliner (rust-lang/rust#144561). In particular, if [`Layout::for_value`](https://doc.rust-lang.org/std/alloc/struct.Layout.html#method.for_value) inlines, then it can be pretty easy to end up with an `align_of_val::<[T]>` today (demo: <https://rust.godbolt.org/z/Tesnscj4a>) where we can save at least a block, if not more, by using the version that's an rvalue and not a call.
2025-07-29Rollup merge of #144560 - Zalathar:auto-derived, r=compiler-errorsStuart Cook-42/+396
coverage: Treat `#[automatically_derived]` as `#[coverage(off)]` One of the contributing factors behind https://github.com/rust-lang/rust/issues/141577#issuecomment-3120667286 was the presence of derive-macro-generated code containing nested closures. Coverage instrumentation already has a heuristic for skipping code marked with `#[automatically_derived]` (rust-lang/rust#120185), because derived code is usually not worth instrumenting, and also has a tendency to trigger vexing edge-case bugs in coverage instrumentation or coverage codegen. However, the existing heuristic only applied to the associated items directly within an auto-derived impl block, and had no effect on closures or nested items within those associated items. This PR therefore extends the search for `#[coverage(..)]` attributes to also treat `#[automatically_derived]` as an implied `#[coverage(off)]` for the purposes of coverage instrumentation. --- This change doesn’t rule out an entire category of bugs, because it only affects code that actually uses the auto-derived attribute. But it should reduce the overall chance of edge-case macro span bugs being observed in the wild.
2025-07-29"Cachify" `ExternPreludeEntry.binding` through a `Cell`.LorrensP-2158466-12/+11
2025-07-29LoongArch64 LSX fast-path for `str.contains(&str)`WANG Rui-3/+16
Benchmark results with LLVM 21 on LA664: ``` OLD: test bench_is_contained_in ... bench: 43.63 ns/iter (+/- 0.04) NEW: test bench_is_contained_in ... bench: 12.81 ns/iter (+/- 0.01) ```