Commit graph

301722 commits

Author SHA1 Message Date
Robert Serrano Kobylyansky
affe2c4376
Update installation.md
The `--enable-offload` and `--enable--enzyme` arguments don't seem to work.

Changing them to `--enable-llvm-offload` and `--enable-llvm-enzyme` resulted in the `boostrap.toml` file generating succesfully.
2025-08-04 13:08:29 +01:00
nora
788845811e
Merge pull request #2532 from rust-lang/tshepang/date-check
there is still no official policy regarding new rustc crate deps
2025-08-03 11:56:03 +02:00
Tshepang Mbambo
f84c62112a there is still no official policy 2025-08-03 07:18:26 +02:00
Tshepang Mbambo
3bba46bb52
Merge pull request #2509 from rust-lang/tshepang-auto-toc
make toc generation fully automatic
2025-08-03 06:55:44 +02:00
Boxy
700e063e7e
Merge pull request #2531 from Kivooeo/update-doc
Update documentation for current tests requirements
2025-08-02 15:42:44 +01:00
Kivooeo
5ebb0dd7da update doc 2025-08-02 19:01:07 +05:00
Tshepang Mbambo
171c2478c0
Merge pull request #2526 from rust-lang/rustc-pull
Rustc pull update
2025-08-02 00:40:01 +02:00
lcnr
219e4c141d
Merge pull request #2530 from lcnr/type-system-invariants
fix link
2025-08-01 15:50:18 +02:00
lcnr
ba57bbadc9 rarw 2025-08-01 15:49:36 +02:00
lcnr
c277f4e64d
Merge pull request #2529 from lcnr/type-system-invariants
add a chapter documenting candidate preference
2025-08-01 15:27:32 +02:00
lcnr
4f60c9097a rarw 2025-08-01 15:25:50 +02:00
许杰友 Jieyou Xu (Joe)
f7267cc34b
Merge pull request #2527 from lolbinarycat/patch-5 2025-08-01 13:59:42 +08:00
lolbinarycat
cab16432fb
improve linking in the "Auxilirary builds" section of directive index 2025-07-31 13:33:51 -05:00
The rustc-josh-sync Cronjob Bot
7cab27d73a Merge ref '32e7a4b92b' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: 32e7a4b92b
Filtered ref: d39f3479bfafb04026ed3afec68aa671d13e9c3c

This merge was created using https://github.com/rust-lang/josh-sync.
2025-07-31 04:17:04 +00:00
The rustc-josh-sync Cronjob Bot
7d378192a7 Prepare for merging from rust-lang/rust
This updates the rust-version file to 32e7a4b92b.
2025-07-31 04:16:57 +00:00
bors
32e7a4b92b Auto merge of #144405 - lcnr:hir-typeck-uniquify, r=BoxyUwU
uniquify root goals during HIR typeck

We need to rely on region identity to deal with hangs such as https://github.com/rust-lang/trait-system-refactor-initiative/issues/210 and to keep the current behavior of `fn try_merge_responses`.

This is a problem as borrowck starts by replacing each *occurrence* of a region with a unique inference variable. This frequently splits a single region during HIR typeck into multiple distinct regions. As we assume goals to always succeed during borrowck, relying on two occurances of a region being identical during HIR typeck causes ICE. See the now fixed examples in https://github.com/rust-lang/trait-system-refactor-initiative/issues/27 and rust-lang/rust#139409.

We've previously tried to avoid this issue by always *uniquifying* regions when canonicalizing goals. This prevents caching subtrees during canonicalization which resulted in hangs for very large types. People rely on such types in practice, which caused us to revert our attempt to reinstate `#[type_length_limit]` in https://github.com/rust-lang/rust/pull/127670. The complete list of changes here:
- rust-lang/rust#107981
- rust-lang/rust#110180
- rust-lang/rust#114117
- rust-lang/rust#130821

After more consideration, all occurrences of such large types need to happen outside of typeck/borrowck. We know this as we already walk over all types in the MIR body when replacing their regions with nll vars.

This PR therefore enables us to rely on region identity inside of the trait solver by exclusively **uniquifying root goals during HIR typeck**. These are the only goals we assume to hold during borrowck. This is insufficient as type inference variables may "hide" regions we later uniquify. Because of this, we now stash proven goals which depend on inference variables in HIR typeck and reprove them after writeback. This closes https://github.com/rust-lang/trait-system-refactor-initiative/issues/127.

This was originally part of rust-lang/rust#144258 but I've moved it into a separate PR. While I believe we need to rely on region identity to fix the performance issues in some way, I don't know whether rust-lang/rust#144258 is the best approach to actually do so. Regardless of how we deal with the hangs however, this change is necessary and desirable regardless.

r? `@compiler-errors` or `@BoxyUwU`
2025-07-31 00:32:55 +00:00
bors
606dcc0d2e Auto merge of #116316 - cjgillot:incr-privacy, r=petrochenkov
Remove eval_always from check_private_in_public.

This PR attempts to avoid re-computing `check_private_in_public` query. First by marking the query as non-`eval_always`, and by reducing the amount of accesses to HIR as much as possible.

Latest perf https://github.com/rust-lang/rust/pull/116316#issuecomment-3094672105 shows that we manage it. The cost is extra dep-graph bookkeeping.
2025-07-30 21:29:47 +00:00
bors
3048886e59 Auto merge of #144692 - samueltardieu:rollup-0j1y08x, r=samueltardieu
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#143465 (Support multiple crate versions in --extern-html-root-url)
 - rust-lang/rust#144308 ([rustdoc] Display total time and compilation time of merged doctests)
 - rust-lang/rust#144655 (clean up codegen fn attrs)
 - rust-lang/rust#144675 (Reject running `compiletest` self-tests against stage 0 rustc unless explicitly allowed)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-07-30 18:16:17 +00:00
Samuel Tardieu
202d1f5bf4
Rollup merge of #144675 - jieyouxu:compiletest-staging, r=Kobzol
Reject running `compiletest` self-tests against stage 0 rustc unless explicitly allowed

Currently, in `pr-check-1`, we run `python3 ../x.py test --stage 0 src/tools/compiletest`, which is `compiletest` self-tests against stage 0 rustc. This makes it very annoying for PRs wanting to change target spec JSON format, which `compiletest` depends on for target information, as otherwise `compiletest` would have to know how to handle 2 different target spec JSON formats and know when to pick which.

Instead of doing that, we change `compiletest` self-tests to reject running against stage 0 `rustc` *unless* explicitly allowed with `build.compiletest-allow-stage0=true`. `build.compiletest-allow-stage0` is a proper bootstrap config option in favor of the ad-hoc `COMPILETEST_FORCE_STAGE0` env var. This means that:

- `./x test src/tools/compiletest --stage=0` is not allowed, unless `build.compiletest-allow-stage0=true` is set. In this scenario, `compiletest` self-tests should be expected to fail unless the stage 0 `rustc` as provided is like codegen_cranelift where it's *actually* built from in-tree `rustc` sources.
- In CI, we change `./x test src/tools/compiletest --stage=0` to `./x test src/tools/compiletest --stage=1`, and move it to `pr-check-2`. Yes, this involves building the stage 1 compiler, but `pr-check-2` already has to build stage 1 compiler to test stage 1 library crates.
- Crucially, this means that **`compiletest` is only intended to support one target spec JSON format**, namely the one corresponding to the in-tree `rustc`.
- This should preserve the `compiletest-use-stage0-libtest` UX optimization where changing `compiler/` tree should still not require rebuilding `compiletest` as long as `build.compiletest-use-stage0-libtest=true`, as that should remain orthogonal. This is completely unlike my previous attempt at https://github.com/rust-lang/rust/pull/144563 that tries to do a way more invasive change which would cause the rebuild problem.

Best reviewed commit-by-commit.

---

r? `@Kobzol`
2025-07-30 19:49:03 +02:00
Samuel Tardieu
175121903a
Rollup merge of #144655 - jdonszelmann:cleanup-codegen-fn-attrs, r=WaffleLapkin
clean up codegen fn attrs

This honestly had become a mess over time and needed some love. No behavior should've changed, and I effectively just moved code around. Though, I can't promise there weren't any bugs in the original code with how randomly it was organised.....

r? `@WaffleLapkin`
2025-07-30 19:49:02 +02:00
Samuel Tardieu
61760fbda4
Rollup merge of #144308 - GuillaumeGomez:merged-doctest-times, r=lolbinarycat
[rustdoc] Display total time and compilation time of merged doctests

Fixes rust-lang/rust#144270.

Does it look good to you `@kpreid?`

<img width="908" height="263" alt="image" src="https://github.com/user-attachments/assets/cd5d082d-c4e0-42ed-91dd-bd263b413dcd" />
2025-07-30 19:49:02 +02:00
Samuel Tardieu
b38ece9021
Rollup merge of #143465 - kornelski:extern-name, r=petrochenkov
Support multiple crate versions in --extern-html-root-url

Rustdoc's `--extern-html-root-url` used to use `tcx.crate_name()` to identify crates, but that used crates' internal names from their metadata, instead of names given to them in `--extern`. That was confusing, because both `--extern…` arguments seem related and use similar syntax. Crucially, this didn't work correctly with Cargo's package aliases or multiple versions of crates.

`sess.opts.externs` lacks `CrateNum`, and `Resolver.extern_prelude` gets destroyed before `rustdoc` has a chance to see it, so I've had to save this mapping in `CStore`.

Just in case, I've kept the previous mapping by crate name as a fallback for crates that weren't matched by their extern name.

Fixes rust-lang/rust#76296
2025-07-30 19:49:01 +02:00
Jana Dönszelmann
1d589c87be
clean up codegen fn attrs 2025-07-30 16:39:16 +02:00
lcnr
2b065e7c0b extend comment 2025-07-30 14:30:57 +02:00
lcnr
df2e54376c add comment and opaque type fixme 2025-07-30 14:01:37 +02:00
lcnr
b6cbe33aeb handle region dependent goals due to infer vars 2025-07-30 14:01:37 +02:00
Jieyou Xu
e954253d43
Add change tracker entry 2025-07-30 19:55:17 +08:00
Jieyou Xu
2cdd19384f
Run compiletest self-tests against stage 1 rustc
And move `./x test compiletest --stage=1` to `pr-check-2`, where testing
library artifacts already requires building the stage 1 compiler.
2025-07-30 19:55:17 +08:00
Jieyou Xu
2033a06d7f
Deny compiletest self-tests being run against stage 0 rustc unless 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-30 19:55:08 +08:00
Jieyou Xu
a7fcc738c9
Update codegen_{cranelift,gcc} and opt-dist to use build.compiletest-allow-stage0 2025-07-30 19:55:07 +08:00
Jieyou Xu
0cf6eb5f75
Introduce proper build.compiletest-allow-stage0 config option
In favor of the adhoc `COMPILETEST_FORCE_STAGE0` env var.
2025-07-30 19:54:16 +08:00
bors
e5e79f8bd4 Auto merge of #144673 - Zalathar:rollup-0kpeq3n, r=Zalathar
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-30 09:02:21 +00:00
Stuart Cook
3682d8c1ce
Rollup merge of #144668 - daltenty:daltenty/runmake-llvm-components, r=jieyouxu
[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-30 17:59:40 +10:00
Stuart Cook
08e26fc678
Rollup merge of #144666 - compiler-errors:correct-late, r=lqd
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:

c8bb4e8a12/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:

c8bb4e8a12/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`:

c8bb4e8a12/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.

c8bb4e8a12/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-30 17:59:40 +10:00
Stuart Cook
ba8295019e
Rollup merge of #144662 - Zalathar:directive-names, r=fmease
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-30 17:59:39 +10:00
Stuart Cook
38e7615e78
Rollup merge of #144411 - Kivooeo:remove-world, r=jieyouxu
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-30 17:59:39 +10:00
Stuart Cook
02a68e42fd
Rollup merge of #144268 - xizheyin:find-oldest-ancestor, r=jieyouxu
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-30 17:59:38 +10:00
Stuart Cook
b6ac83d372
Rollup merge of #144042 - dpaoliello:verifyllvmcomp, r=jieyouxu
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-30 17:59:37 +10:00
Jakub Beránek
bfdef36c03
Merge pull request #2525 from Kobzol/remove-ci-py
Remove outdated ci.py reference
2025-07-30 08:12:05 +02:00
Jakub Beránek
951a6f792d
Remove outdated ci.py reference 2025-07-30 08:11:01 +02:00
bors
72716b134a Auto merge of #144305 - ChrisDenton:win-free-disk-space, r=marcoieni
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 06:00:09 +00:00
David Tenty
21af154998 [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-30 00:39:43 -04:00
Chris Denton
43018d3722
Free disk space on Windows 2025 runners 2025-07-30 04:10:28 +00:00
Michael Goulet
98d08ff014 Make sure to account for the right item universal regions in borrowck 2025-07-30 04:07:19 +00:00
bors
919c409243 Auto merge of #144577 - oli-obk:wrapping-niche, r=scottmcm
Pick the largest niche even if the largest niche is wrapped around

fixes rust-lang/rust#144388

r? `@scottmcm`
2025-07-30 02:57:04 +00:00
Zalathar
dee2013641 compiletest: Move directive names back into a separate file
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-30 12:45:25 +10:00
bors
c8bb4e8a12 Auto merge of #144658 - jhpratt:rollup-jdzhz27, r=jhpratt
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-29 23:53:04 +00:00
Jacob Pratt
72f4ff2c45
Rollup merge of #144640 - FractalFir:m68k_arch, r=Urgau
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-29 18:55:22 -04:00
Jacob Pratt
322686de5d
Rollup merge of #144639 - Kobzol:x-perf-tui, r=lqd
Update rustc-perf submodule

Mostly to include https://github.com/rust-lang/rustc-perf/pull/2204.
2025-07-29 18:55:21 -04:00
Jacob Pratt
bd40dd6c61
Rollup merge of #144632 - nikic:llvm-21-tests, r=durin42
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-29 18:55:21 -04:00