about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-07-24Auto merge of #144062 - bjorn3:lto_refactors2, r=davidtwcobors-331/+257
Various refactors to the LTO handling code (part 2) Continuing from https://github.com/rust-lang/rust/pull/143388 this removes a bit of dead code and moves the LTO symbol export calculation from individual backends to cg_ssa.
2025-07-24Auto merge of #144272 - petrochenkov:disambunder2, r=oli-obkbors-45/+62
resolve: Make disambiguators for underscore bindings module-local (take 2) The difference with https://github.com/rust-lang/rust/pull/144013 can be seen in the second commit. Now we just keep a separate disambiguator counter in every `Module`, instead of a global counter in `Resolver`. This will be ok for parallel import resolution because we'll need to lock the module anyway when updating `resolutions` and other fields in it. And for external modules the disabmiguator could be just passed as an argument to `define_extern`, without using any cells or locks, once https://github.com/rust-lang/rust/pull/143884 lands. Unblocks https://github.com/rust-lang/rust/pull/143884.
2025-07-24Auto merge of #116707 - cjgillot:slice-id, r=oli-obk,RalfJungbors-271/+628
Create an `AllocId` for `ConstValue::Slice`. This PR modifies `ConstValue::Slice` to use an `AllocId` instead of directly manipulating the allocation. This was originally proposed by https://github.com/rust-lang/rust/pull/115764 but was a perf regression. Almost 2 years later, enough code has changed to make this a perf improvement: https://github.com/rust-lang/rust/pull/116707#issuecomment-3067158777
2025-07-23Remove const deduplication from the interpreter.Camille GILLOT-85/+10
2025-07-23Remove useless lifetime parameter.Camille GILLOT-86/+59
2025-07-23Give an AllocId to ConstValue::Slice.Camille GILLOT-132/+591
2025-07-23Auto merge of #144244 - jieyouxu:pr-full-ci, r=Kobzolbors-34/+352
Enforce that PR CI jobs are a subset of Auto CI jobs modulo carve-outs ### Background Currently, it is possible for a PR with red PR-only CI to pass Auto CI, then all subsequent PR CI runs will be red until that is fixed, even in completely unrelated PRs. For instance, this happened with PR-CI-only Spellcheck (rust-lang/rust#144183). See more discussions at [#t-infra > Spellcheck workflow now fails on all PRs (tree bad?)](https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/Spellcheck.20workflow.20now.20fails.20on.20all.20PRs.20.28tree.20bad.3F.29/with/529769404). ### CI invariant: PR CI jobs are a subset of Auto CI jobs modulo carve-outs To prevent red PR CI in completely unrelated subsequent PRs and PR CI runs, we need to maintain an invariant that **PR CI jobs are a subset of Auto CI jobs modulo carve-outs**. This is **not** a "strict" subset relationship: some jobs necessarily have to differ under PR CI and Auto CI environments, at least in the current setup. Still, we can try to enforce a weaker "subset modulo carve-outs" relationship between CI jobs and their corresponding Auto jobs. For instance: - `x86_64-gnu-tools` will have `auto`-only env vars like `DEPLOY_TOOLSTATES_JSON: toolstates-linux.json`. - `tidy` will want to `continue_on_error: true` in PR CI to allow for more "useful" compilation errors to also be reported, whereas it should be `continue_on_error: false` in Auto CI to prevent wasting Auto CI resources. The **carve-outs** are: 1. `env` variables. 2. `continue_on_error`. We enforce this invariant through `citool`, so only affects job definitions that are handled by `citool`. Notably, this is not sufficient *alone* to address the CI-only Spellcheck issue (rust-lang/rust#144183). To carry out this enforcement, we modify `citool` to auto-register PR jobs as Auto jobs with `continue_on_error` overridden to `false` **unless** there's an overriding Auto job for the PR job of the same name that only differs by the permitted **carve-outs**. ### Addressing the Spellcheck PR-only CI issue Note that Spellcheck currently does not go through `citool` or `bootstrap`, and is its own GitHub Actions workflow. To actually address the PR-CI-only Spellcheck issue (rust-lang/rust#144183), and carry out the subset-modulo-carve-outs enforcement universally, this PR additionally **removes the current Spellcheck implementation** (a separate GitHub Actions Workflow). That is incompatible with Homu unless we do some hacks in the main CI workflow. This effectively partially reverts rust-lang/rust#134006 (the separate workflow part, not the tidy extra checks component), but is not prejudice against relanding the `typos`-based spellcheck in another implementation that goes through the usual bootstrap CI workflow so that it does work with Homu. The `typos`-based spellcheck seems to have a good false-positive rate. Closes rust-lang/rust#144183. --- r? infra-ci
2025-07-23Auto merge of #144233 - cjgillot:unsat-mir, r=oli-obkbors-51/+95
Consider parent predicates in ImpossiblePredicates pass. This pass is double edged. It avoids some ICEs (yay!) but also degrades diagnostics from constant evaluation. Fixes rust-lang/rust#121363 Fixes rust-lang/rust#131507 Fixes rust-lang/rust#140100 Fixes rust-lang/rust#140365
2025-07-23Auto merge of #144360 - matthiaskrgr:rollup-b6ej0mm, r=matthiaskrgrbors-1428/+221
Rollup of 9 pull requests Successful merges: - rust-lang/rust#144173 (Remove tidy checks for `tests/ui/issues/`) - rust-lang/rust#144234 (Fix broken TLS destructors on 32-bit win7) - rust-lang/rust#144239 (Clean `rustc/parse/src/lexer` to improve maintainability) - rust-lang/rust#144256 (Don't ICE on non-TypeId metadata within TypeId) - rust-lang/rust#144290 (update tests/ui/SUMMARY.md) - rust-lang/rust#144292 (mbe: Use concrete type for `get_unused_rule`) - rust-lang/rust#144298 (coverage: Enlarge empty spans during MIR instrumentation, not codegen) - rust-lang/rust#144311 (Add powerpc64le-unknown-linux-musl to CI rustc targets) - rust-lang/rust#144315 (bootstrap: add package.json and package-lock.json to dist tarball) r? `@ghost` `@rustbot` modify labels: rollup
2025-07-23Rollup merge of #144315 - lolbinarycat:bootstrap-dist-package.json, r=KobzolMatthias Krüger-0/+2
bootstrap: add package.json and package-lock.json to dist tarball this ensures that js-related tests can still be run from within such a dist tarball. followup to rust-lang/rust#142924 r? ```````@Kobzol```````
2025-07-23Rollup merge of #144311 - Gelbpunkt:ci-rustc-ppc64le-musl, r=KobzolMatthias Krüger-0/+1
Add powerpc64le-unknown-linux-musl to CI rustc targets I missed this in the promotion to tier 2 with host tools.
2025-07-23Rollup merge of #144298 - Zalathar:empty-span, r=wesleywiserMatthias Krüger-46/+57
coverage: Enlarge empty spans during MIR instrumentation, not codegen This re-lands the part of rust-lang/rust#140847 that was (hopefully) not responsible for the coverage-instrumentation regressions that caused that PR to be reverted. --- Enlarging empty spans was historically performed during MIR instrumentation, but had to be moved to codegen as part of larger changes in rust-lang/rust#134497, leading to the status quo. But now there should be no reason not to move that step back to its more logical home in instrumentaion.
2025-07-23Rollup merge of #144292 - ↵Matthias Krüger-16/+20
joshtriplett:mbe-use-concrete-type-for-get-unused-rule, r=petrochenkov mbe: Use concrete type for `get_unused_rule` Rather than adding `get_unused_rule` to the `TTMacroExpander` trait, put it on the concrete `MacroRulesMacroExpander`, and downcast to that type via `Any` in order to call it. Suggested-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com> r? ```````@petrochenkov```````
2025-07-23Rollup merge of #144290 - makai410:summary-ups, r=jieyouxuMatthias Krüger-2/+2
update tests/ui/SUMMARY.md follow-up of rust-lang/rust#143985 . r? ```````@jieyouxu```````
2025-07-23Rollup merge of #144256 - oli-obk:type-id-ice, r=RalfJungMatthias Krüger-1/+32
Don't ICE on non-TypeId metadata within TypeId fixes rust-lang/rust#144253 r? ``````````@RalfJung``````````
2025-07-23Rollup merge of #144239 - xizheyin:clean-lexer, r=fee1-deadMatthias Krüger-85/+83
Clean `rustc/parse/src/lexer` to improve maintainability This PR refactors the lexer code to improve maintainability and eliminate code duplication. In the first commit, I improve the error handling: - rename `make_unclosed_delims_error` to more appropriate `make_mismatched_closing_delims_errors` - changes return type from Option<Diag> to `Vec<Diag>` to avoid lengthy vec processing at `lex_token_trees` - use `splice` instead of `extend` to make the logic clearer, since `errs` sounds more generic and better suited as a return value In the second commit, I replace the magic number 5 with UNCLOSED_DELIMITER_SHOW_LIMIT constant. In the third commit, I moves `eof_err` function below parsing logic for better code flow. In the forth one, I extract `calculate_spacing` function to eliminate duplicate spacing logic between `bump` and `bump_minimal` functions. r? compiler
2025-07-23Rollup merge of #144234 - roblabla:fix-win7-tls-dtors, r=ChrisDentonMatthias Krüger-3/+14
Fix broken TLS destructors on 32-bit win7 Fixes rust-lang/rust#141300 On the 32-bit win7 target, we use OS TLS instead of native TLS, due to issues with how the OS handles alignment. Unfortunately, this caused issues due to the TLS destructors not running, causing memory leaks among other problems. On Windows, to support OS TLS, the TlsAlloc family of function is used by Rust. This function does not support TLS destructors at all. However, rust has some code to emulate those destructors, by leveraging the TLS support functionality found in the MSVC CRT (specifically, in tlssup.c of the CRT). To use this functionality, the user must do two things: 1. They must put the address to their callback in a section between `.CRT$XLB` and `.CRT$XLY`. 2. They must add a reference to `_tls_used` (or `__tls_used` on x86) to make sure the TLS support code in tlssup.c isn't garbage collected by the linker. Prior to this commit, this second bit wasn't being done properly by the Rust TLS support code. Instead of adding a reference to _tls_used, it instead had a reference to its own callback to prevent it from getting GC'd by the linker. While this is _also_ necessary, not having a reference on _tls_used made the entire support non-functional. This commit reworks the code to: 1. Add an unconditional `#[used]` attribute on the CALLBACK, which should be enough to prevent it from getting GC'd by the linker. 2. Add a reference to `_tls_used`, which should pull the TLS support code into the Rust programs and not let it be GC'd by the linker.
2025-07-23Rollup merge of #144173 - Kivooeo:tidy_checks, r=jieyouxuMatthias Krüger-1275/+10
Remove tidy checks for `tests/ui/issues/` r? ``````````@jieyouxu`````````` As it is making cleanup efforts more difficult. This change was discussed here [#t-compiler > Discussion for ui test suite improvements @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Discussion.20for.20ui.20test.20suite.20improvements/near/529566433)
2025-07-23Auto merge of #143843 - JonathanBrouwer:macro-use-parser, r=oli-obkbors-150/+480
Ports `#[macro_use]` and `#[macro_escape]` to the new attribute parsing infrastructure Ports `#[macro_use]` and `#[macro_escape]` to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971351163 r? `@jdonszelmann` `@oli-obk`
2025-07-23resolve: Change the underscore disambiguator to avoid regressionsVadim Petrochenkov-1/+5
2025-07-23resolve: Make disambiguators for underscore bindings module-localVadim Petrochenkov-45/+58
2025-07-23Update uitest stderrsJonathan Brouwer-85/+274
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-07-23Ports `#[macro_use]` and `#[macro_escape]` to the new attribute parsing ↵Jonathan Brouwer-65/+206
infrastructure
2025-07-23Auto merge of #143412 - Kobzol:std-detect-in-stdlib, r=Amanieubors-817/+377
Move `std_detect` into stdlib This PR moves the `std_detect` crate from `stdarch` to be a part of rust-lang/rust instead. The first commit actually moves the whole directory from the stdarch Josh subtree, so that git blame history is kept intact. Then I had to make a few changes to appease `tidy`. The most complex thing here is porting the tests. We can't have `std_detect` both in r-l/r and stdarch, because they could get desynchronized, so we have to perform the move more or less "atomically", which means that we also have to port all the existing `std_detect` tests from the `stdarch` repository. The stdarch repo runs the following `std_detect` tests: ### Build The `build-std-detect.sh` script (https://github.com/rust-lang/stdarch/blob/e2b6512aed87df45294ae680181eeef7a802cd95/ci/build-std-detect.sh) builds `std_detect` using the nightly compiler for several targets. This will be subsumed by normal `x build library` on our Tier 1/2 targets. However, the stdarch repository also tests the following targets: - aarch64-unknown-freebsd - armv6-unknown-freebsd - powerpc-unknown-freebsd - powerpc64-unknown-freebsd - aarch64-unknown-openbsd Which we don't build/test on our CI currently. I think we have mostly two options here: 1) Ignore these targets 2) Create a special CI job that will build stage 1 rustc and then cross-compile std (or just the `std_detect` crate?) for these targets. ### Documentation The `dox.sh` script (https://github.com/rust-lang/stdarch/blob/3fec5adcd52a815f227805d4959a25b6402c7fd5/ci/dox.sh) builds and documents `std_detect` for several targets. All of them are Tier 2/we have `dist-` jobs for them, so I think that we can just skip this and let our normal CI subsume it? ### Tests The `run.sh` script (https://github.com/rust-lang/stdarch/blob/1b201cec2cca7465602a65ed6ae60517224b15f3/ci/run.sh) runs `cargo test` on `std_detect` with a bunch of variations of feature flags. This will be subsumed by `x test library` in our CI. The only problem is that `stdarch` runs these tests for a ludicrous number of targets: ``` - tuple: i686-unknown-linux-gnu - tuple: x86_64-unknown-linux-gnu - tuple: arm-unknown-linux-gnueabihf - tuple: armv7-unknown-linux-gnueabihf - tuple: aarch64-unknown-linux-gnu - tuple: aarch64_be-unknown-linux-gnu - tuple: riscv32gc-unknown-linux-gnu - tuple: riscv64gc-unknown-linux-gnu - tuple: powerpc-unknown-linux-gnu - tuple: powerpc64-unknown-linux-gnu - tuple: powerpc64le-unknown-linux-gnu - tuple: s390x-unknown-linux-gnu - tuple: i586-unknown-linux-gnu - tuple: nvptx64-nvidia-cuda - tuple: thumbv6m-none-eabi - tuple: thumbv7m-none-eabi - tuple: thumbv7em-none-eabi - tuple: thumbv7em-none-eabihf - tuple: loongarch64-unknown-linux-gnu - tuple: wasm32-wasip1 - tuple: x86_64-apple-darwin - tuple: x86_64-apple-ios-macabi - tuple: aarch64-apple-darwin - tuple: aarch64-apple-ios-macabi - tuple: x86_64-pc-windows-msvc - tuple: i686-pc-windows-msvc - tuple: aarch64-pc-windows-msvc - tuple: x86_64-pc-windows-gnu - tuple: aarch64-unknown-linux-gnu - tuple: aarch64_be-unknown-linux-gnu - tuple: armv7-unknown-linux-gnueabihf - tuple: loongarch64-unknown-linux-gnu - tuple: powerpc-unknown-linux-gnu - tuple: powerpc64-unknown-linux-gnu - tuple: powerpc64le-unknown-linux-gnu - tuple: riscv32gc-unknown-linux-gnu - tuple: riscv64gc-unknown-linux-gnu - tuple: s390x-unknown-linux-gnu - tuple: x86_64-unknown-linux-gnu - tuple: aarch64-apple-darwin - tuple: aarch64-apple-ios-macabi ``` We definitely do not run *tests* for all of these targets on our CI. # Outcome We have decided to just subsume std_detect tests by our normal test suite for now, and not create a separate CI job. Therefore, this PR performs the following changes in target testing for `std_detect`: The following T3 targets would go from "build" to "nothing": ``` aarch64-unknown-freebsd (T3) armv6-unknown-freebsd (T3) powerpc-unknown-freebsd (T3) powerpc64-unknown-freebsd (T3) aarch64-unknown-openbsd (T3) ``` The following T3 targets would go from "test" to "nothing": ``` aarch64_be-unknown-linux-gnu (T3) riscv32gc-unknown-liux-gnu (T3) ``` The following T2 targets would go from "test" to "build": ``` arm-unknown-linux-gnueabihf (T2) armv7-unknown-linux-gnueabihf (T2) riscv64gc-unknown-linux-gnu (T2) powerpc-unknown-linux-gnu (T2) powerpc64-unknown-linux-gnu (T2) powerpc64le-unknown-linux-gnu (T2) s390x-unknown-linux-gnu (T2) i586-unknown-linux-gnu (T2) loongarch64-unknown-linux-gnu (T2) wasm32-wasip1 (T2) x86_64-apple-ios-macabi (T2) aarch64-apple-ios-macabi (T2) aarch64-pc-windows-msvc (T2) armv7-unknown-linux-gnueabihf (T2) loongarch64-unknown-linux-gnu (T2) powerpc-unknown-linux-gnu (T2) ``` I have confirmed in https://github.com/rust-lang/stdarch/pull/1873 that the current version of this PR would pass stdarch's CI testsuite. r? `@ghost` try-job: armhf-gnu try-job: arm-android
2025-07-23Auto merge of #143897 - cjgillot:derive-walk, r=petrochenkovbors-1676/+1220
Implement AST visitors using a derive macro. AST visitors are large and error-prone beasts. This PR attempts to write them using a derive macro. The design uses three traits: `Visitor`, `Visitable`, `Walkable`. - `Visitor` is the trait implemented by downstream crates, it lists `visit_stuff` methods, which call `Walkable::walk_ref` by default; - `Walkable` is derived using the macro, the generated `walk_ref` method calls `Visitable::visit` on each component; - `Visitable` is implemented by `common_visitor_and_walkers` macro, to call the proper `Visitor::visit_stuff` method if it exists, to call `Walkable::walk_ref` if there is none. I agree this is quite a lot of spaghetti macros. I'm open to suggestions on how to reduce the amount of boilerplate code. If this PR is accepted, I believe the same design can be used for the HIR visitor.
2025-07-22Auto merge of #144249 - GuillaumeGomez:asm-tests, r=jieyouxubors-56/+83
Rename `tests/{assembly,codegen}` into `tests/{assembly,codegen}-llvm` and ignore these testsuites if configured backend doesn't match Follow-up of https://github.com/rust-lang/rust/pull/144125. This PR changes `compiletest` so that `asm` tests are only run if they match the current codegen backend. To better reflect it, I renamed the `tests/ui/asm` folder into `tests/ui/asm-llvm`. Like that, we can add new asm tests for other backends if we want without needing to add extra code to `compiletest`. Next step will be to use the new code annotations added in rust-lang/rust#144125 to ignore ui tests failing in cg_gcc until it's fixed on our side. cc `@antoyo` `@oli-obk` r? `@Kobzol`
2025-07-22Embed auxv files directly into the test binaryJakub Beránek-12/+10
2025-07-22Improve error messages of auxv loadingJakub Beránek-10/+17
2025-07-22Remove licenses from std-detectJakub Beránek-226/+0
They are subsumed by the main repo licenses.
2025-07-22Bless bootstrap testsJakub Beránek-11/+11
2025-07-22Remove `std_detect` from stdarch's CIJakub Beránek-71/+2
2025-07-22Remove `std_detect` from stdarch examplesJakub Beránek-30/+18
2025-07-22Fix warningJakub Beránek-0/+10
2025-07-22Move tests around to appease `tidy`Jakub Beránek-262/+258
2025-07-22Update stdarch READMEJakub Beránek-9/+1
2025-07-22Reformat `std_detect`Jakub Beránek-182/+54
2025-07-22Allow platform-specific code in `std_detect`Jakub Beránek-0/+1
2025-07-22Make `std_detect` a direct dependency of `std`Jakub Beránek-16/+7
2025-07-22Move `std_detect` from `library/stdarch` to `library`Jakub Beránek-0/+0
2025-07-22bootstrap: add package.json and package-lock.json to dist tarballbinarycat-0/+2
this ensures that js-related tests can still be run from within such a dist tarball.
2025-07-22Add powerpc64le-unknown-linux-musl to CI rustc targetsJens Reidel-0/+1
I missed this in the promotion to tier 2 with host tools. Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2025-07-22Auto merge of #144222 - Kobzol:stdarch-push, r=folkertdevbors-5042/+4642
stdarch subtree update Subtree update of `stdarch` to https://github.com/rust-lang/stdarch/commit/5531955678494ee28ec02130a6d94082ad4532da. Created using https://github.com/rust-lang/josh-sync. I saw that there were non-trivial changes made to `std_detect` in `stdarch` recently. So I want to get them merged here before we move forward with https://github.com/rust-lang/rust/pull/143412. r? `@folkertdev`
2025-07-22Only run `tests/assembly-*` and `tests/codegen-*` tests if they match the ↵Guillaume Gomez-3/+20
current codegen backend
2025-07-22Rename `tests/codegen` into `tests/codegen-llvm`Guillaume Gomez-36/+41
2025-07-22Rename `tests/assembly` into `tests/assembly-llvm`Guillaume Gomez-17/+22
2025-07-22Auto merge of #144294 - matthiaskrgr:rollup-ybvall3, r=matthiaskrgrbors-185/+3821
Rollup of 7 pull requests Successful merges: - rust-lang/rust#142454 (Add modern AVR mcus like avr128db28 and attiny3224) - rust-lang/rust#142924 (tidy: move rustdoc js stuff into a tidy extra check) - rust-lang/rust#143373 (Unquerify maybe_unused_trait_imports.) - rust-lang/rust#144082 (tests: cover more `exported_private_dependencies` cases) - rust-lang/rust#144126 (Fix empty target_config in apply_rust_config bootstrap) - rust-lang/rust#144164 ( opt-dist: add an option for setting path to stage0 root) - rust-lang/rust#144265 (Dont ICE on copy error being suppressed due to overflow) r? `@ghost` `@rustbot` modify labels: rollup
2025-07-22Clean code for `rustc_parse/src/lexer`xizheyin-85/+83
1. Rename `make_unclosed_delims_error` and return `Vec<Diag>` 2. change magic number `unclosed_delimiter_show_limit` to const 3. move `eof_err` below parsing logic 4. Add `calculate_spacing` for `bump` and `bump_minimal` Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-07-22coverage: Enlarge empty spans during MIR instrumentation, not codegenZalathar-46/+57
This allows us to assume that coverage spans will only be discarded during codegen in very unusual situations.
2025-07-22Auto merge of #144205 - hkBst:flt2dec, r=workingjubileebors-11/+7
flt2dec: replace for loop by iter_mut Perf is explored in https://github.com/rust-lang/rust/issues/144118, which initially showed small losses, but then also showed significant gains. Both are real, but given the smallness of the losses, this seems a good change.
2025-07-22Rollup merge of #144265 - compiler-errors:copy-ice, r=oli-obkMatthias Krüger-4/+36
Dont ICE on copy error being suppressed due to overflow See comment in test file. Fixes https://github.com/rust-lang/rust/issues/144165