304255 Commits

Author SHA1 Message Date
Guillaume Gomez
9bb7d17d9a
Rollup merge of #144373 - hkBst:remove-deprecated-1, r=jhpratt
remove deprecated Error::description in impls

[libs-api permission](https://github.com/rust-lang/libs-team/issues/615#issuecomment-3074045829)

r? `@cuviper`
or `@jhpratt`
2025-08-26 16:34:09 +02:00
Nikita Popov
c3ab409b4f Use captures(address) instead of captures(none) for indirect args
While provenance cannot be captured through these arguments, the
address / object identity can.
2025-08-26 16:16:23 +02:00
Mads Marquart
a898f76dc7 Inherit TCC in debuginfo tests on macOS 2025-08-26 15:53:15 +02:00
bors
5ab69249f3 Auto merge of #145874 - Kobzol:fix-dist-builds, r=jieyouxu
Remove unnecessary stage2 host builds from cross-compiled dist builders

This is a repeated regression (https://github.com/rust-lang/rust/issues/138004, https://github.com/rust-lang/rust/issues/138123) that was reintroduced in https://github.com/rust-lang/rust/pull/145472. I thought that we have a test for it, but alas, the "correct" test required `--disable-docs`. I added the test in this PR, and re-added the `dist::Std` build optimization that solves this.

r? `@jieyouxu`
2025-08-26 12:03:52 +00:00
Jana Dönszelmann
d66ca53000
add a flag to codegen fn attrs for foreign items 2025-08-26 13:05:51 +02:00
bors
4356e83c77 Auto merge of #145871 - Zalathar:rollup-lag9tlg, r=Zalathar
Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#143689 (Allow linking a prebuilt optimized compiler-rt builtins library)
 - rust-lang/rust#144885 (Implement some more checks in `ptr_guaranteed_cmp`. )
 - rust-lang/rust#145535 (make rustdoc::invalid_html_tags more robust)
 - rust-lang/rust#145766 (test(rustfmt): Verify frontmatter is preserved)
 - rust-lang/rust#145811 (Fix some minor issues in comments)
 - rust-lang/rust#145814 (Handle unwinding fatal errors in codegen workers)
 - rust-lang/rust#145815 (Wait for DPkg frontend lock when trying to remove packages)
 - rust-lang/rust#145821 (compiletest: if a compiler fails, show its output)
 - rust-lang/rust#145845 (Make `x test distcheck` self-contained)
 - rust-lang/rust#145847 (Don't show warnings from xcrun with -Zverbose-internals)
 - rust-lang/rust#145856 (Update books)
 - rust-lang/rust#145858 (Update wasm-component-ld dependency)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-08-26 08:28:05 +00:00
Jakub Beránek
2fd6057c31
Cache LLVM config invocations 2025-08-26 09:21:55 +02:00
Jakub Beránek
7379ff2809
Make bootstrap command caching opt-in
It was too dangerous to cache by default, and was it causing real bugs.
2025-08-26 09:21:55 +02:00
Jakub Beránek
c7f90c117e
Do not unnecessarily build stage2 host rustc in some dist builders 2025-08-26 09:20:10 +02:00
Jakub Beránek
598387bfb5
Add snapshot test for cross-compiled dist without docs 2025-08-26 08:52:04 +02:00
Marijn Schouten
845311a065 remove deprecated Error::description in impls 2025-08-26 06:36:53 +00:00
Jakub Beránek
0781c47acf
Always build miri for the host in x run miri 2025-08-26 08:05:28 +02:00
Stuart Cook
a21c2a6ef4
Rollup merge of #145858 - alexcrichton:update-wasm-component-ld, r=lqd
Update wasm-component-ld dependency

Keeping it up-to-date with the latest changes/features.
2025-08-26 14:19:23 +10:00
Stuart Cook
05b34e8676
Rollup merge of #145856 - rustbot:docs-update, r=ehuss
Update books

## rust-lang/nomicon

1 commits in 3ff384320598bbe8d8cfe5cb8f18f78a3a3e6b15..57ed4473660565d9357fcae176b358d7e8724ebf
2025-08-18 17:31:07 UTC to 2025-08-18 17:31:07 UTC

- Fix unknown field `author` error when building the book (rust-lang/nomicon#500)

## rust-lang/reference

11 commits in 59b8af811886313577615c2cf0e045f01faed88b..89f67b3c1b904cbcd9ed55e443d6fc67c8ca2769
2025-08-22 07:16:52 UTC to 2025-08-14 18:42:19 UTC

- Update `instruction_set` to use the attribute template (rust-lang/reference#1912)
- Update `debugger_visualizer` to use the attribute template (rust-lang/reference#1922)
- Update `collapse_debuginfo` to use the attribute template (rust-lang/reference#1923)
- Clarify operand evaluation order in compound assignment with primitiv… (rust-lang/reference#1941)
- Switch to using native mdbook fragment redirects (rust-lang/reference#1965)
- Fix traits implemented for function items (rust-lang/reference#1969)
- Clarify that safe extern items do not require unsafe (rust-lang/reference#1970)
- Update `type_length_limit` to use the attribute template (rust-lang/reference#1917)
- Add missing rule identifier for const outer generics (rust-lang/reference#1962)
- Fix indentation of static path restriction text (rust-lang/reference#1961)
- Add doc for `sse4a` and `tbm` (rust-lang/reference#1949)

## rust-lang/rust-by-example

2 commits in adc1f3b9012ad3255eea2054ca30596a953d053d..ad27f82c18464525c761a4a8db2e01785da59e1f
2025-08-20 23:50:16 UTC to 2025-08-13 21:41:46 UTC

- Support building books using mdbook in main (v0.5.x) (rust-lang/rust-by-example#1952)
- Improve the hints in `fmt` (1.2.3. Formatting); mention type casting (rust-lang/rust-by-example#1951)
2025-08-26 14:19:22 +10:00
Stuart Cook
820bb7f7df
Rollup merge of #145847 - madsmtm:no-xcrun-warnings, r=jieyouxu
Don't show warnings from xcrun with -Zverbose-internals

These kinds of warnings can make our test suite fail spuriously, so if we want them, we'll need a different flag.

This was introduced in https://github.com/rust-lang/rust/pull/131477. Fixes https://github.com/rust-lang/rust/issues/145543.

r? apiraino
```@bors``` rollup
2025-08-26 14:19:22 +10:00
bors
ace9a74442 Auto merge of #145848 - Kobzol:optimize-file-read, r=the8472
Slightly optimize reading of source files

Discussed on Zulip (https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/rustc.20uses.20silly.20amount.20of.20syscalls.20for.20file.20IO/with/536015625.

Do not open/close each source file twice when reading it. We still stat it twice though.
2025-08-26 04:19:21 +00:00
Stuart Cook
d19663951f
Rollup merge of #145845 - Kobzol:fix-distcheck, r=jieyouxu
Make `x test distcheck` self-contained

Before, the checked components were extracted under the checked out source root, which caused us to test some weird combination of tarball + checkout sources/aritfacts/configuration.

Now `x test distcheck` works with an external temporary directory instead, which should make it self-contained. I also moved some config from the Dockerfile to the test itself, and fixed an issue in tidy that caused `x test tidy` to fail on tarball sources.

I also removed `.args(&builder.config.configure_args)`, because it was passing all kinds of crap from the CI config to the distcheck step, which was making it less reproducible.

Fixes: https://github.com/rust-lang/rust/issues/145183

r? ```@jieyouxu```

try-job: x86_64-gnu-distcheck
2025-08-26 14:19:20 +10:00
Stuart Cook
cf0df7355c
Rollup merge of #145821 - lolbinarycat:compiletest-error-show, r=clubby789
compiletest: if a compiler fails, show its output

Before, when working on something like a `rustdoc-js` test, if you made a syntax error in a rust file, you would not get that error output unless you ran with `--verbose`, which would also cause an enormous amount of other output to be printed as well.  This can also lead to frustration in new contributors who don't think to run with `--verbose`.

Now, if rustc or rustdoc is run by compiletest and produces an non-zero exit code, its output will be printed.
2025-08-26 14:19:19 +10:00
Stuart Cook
6c310bab91
Rollup merge of #145815 - jieyouxu:pr-check-timeout, r=marcoieni
Wait for DPkg frontend lock when trying to remove packages

Hopefully this helps with [#t-infra > pr-check-1 fails on "free up disk space"](https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/pr-check-1.20fails.20on.20.22free.20up.20disk.20space.22/with/535794424).

As suggested by riking in [#t-infra > pr-check-1 fails on "free up disk space" @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/pr-check-1.20fails.20on.20.22free.20up.20disk.20space.22/near/535791579), thanks!

r? infra-ci
2025-08-26 14:19:19 +10:00
Stuart Cook
f5633098b0
Rollup merge of #145814 - bjorn3:codegen_worker_fatal_error, r=petrochenkov
Handle unwinding fatal errors in codegen workers

Also directly unwind on fatal errors at the point they are emitted inside the codegen backends.

Fixes the coordinator ICE of https://github.com/rust-lang/rust/issues/132240, https://github.com/rust-lang/rust/issues/135075 and https://github.com/rust-lang/rust/issues/145800.
2025-08-26 14:19:18 +10:00
Stuart Cook
67436ea8cf
Rollup merge of #145811 - houpo-bob:master, r=samueltardieu
Fix some minor issues in comments

Fix some minor issues in comments
2025-08-26 14:19:18 +10:00
Stuart Cook
514d612263
Rollup merge of #145766 - epage:rustfmt, r=calebcartwright
test(rustfmt): Verify frontmatter is preserved

This is to prove that the frontmatter is preserved.

The choices in tests is intended for showing the different parts of the proposed Style Guide for frontmatters (rust-lang/rust#145617).

While rustfmt is developed in a different repo, work involving upstream integration is blocked on some work that is being finished up in that repo.  I was told that it would be ok to post against this repo in the mean time.

Tracking issue: rust-lang/rust#136889
2025-08-26 14:19:17 +10:00
Stuart Cook
aecc0287ef
Rollup merge of #145535 - lolbinarycat:rustdoc-invalid_html_tags-svg-145529, r=GuillaumeGomez
make rustdoc::invalid_html_tags more robust

best reviewed a commit at a time.

I kept finding more edge case so I ended up having to make quite significant changes to the parser in order to make it preserve state across events and handle multiline attributes correctly.

fixes rust-lang/rust#145529
2025-08-26 14:19:16 +10:00
Stuart Cook
e011dd47ee
Rollup merge of #144885 - zachs18:ptr_guaranteed_cmp_more, r=RalfJung
Implement some more checks in `ptr_guaranteed_cmp`.

* Pointers with different residues modulo their allocations' least common alignment are never equal.
* Pointers to the same static allocation are equal if and only if they have the same offset.
* Pointers to different non-zero-sized static allocations are unequal if both point within their allocation, and not on opposite ends.

Tracking issue for `const_raw_ptr_comparison`: <https://github.com/rust-lang/rust/issues/53020>

This should not affect `is_null`, the only usage of this intrinsic on stable.

Closes https://github.com/rust-lang/rust/issues/144584
2025-08-26 14:19:16 +10:00
Stuart Cook
27415080cc
Rollup merge of #143689 - pmur:murp/external-rt-optimized-compiler-builtins, r=Kobzol,tgross35
Allow linking a prebuilt optimized compiler-rt builtins library

Extend the <target>.optimized-compiler-builtins bootstrap option to accept a path to a prebuilt compiler-rt builtins library, and update compiler-builtins to enable optimized builtins without building compiler-rt builtins.
2025-08-26 14:19:15 +10:00
Tsukasa OI
cb8c905c47 rustc_codegen_ssa: More comprehensive RISC-V ELF flags
This commit implements more conformant, more comprehensive RISC-V ELF
flags handling when generating certain object files directly from rustc.

*   Use "zca" instead of "c"
    The "Zca" extension (a subset of "C") is the minimal configuration
    for compressed instructions to set `EF_RISCV_RVC` flag.
*   Set TSO flag from "ztso"
    The "Ztso" extension denotes that the program depends on the RVTSO
    (Total Store Ordering) memory consistency model, which is stronger
    than the standard RVWMO (Weak Memory Ordering) consistency model and
    on ELF targets, we need to set `EF_RISCV_TSO` flag.
2025-08-26 03:42:37 +00:00
Tsukasa OI
691206470b rustc_codegen_ssa: Fix comment 2025-08-26 03:42:37 +00:00
Zalathar
fcff8f7f5a Assert that LLVM range-attribute values don't exceed 128 bits
The underlying implementation of `LLVMCreateConstantRangeAttribute` assumes
that each of `LowerWords` and `UpperWords` points to enough u64 values to
define an integer of the specified bit-length, and will encounter UB if that is
not the case.

Our safe wrapper function always passes pointers to `[u64; 2]` arrays,
regardless of the bit-length specified. That's fine in practice, because scalar
primitives never exceed 128 bits, but it is technically a soundness hole in a
safe function.

We can close the soundness hole by explicitly asserting `size_bits <= 128`.
This is effectively just a stricter version of the existing check that the
value must be small enough to fit in `c_uint`.
2025-08-26 13:07:19 +10:00
Elias Holzmann
575a90eb87 formatting_options: Make all methods const
Having `const fn`s that take a `mut &` was unstable until Rust 1.83. Because of
this, not all methods on `FormattingOptions` were implemented as `const`. As
this has been stabilized now, there is no reason not to have all methods
`const`.

Thanks to Ternvein for bringing this to my attention (see [1]).

[1]: https://github.com/rust-lang/rust/issues/118117#issuecomment-2687470635
2025-08-26 03:42:52 +02:00
bors
d327d651e2 Auto merge of #145711 - lcnr:non-defining-uses-hir-typeck, r=BoxyUwU
Support non-defining uses in HIR typeck

This changes the impl of `NormalizesTo` for opaque types to be structural during HIR typeck. The previous impl equated region variables of the opaque type key with existing entries which can result in spurious leak check errors and also results in mismatches with MIR borrowck, theoretically causing ICE.

The approach is very similar to rust-lang/rust#145244 in MIR typeck:
- we collect all uses of opaque types during HIR typeck
- before writeback, we search for *defining uses*
  - the opaque type key has fully universal generic args modulo regions
  - the hidden type has no infer vars
- we use these defining uses to compute the concrete type for the opaque and map it to the definition site
- we use this concrete type to check the type of all uses of opaques during HIR typeck. This also constrains infer vars in non-defining uses

Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/135, fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/49.

r? `@BoxyUwU`
2025-08-25 22:56:37 +00:00
Josh Stone
c73d7ae1c6 bootstrap: vendor clippy_test_deps too
This internal crate explicitly separates itself from the `rustc`
workspace, but it is needed for `./x test clippy` to work, including its
dependencies when building from a vendored `rustc-src` tarball.
2025-08-25 15:14:13 -07:00
antoyo
feb42827f1
Merge pull request #753 from rust-lang/sync_from_rust_2025_08_25
Sync from rust 2025/08/25
2025-08-25 17:53:24 -04:00
Zachary S
904e83c53f Only consider auto traits empty for the purposes of omitting vptrs from subtrait vtables 2025-08-25 16:14:15 -05:00
Paul Murphy
148a07cbd0 Refactor *.optimized-compiler-builtins bootstrap options
Create a dedicated enum to abstract the different ways compiler-builtins
can be configured.

This also relaxes build.optimized-compiler-builtins to accept the path
of a library to match the behavior of <target>.optimized-compiler-builtins
override.
2025-08-25 16:08:36 -05:00
Paul Murphy
64cbe52849 Allow linking a prebuilt optimized compiler-rt builtins library
Extend the <target>.optimized-compiler-builtins bootstrap option to accept a
path to a prebuilt compiler-rt builtins library, and update compiler-builtins
to enable optimized builtins without building compiler-rt builtins.
2025-08-25 16:08:35 -05:00
Alex Crichton
85b5ec927b Update wasm-component-ld dependency
Keeping it up-to-date with the latest changes/features.
2025-08-25 13:50:45 -07:00
Sasha Pourcelot
a8e9ca195e Use attribute name in message for "outer attr used as inner attr" errors 2025-08-25 21:31:04 +02:00
J. Neuschäfer
199e54c9d6 Add aarch64_be-unknown-linux-musl target 2025-08-25 21:21:59 +02:00
Jakub Beránek
3145c06431
Do not open every source file twice when reading it 2025-08-25 20:40:11 +02:00
Antoni Boucher
ad99858fd9 Set default codegen backend to gcc 2025-08-25 14:37:58 -04:00
rustbot
f43c6f973b Update books 2025-08-25 19:01:36 +02:00
Antoni Boucher
a53663f6b8 Update to nightly-2025-08-25 2025-08-25 12:20:57 -04:00
Antoni Boucher
02a3cae29c Merge branch 'master' into sync_from_rust_2025_08_25 2025-08-25 12:18:01 -04:00
bors
54c581243c Auto merge of #145472 - Kobzol:bootstrap-dist, r=jieyouxu
Enforce in bootstrap that dist and install must have stage at least 1

This is a continuation of my efforts to fix staging in bootstrap after the stage0 redesign. This PR gets rid of all `compiler_for` usages in the `dist` steps 🎉 The only remaining usages are in the `test` steps, which are my next goal, and which will be the final boss.. both because they are quite tricky, and because most of the the rest of the steps have been already fixed.

The changes are relatively straightforward, `x dist` defaults to stage 2, so in that case we want to use a stage 1 build compiler for everything (except stdlib, but we usually use it even there because of uplifting).

What I didn't fix yet are the docs steps, because they are *very* implicit right now, and fixing them deserves its own PR.

The first commit reverts the tests that I accidentally removed in https://github.com/rust-lang/rust/pull/145340 🤦‍♂️ I did it in this PR to avoid further git conflicts..

Best reviewed commit-by-commit.

r? `@jieyouxu`

try-job: dist-i686-linux
try-job: dist-armhf-linux
try-job: dist-x86_64-linux
try-job: dist-x86_64-msvc
try-job: dist-apple-various
try-job: dist-x86_64-apple
try-job: x86_64-msvc-2
2025-08-25 16:17:56 +00:00
binarycat
f16d1fcb55 use size_hint in attrs_to_doc_fragments 2025-08-25 10:26:22 -05:00
binarycat
2e969c720b rustdoc(opt): build_impl: check document_private earlier 2025-08-25 10:06:16 -05:00
Jieyou Xu
cce9479abd
Wait for DPkg frontend lock when trying to remove packages 2025-08-25 21:09:28 +08:00
Mads Marquart
d262463d53 Don't show warnings from xcrun with -Zverbose-internals
These kinds of warnings can make our test suites fail, so if we want
them, we'll need a different flag.
2025-08-25 14:38:34 +02:00
lcnr
d6a18e1867 change non-defining use error message 2025-08-25 14:20:18 +02:00
lcnr
14b0ba6a05 support non-defining uses in HIR typeck 2025-08-25 14:20:18 +02:00