| Age | Commit message (Collapse) | Author | Lines |
|
|
|
Update to LLVM 21
Timeline: LLVM 21.1.0 is scheduled to release on Aug 26th. Rust 1.90 branches on Aug 1st and releases September 18.
Depends on:
* [x] https://github.com/llvm/llvm-project/issues/147781
* [x] https://github.com/llvm/llvm-project/issues/147935
* [x] https://github.com/llvm/llvm-project/issues/139443
* [x] https://github.com/llvm/llvm-project/pull/148207
* [x] https://github.com/llvm/llvm-project/pull/148607
* [x] https://github.com/llvm/llvm-project/pull/149046
* [x] https://github.com/llvm/llvm-project/issues/149097
* [x] https://github.com/rust-lang/rust/pull/144116
r? `@ghost`
|
|
Simplify dead code lint
This PR scratches a few itches I had when looking at that code.
The perf improvement comes from keeping the `scanned` set through several marking phases. This pretty much divides by 2 the number of HIR traversals.
|
|
The project build for compiler-rt is deprecated.
The runtimes build will use the just-built clang. As such, we
also need to pass --gcc-toolchain to the runtimes build, so that
it can find the GCC installation.
|
|
Consolidate staging for `rustc_private` tools
This PR continues bootstrap refactoring, this time by consolidating staging for `Mode::ToolRustc` tools. This refactoring was in the critical path of refactoring `test`/`dist`/`clippy`/`doc` steps, and getting rid of the rmeta/rlib sysroot copy, because tools are pervasive and they are being used for a lot of things in bootstrap.
The main idea is to explicitly model the fact that a stage N `Mode::ToolRustc` tool always works with two different compilers:
- Stage N-1 rustc (`build_compiler`) builds stage N rustc (`target_compiler`)
- Rlib artifacts from stage N rustc are copied to the sysroot of stage N-1 rustc
- Stage N-1 rustc builds the (stage N) tool itself, the tool links to the rlib artifacts of the stage N rustc
Before, the code often used `compiler`, which meant sometimes the build compiler, sometimes the target compiler, and sometimes neither (looking at you, `download-rustc`). This is especially annoying when you get to a situation where you have an install step that invokes a dist step that invokes a tool build step, where *some* compiler is being propagated through, without it being clear what does that compiler represent. This refactoring hopefully makes that clearer and more explicit. It also gets rid of a few `builder.ensure(Rustc(...))` calls within bootstrap, which is always nice.
`Rustdoc` needs to be handled a bit specially, because it acts as a compiler itself, I documented that in the changes.
It wasn't practical to do these refactorings in multiple PRs, so I did it all in one PR. The meat of the change is 9ee6d1c1ed112c3dcfb5684b33772b136df0dca3.
I tested manually that `x build rustdoc` and `x build miri` still works even with `download-rustc`, although I cannot promise any extra support for `download-rustc`, IMO we will just have to reimplement it from scratch in a different way.
As usually, I did some drive-by refactorings to bootstrap, trying to document and clarify things, add more step metadata and tests.
Since these changes broke Cargo, which was incorrectly using `Mode::ToolRustc`, I also changed cargo to `ToolTarget` in this PR.
Best reviewed commit-by-commit (note that I renamed `link_compiler` to `target_compiler`, in accordance to the rest of bootstrap, in the last commit).
r? `@jieyouxu`
try-job: x86_64-gnu-aux
try-job: x86_64-msvc-ext1
|
|
Rollup of 17 pull requests
Successful merges:
- rust-lang/rust#144467 (rustdoc template font links only emit `crossorigin` when needed)
- rust-lang/rust#144548 (Rehome 21 `tests/ui/issues/` tests to other subdirectories under `tests/ui/`)
- rust-lang/rust#144741 (fix: Error on illegal `[const]`s inside blocks within legal positions)
- rust-lang/rust#144776 (`Printer` cleanups)
- rust-lang/rust#144779 (Implement debugging output of the bootstrap Step graph into a DOT file)
- rust-lang/rust#144813 (Add a tidy check to prevent adding UI tests directly under `tests/ui/`)
- rust-lang/rust#144817 (Properly reject tail calls to `&FnPtr` or `&FnDef`)
- rust-lang/rust#144852 (Rename `rust_panic_without_hook` to `resume_unwind` )
- rust-lang/rust#144866 (Remove `SHOULD_EMIT_LINTS` in favor of `should_emit`)
- rust-lang/rust#144867 (Use `as_array` in PartialEq for arrays)
- rust-lang/rust#144872 (Document Poisoning in `LazyCell` and `LazyLock`)
- rust-lang/rust#144877 (coverage: Various small cleanups)
- rust-lang/rust#144887 (`rust-analyzer` subtree update)
- rust-lang/rust#144890 (Add `InterpCx::project_fields`)
- rust-lang/rust#144894 (Delete `tests/ui/threads-sendsync/tcp-stress.rs`)
- rust-lang/rust#144905 (rustc-dev-guide subtree update)
- rust-lang/rust#144920 (Dont print arg span in MIR dump for tail call)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Dont print arg span in MIR dump for tail call
r? WaffleLapkin
This makes the MIR dump for tail call terminators consistent w/ regular calls.
|
|
rustc-dev-guide subtree update
Subtree update of `rustc-dev-guide` to https://github.com/rust-lang/rustc-dev-guide/commit/1263fc23672325c1d2e3d6bba8a7dd89e986245c.
Created using https://github.com/rust-lang/josh-sync.
r? ``@ghost``
|
|
Delete `tests/ui/threads-sendsync/tcp-stress.rs`
This stress test was originally introduced in 65cca4bd3fa0abe1000662014b3e3ea1420728f5 to detect a UAF in `libuv` (see rust-lang/rust#12823), but we no longer use `libuv`, so remove this test as it no longer serves its original purpose, and is causing flaky timeout failures.
Closes rust-lang/rust#144878 (by removing the test).
r? libs
|
|
Add `InterpCx::project_fields`
I was hoping for a much bigger improvement and this is lukewarm at best ^^'
Still, I think this makes sense.
|
|
`rust-analyzer` subtree update
Subtree update of `rust-analyzer` to https://github.com/rust-lang/rust-analyzer/commit/8d75311400a108d7ffe17dc9c38182c566952e6e.
Created using https://github.com/rust-lang/josh-sync.
r? `@ghost`
|
|
coverage: Various small cleanups
This PR is a collection of small coverage-related changes that I accumulated while working towards other coverage improvements.
Each change should hopefully be fairly straightforward.
|
|
Document Poisoning in `LazyCell` and `LazyLock`
Currently, there is no documentation of poisoning behavior in either `LazyCell` or `LazyLock`, even though both of them can be observed as poisoned by users.
`LazyCell` [plagyround example](https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=9cf38b8dc56db100848f54085c2c697d)
`LazyLock` [playground example](https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=f1cd6f9fe16636e347ebb695a0ce30c0)
# Open Questions
- [x] Is it worth making the implementation of `LazyLock` more complicated to ensure that the the panic message is `"LazyLock instance has previously been poisoned"` instead of `"Once instance has previously been poisoned"`? See the `LazyLock` playground link above for more context.
- [x] Does it make sense to move `LazyLock` into the `poison` module? It is certainly a poison-able type, but at the same time it is slightly different from the 4 other types currently in the `poison` module in that it is unrecoverable. I think this is more of a libs-api question.
``@rustbot`` label +T-libs-api
Please let me know if these open questions deserve a separate issue / PR!
|
|
Use `as_array` in PartialEq for arrays
Now that `as_array` exists we might as well use it here, since it's a bit more convenient than getting the correct type out of `try_into`.
|
|
Remove `SHOULD_EMIT_LINTS` in favor of `should_emit`
r? ``@jdonszelmann``
|
|
Rename `rust_panic_without_hook` to `resume_unwind`
part of https://github.com/rust-lang/rust/issues/116005
r? libs
|
|
Properly reject tail calls to `&FnPtr` or `&FnDef`
Fixes rust-lang/rust#144795
|
|
Add a tidy check to prevent adding UI tests directly under `tests/ui/`
This PR implements https://github.com/rust-lang/compiler-team/issues/902.
Only the last commit (adding the new check) is functional; earlier commits are just small drive-by changes to make the other ui/ui-fulldeps checks more logically contained.
r? ```@Kobzol``` (or compiler)
|
|
Implement debugging output of the bootstrap Step graph into a DOT file
There are already a bunch of ways how we can debug bootstrap, so why not add one more =D (ideally I'd like to consolidate these approaches somewhat, ```@Shourya742``` is looking into that, but I think that this specific debugging tool is orthogonal to the rest of them, and is quite useful).
This PR adds the option to render the bootstrap step graph into the DOT format, in order to understand what steps were executed, along with their fields (`Debug` output).
Here you can see an example of the generated DOT files for the `BOOTSTRAP_TRACING=1 ./x build compiler --stage 2 --dry-run` command on x64 Linux. One is with cached deps (what this PR does), the other one without.
[bootstrap-dot.zip](https://github.com/user-attachments/files/21548679/bootstrap-dot.zip)
Visual example:
<img width="1899" height="445" alt="image" src="https://github.com/user-attachments/assets/ae40e6d2-0ea8-48bb-b77e-6b21700b95ee" />
r? ```@jieyouxu```
|
|
`Printer` cleanups
The trait `Printer` is implemented by six types, and the sub-trait `PrettyPrinter` is implemented by three of those types. The traits and the impls are complex and a bit of a mess. This PR starts to clean them up.
r? ``@davidtwco``
|
|
fix: Error on illegal `[const]`s inside blocks within legal positions
Fixes rust-lang/rust#132067
I initially considered moving `[const]` validations to `rustc_ast_lowering`, but that approach would require adding constness information to `AssocCtxt`, which introduces significant changes - especially within `rustc_expand` - just to support a single use case here:
https://github.com/rust-lang/rust/blob/3fb1b53a9dbfcdf37a4b67d35cde373316829930/compiler/rustc_ast_passes/src/ast_validation.rs#L1596-L1610
Instead, I believe it's sufficient to simply "reset" `[const]` allowness whenever we enter a new block.
|
|
Rehome 21 `tests/ui/issues/` tests to other subdirectories under `tests/ui/`
rust-lang/rust#143902 divided into smaller, easier to review chunks.
Part of rust-lang/rust#133895
Methodology:
1. Refer to the previously written `tests/ui/SUMMARY.md`
2. Find an appropriate category for the test, using the original issue thread and the test contents.
3. Add the issue URL at the bottom (not at the top, as that would mess up stderr line numbers)
4. Rename the tests to make their purpose clearer
Inspired by the methodology that ``@Kivooeo`` was using.
r? ``@jieyouxu``
|
|
r=GuillaumeGomez
rustdoc template font links only emit `crossorigin` when needed
The `crossorigin` attribute may cause issues when the href is not actually cross-origin. Specifically, the tag causes the browser to send a preflight OPTIONS request to the server even if it is same-origin. Some temperamental servers may reject all CORS preflight requests even if they're actually same-origin, which causes a CORS error and prevents the fonts from loading, even later on.
This commit fixes that problem by not emitting `crossorigin` if the url appears to be relative to the same origin.
|
|
|
|
|
|
|
|
r=GuillaumeGomez
GCC backend subtree update
cc `@antoyo`
|
|
Rustc pull update
|
|
This stress test was originally introduced in
65cca4bd3fa0abe1000662014b3e3ea1420728f5 to detect a UAF in libuv (see
RUST-12823), but we no longer use libuv, so remove this test as it was
causing flaky timeout failures. See RUST-144878 for discussion.
|
|
|
|
|
|
subtree-update_cg_gcc_2025-08-04
|
|
- don't need type alias to default type argument
- `Residual` impl allows to use more std APIs (like `<[T; N]>::try_map`)
|
|
|
|
|
|
|
|
|
|
Rollup of 2 pull requests
Successful merges:
- rust-lang/rust#144694 (Distinguish prepending and replacing self ty in predicates)
- rust-lang/rust#144875 (Add some pre-codegen MIR tests for debug mode)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Add some pre-codegen MIR tests for debug mode
No functional changes; just some tests.
I made these for rust-lang/rust#144483, but that's going in a different direction, so I wanted to propose we just add them to help see the impact of other related changes in the future.
r? mir
|
|
Distinguish prepending and replacing self ty in predicates
There are two kinds of functions called `with_self_ty`:
1. Prepends the `Self` type onto an `ExistentialPredicate` which lacks it in its internal representation.
2. Replaces the `Self` type of an existing predicate, either for diagnostics purposes or in the new trait solver when normalizing that self type.
This PR distinguishes these two because I often want to only grep for one of them. Namely, let's call it `with_replaced_self_ty` when all we're doing is replacing the self type.
|
|
Pull recent changes from https://github.com/rust-lang/rust via Josh.
Upstream ref: 383b9c447b61641e1f1a3850253944a897a60827
Filtered ref: 14b7b0bbd1e38402fca29ef84e5f75ee9d8cb1a9
This merge was created using https://github.com/rust-lang/josh-sync.
|
|
This updates the rust-version file to 383b9c447b61641e1f1a3850253944a897a60827.
|
|
Using an enum here was historically not worth the extra hassle, but now we can
lean on `#[derive(TryFromU32)]` to hide most of the boilerplate.
|
|
|
|
|
|
This flag turned out to be less useful than anticipated, and interferes with
work towards expansion support.
|
|
Having this helper function in the loop was confusing, because it doesn't rely
on anything that changes between loop iterations.
|
|
|
|
Rollup of 12 pull requests
Successful merges:
- rust-lang/rust#142205 (Mark `slice::swap_with_slice` unstably const)
- rust-lang/rust#144188 (`available_parallelism`: Add documentation for why we don't look at `ulimit`)
- rust-lang/rust#144322 (Add lint against dangling pointers from local variables)
- rust-lang/rust#144497 (tests: Add test for basic line-by-line stepping in a debugger)
- rust-lang/rust#144559 (Enable extract-insert-dyn.rs test on RISC-V (riscv64))
- rust-lang/rust#144667 (`AlignmentEnum` should just be `repr(usize)` now)
- rust-lang/rust#144706 (Do not give function allocations alignment in consteval and Miri.)
- rust-lang/rust#144746 (resolve: Cleanups and micro-optimizations to extern prelude)
- rust-lang/rust#144785 (Regression test for LLVM error with unsupported expression in static initializer for const pointer in array on macOS.)
- rust-lang/rust#144811 (Stylize `*-lynxos178-*` target maintainer handle to make it easier to copy/paste)
- rust-lang/rust#144848 (For "stage 1" ui-fulldeps, use the stage 1 compiler to query target info)
- rust-lang/rust#144853 (Remove unnecessary `rust_` prefixes)
Failed merges:
- rust-lang/rust#144794 (Port `#[coroutine]` to the new attribute system)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Remove unnecessary `rust_` prefixes
part of https://github.com/rust-lang/rust/issues/116005
Honestly, not sure if this can affect linking somehow, also I didn't touched things like `__rust_panic_cleanup` and `__rust_start_panic` which very likely will break something, so just small cleanup here
also didn't changed `rust_panic_without_hook` because it was renamed here https://github.com/rust-lang/rust/pull/144852
r? libs
|