Commit Graph

291081 Commits

Author SHA1 Message Date
Matthias Krüger
7e8a8c9cb1 Rollup merge of #141921 - ehuss:arm-min-max, r=tgross35
Disable f64 minimum/maximum tests for arm 32

This disables the f64 minimum/maximum tests for the arm-unknown-linux-gnueabihf job. The next release will be supporting cross-compiled doctests, and these tests fail on that platform.

It looks like this was just fixed via https://github.com/llvm/llvm-project/pull/142170, but I assume that will not trickle down to our copy of llvm in the next couple of weeks. Assuming that does get fixed when llvm is updated, then these can be removed.

cc https://github.com/rust-lang/rust/issues/141087
2025-06-03 11:33:35 +02:00
Matthias Krüger
8fbf365f47 Rollup merge of #141898 - LukeMathWalker:patch-1, r=aDotInTheVoid
[rustdoc-json] Implement PartialOrd and Ord for rustdoc_types::Id

This allows consumers to create collections that required an ordering relationship for their keys—e.g. a `BTreeMap`.
2025-06-03 11:33:35 +02:00
Matthias Krüger
1e1e1885a6 Rollup merge of #141881 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer`

r? `@ghost`
2025-06-03 11:33:34 +02:00
Matthias Krüger
ad876cbe86 Rollup merge of #141843 - fee1-dead-contrib:ast_visitor_visit_id, r=oli-obk
Add `visit_id` to ast `Visitor`

This helps with efforts to deduplicate the `MutVisitor` and the `Visitor` code. All users of `Visitor`'s methods that have extra `NodeId` as parameters really just want to visit the id on its own.

Also includes some methods deduplicated and cleaned up as a result of this change.

r? oli-obk
2025-06-03 11:33:33 +02:00
Matthias Krüger
2da4bae07d Rollup merge of #141817 - mati865:fix-system-libs-when-cross-compiling, r=cuviper
rustc_llvm: add Windows system libs only when cross-compiling from Wi…

…ndows

This obviously doesn't work when cross-compiling from Linux.

Split out from: https://github.com/rust-lang/rust/pull/140772

Fixes the issue described at [#general > Problems while trying to cross compile rustc for windows](https://rust-lang.zulipchat.com/#narrow/channel/122651-general/topic/Problems.20while.20trying.20to.20cross.20compile.20rustc.20for.20windows/with/520508561)
2025-06-03 11:33:33 +02:00
Matthias Krüger
807778ab78 Rollup merge of #141554 - Noratrieb:document-codegen-opts-better, r=bjorn3
Improve documentation for codegen options

This adds more information to many different codegen options. It should not add any new guarantees, just document existing behavior.

r? bjorn3
2025-06-03 11:33:32 +02:00
bors
b17dba4518 Auto merge of #141210 - RalfJung:miri-std-doctests, r=saethlin
tools-aux ci runner: also cross-test doctests in Miri

Miri now supports running doctests across different targets. Let's use that to run the std doctests on aarch64-apple-darwin, i686-pc-windows-msvc.

try-job: x86_64-gnu-aux
2025-06-03 03:14:19 +00:00
bors
99426c570e Auto merge of #141750 - Noratrieb:gold-rush, r=bjorn3
Warn when gold was used as the linker

gold has been deprecated recently and is known to behave incorrectly around Rust programs, including miscompiling `#[used(linker)]`. Tell people to switch to a different linker instead.

closes rust-lang/rust#141748

r? bjorn3
2025-06-02 23:56:54 +00:00
bors
5d707b07e4 Auto merge of #141912 - Kobzol:rollup-wurlnsx, r=Kobzol
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#141767 (ci: use free runner for aarch64-gnu-llvm-19-1 PR job)
 - rust-lang/rust#141858 (Fix typo in `StructuralPartialEq` docs)
 - rust-lang/rust#141865 (Optionally don't steal the THIR)
 - rust-lang/rust#141874 (add f16_epsilon and f128_epsilon diagnostic items)
 - rust-lang/rust#141904 (test-float-parse: apply `cfg(not(bootstrap))`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-06-02 19:35:39 +00:00
bors
449c801783 Auto merge of #141906 - chenyukang:rollup-k6v59ty, r=chenyukang
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#141884 (allow macro_use as first segment)
 - rust-lang/rust#141885 ([RTE-484] Update SGX maintainers)
 - rust-lang/rust#141892 (Fix false positive lint error from no_implicit_prelude attr)
 - rust-lang/rust#141894 (rustc-dev-guide subtree update)
 - rust-lang/rust#141895 (tshepang has a new email)
 - rust-lang/rust#141897 (Fix citool tests when executed locally)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-06-02 16:15:30 +00:00
Eric Huss
b0041b8a05 Disable f64 minimum/maximum tests for arm 32
This disables the f64 minimum/maximum tests for the
arm-unknown-linux-gnueabihf job. The next release will be supporting
cross-compiled doctests, and these tests fail on that platform.

It looks like this was just fixed via
https://github.com/llvm/llvm-project/pull/142170, but I assume that will
not trickle down to our copy of llvm in the next couple of weeks.
Assuming that does get fixed when llvm is updated, then these can be
removed.

cc https://github.com/rust-lang/rust/issues/141087
2025-06-02 09:08:01 -07:00
Jakub Beránek
44ba243252 Rollup merge of #141904 - jieyouxu:test-float-parse, r=Mark-Simulacrum
test-float-parse: apply `cfg(not(bootstrap))`

Prior to stage 0 redesign, `test-float-parse` ran against in-tree std but now it runs against beta std. `f16::FromStr` is only present in in-tree std and not yet beta std, so apply `cfg(not(bootstrap))` gating to unbrick `./x check --stage=0`.

Fixes rust-lang/rust#141900.

`./x check --stage=0` in CI is intended for follow-up.

r? `@Mark-Simulacrum` (or bootstrap/libs)
cc `@tgross35`
2025-06-02 15:19:20 +02:00
Jakub Beránek
b2743c7fb1 Rollup merge of #141874 - usamoi:eps, r=tgross35
add f16_epsilon and f128_epsilon diagnostic items

cc https://github.com/rust-lang/rust/issues/116909
r? ``@tgross35``
2025-06-02 15:19:19 +02:00
Jakub Beránek
f8e756b0eb Rollup merge of #141865 - Nadrieril:dont-steal-thir, r=oli-obk
Optionally don't steal the THIR

The THIR being stolen is a recurrent pain for authors of rustc drivers. This makes it optional, so that the `thir_body` query can still be used after analysis of the crate has completed.
2025-06-02 15:19:19 +02:00
Jakub Beránek
aeb72a0669 Rollup merge of #141858 - zacryol:spe-docs-typo, r=aDotInTheVoid
Fix typo in `StructuralPartialEq` docs

`equialent` => `equivalent`
2025-06-02 15:19:18 +02:00
Jakub Beránek
2cb5b0deb9 Rollup merge of #141767 - marcoieni:free-pr-job, r=Kobzol
ci: use free runner for aarch64-gnu-llvm-19-1 PR job
2025-06-02 15:19:17 +02:00
Yukang
8f240de112 Rollup merge of #141897 - Kobzol:fix-citool-tests, r=marcoieni
Fix citool tests when executed locally

They couldn't be executed locally before due to some additional environment reads.

I also investigated the annoying rebuilds that we see on CI all the time, and they are caused by `ring`'s build script. It should be fixed in the next ring release (https://github.com/briansmith/ring/issues/2525), so we can just wait for that and then update `ring`.

r? `@marcoieni`
2025-06-02 20:57:44 +08:00
Yukang
ad00cbe860 Rollup merge of #141895 - tshepang:new-address, r=jieyouxu
tshepang has a new email
2025-06-02 20:57:43 +08:00
Yukang
a501cc7a19 Rollup merge of #141894 - tshepang:rdg-push, r=jieyouxu
rustc-dev-guide subtree update

r? `@ghost`
2025-06-02 20:57:42 +08:00
Yukang
1931272796 Rollup merge of #141892 - chenyukang:yukang-fix-141785-extern-crate, r=petrochenkov
Fix false positive lint error from no_implicit_prelude attr

Fixes rust-lang/rust#141785

r? `@petrochenkov`
2025-06-02 20:57:42 +08:00
Yukang
05ee4a3825 Rollup merge of #141885 - raoulstrackx:raoul/rte-484-update_sgx_maintainers, r=Noratrieb
[RTE-484] Update SGX maintainers

`@mzohreva` is no longer with Fortanix. We need to change the SGX maintainers accordingly.
2025-06-02 20:57:41 +08:00
Yukang
8d9fc03773 Rollup merge of #141884 - bvanjoi:issue-140255, r=petrochenkov
allow macro_use as first segment

Fixes rust-lang/rust#140255

This issue may raise a question: It's reasonable an external crate name or import target be legally named `macro_use`?
2025-06-02 20:57:41 +08:00
bors
2398bd60ef Auto merge of #141814 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update

r? `@Manishearth`
2025-06-02 12:56:24 +00:00
Jieyou Xu
8788b6a4ad test-float-parse: apply cfg(not(bootstrap))
Prior to stage 0 redesign, `test-float-parse` ran against in-tree std
but now it runs against beta std. `f16::FromStr` were only present in
in-tree std and not yet beta std, so apply `cfg(not(bootstrap))` gating
to unbrick `./x check --stage=0`.
2025-06-02 20:45:14 +08:00
Luca Palmieri
6be3c3ceb7 [rustdoc-json] Implement PartialOrd and Ord for rustdoc_types::Id 2025-06-02 13:43:51 +02:00
Jakub Beránek
28cf702292 Fix citool tests when executed ocally
They couldn't be executed locally before due to some additional environment reads.
2025-06-02 13:34:29 +02:00
Tshepang Mbambo
69e358393a tshepang has a new email 2025-06-02 12:13:08 +02:00
Tshepang Mbambo
c197636ca8 Merge pull request #2386 from Lysxia/fix-link
Fix link to GatherBorrows
2025-06-02 12:08:03 +02:00
Tshepang Mbambo
0e379a6082 Merge pull request #2435 from smanilov/patch-19
Add opaque type attributes
2025-06-02 11:55:19 +02:00
yukang
7167e7ce06 Fix false positive lint error from no_implicit_prelude attr 2025-06-02 17:49:01 +08:00
Tshepang Mbambo
1e77768dd6 Merge pull request #2437 from rust-lang/rustc-pull
Rustc pull update
2025-06-02 11:47:49 +02:00
Tshepang Mbambo
df2d8f1271 Merge pull request #2438 from smanilov/patch-20
Trivial: fix typo (change `foo` to `bar`)
2025-06-02 11:27:24 +02:00
bohan
9b94caef4f allow macro_use as first segment 2025-06-02 16:30:21 +08:00
Stan Manilov
2556364580 Trivial: fix typo (change foo to bar)
There is no `foo` symbol in the preceding example. I assume the method `bar` is meant.
2025-06-02 10:52:31 +03:00
bors
52882f6522 Auto merge of #119899 - onur-ozkan:redesign-stage0-std, r=albertlarsan68,jieyouxu,mark-simulacrum,kobzol,jyn514,Noratrieb,WaffleLapkin,RalfJung,bjorn3
redesign stage 0 std

### Summary

**Blog post: https://blog.rust-lang.org/inside-rust/2025/05/29/redesigning-the-initial-bootstrap-sequence/**

This PR changes how bootstrap builds the stage 1 compiler by switching to precompiled stage 0 standard library instead of building the in-tree one. The goal was to update bootstrap to use the beta standard library at stage 0 rather than compiling it from source (see the motivation at https://github.com/rust-lang/compiler-team/issues/619).

Previously, to build a stage 1 compiler bootstrap followed this path:

```
download stage0 compiler -> build in-tree std -> compile stage1 compiler with in-tree std
```

With this PR, the new path is:

```
download stage0 compiler -> compile stage1 compiler with precompiled stage0 std
```

This also means that `cfg(bootstrap)`/`cfg(not(bootstrap))` is no longer needed for library development.

### Building "library"

Since stage0 `std` is no longer in-tree `x build/test/check library --stage 0` is now no-op. The minimum supported stage to build `std` is now 1. For the same reason, default stage values in the library profile is no longer 0.

Because building the in-tree library now requires a stage1 compiler, I highly recommend library developers to enable `download-rustc` to speed up compilation time.

<hr>

**Blog post: https://blog.rust-lang.org/inside-rust/2025/05/29/redesigning-the-initial-bootstrap-sequence/**

If you encounter a bug or unexpected results please open a topic in the [#t-infra/bootstrap](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap) Zulip channel or create a [bootstrap issue](https://github.com/rust-lang/rust/issues/new?template=bootstrap.md).

(Review thread: https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Review.20thread.3A.20stage.200.20redesign.20PR/with/508271433)

~~Blocked on https://github.com/rust-lang/rust/pull/122709~~

try-job: dist-x86_64-linux
try-job: `x86_64-msvc*`
try-job: `x86_64-apple-*`
try-job: `aarch64-apple`
try-job: x86_64-gnu
try-job: `x86_64-gnu-llvm*`
2025-06-02 07:49:18 +00:00
bors
91fad92585 Auto merge of #141773 - oli-obk:coro-borrow-parallel-loop, r=compiler-errors
Merge coroutine obligation checking into borrowck parallel loop

r? `@ghost`

attempts at increasing parallelism in parallel rustc by merging parallel blocks that run in sequence
2025-06-02 04:18:14 +00:00
The rustc-dev-guide Cronjob Bot
530d4b3f05 Merge from rustc 2025-06-02 04:08:41 +00:00
The rustc-dev-guide Cronjob Bot
a139353362 Preparing for merge from rustc 2025-06-02 04:08:33 +00:00
bors
2fc3deed9f Auto merge of #141760 - bjorn3:intrinsic_rework_part2, r=fee1-dead
Improve intrinsic handling in cg_ssa (part 2)

* Avoid computing function type and signature for intrinsics where possible
* Nicer handling of bool returning intrinsics

Follow up to https://github.com/rust-lang/rust/pull/141404
2025-06-02 00:57:45 +00:00
usamoi
d948907f80 add f16_epsilon and f128_epsilon 2025-06-02 08:00:15 +08:00
Noratrieb
198e89b533 Improve documentation for codegen options
This adds more information to many different codegen options. It should
not add any new guarantees, just document existing behavior.
2025-06-01 22:21:29 +02:00
bors
99e7c15e81 Auto merge of #141869 - GuillaumeGomez:rollup-vicg807, r=GuillaumeGomez
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#140370 (Improve diagnostics for usage of qualified paths within tuple struct exprs/pats)
 - rust-lang/rust#141224 (terminology: allocated object → allocation)
 - rust-lang/rust#141622 (implement `va_arg` for `powerpc`)
 - rust-lang/rust#141666 (source_span_for_markdown_range: fix utf8 violation)
 - rust-lang/rust#141789 (Exclude `CARGO_HOME` from `generate-copyright` in-tree determination)
 - rust-lang/rust#141823 (Drive-by refactor: use `OnceCell` for the reverse region SCC graph)
 - rust-lang/rust#141834 (Add unimplemented `current_dll_path()` for WASI)
 - rust-lang/rust#141846 (Fix TLS model on bootstrap for cygwin)
 - rust-lang/rust#141852 (resolve if-let-chain FIXME on bootstrap)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-06-01 18:26:36 +00:00
Guillaume Gomez
90f418fbb3 Rollup merge of #141852 - onur-ozkan:resolve-if-let-fixme, r=jieyouxu
resolve if-let-chain FIXME on bootstrap

self-explanatory
2025-06-01 19:35:46 +02:00
Guillaume Gomez
f714b34000 Rollup merge of #141846 - Berrysoft:cygwin-bootstrap-tls, r=mati865
Fix TLS model on bootstrap for cygwin

There aren't other targets that both use emutls and enable `has_thread_local`, so cygwin triggers this bug first.

r? mati865

See: https://github.com/rust-lang/rust/pull/141719#issuecomment-2925445263

``@jeremyd2019`` Could you check if this PR fixes the issue? I just found my pre-built stage-0 rustc was too old to build the current rustc :(
2025-06-01 19:35:45 +02:00
Guillaume Gomez
fc32992a00 Rollup merge of #141834 - Timmmm:user/timh/wasi, r=Noratrieb
Add unimplemented `current_dll_path()` for WASI

This is the only change needed to Rust to allow compiling rustfmt for WASI (rustfmt uses some internal rustc crates).
2025-06-01 19:35:45 +02:00
Guillaume Gomez
b0b98a078d Rollup merge of #141823 - amandasystems:reverse_scc_graph_once_cell, r=jieyouxu
Drive-by refactor: use `OnceCell` for the reverse region SCC graph

During region inference, the reverse SCC region graph is sometimes computed lazily. This changes the implementation for that from using an `Option` to a `OnceCell` which clearly communicates the intention and simplifies the code somewhat.

There shouldn't be any performance impact, except that this pulls the computation of the reverse SCC graph slightly later than before, and so may avoid computing it in some instances.

Note that this changes a mutable reference into an immutable (interior mutable) one.
2025-06-01 19:35:44 +02:00
Guillaume Gomez
fec5c8fd7c Rollup merge of #141789 - ferrocene:hoverbear/exclude-cargo-home-from-in-tree-consideration, r=clubby789
Exclude `CARGO_HOME` from `generate-copyright` in-tree determination

On Ferrocene, we noticed that in our releases the out-of-tree notices were not being included. When `x.py run generate-copyright` was ran on local development machines, it worked fine.

After some investigations ``@tshepang`` and I determined that the problem was that the cargo registry (located in `CARGO_HOME`) started with the source directory on CI jobs, and was being excluded by this line:

15825b7161/src/tools/generate-copyright/src/cargo_metadata.rs (L85-L88)

In Ferrocene's `run.sh` we set `CARGO_HOME` to be `build/cargo-home`: 96a45dd9a1/ferrocene/ci/run.sh (L34-L46) which caused this issue.

This PR passes the `CARGO_HOME` variable to the `generate-copyright` tool and expands the consideration of in-tree-ness to be aware of `CARGO_HOME`. It is an upstreaming of https://github.com/ferrocene/ferrocene/pull/1491.

## Testing

Run `CARGO_HOME=build/cargo-home ./x.py run generate-copyright` on `master`, then check `build/host/doc/COPYRIGHT` and look for out of tree dependencies (at the bottom).

Then, try running the same command in this branch.
2025-06-01 19:35:44 +02:00
Guillaume Gomez
d843809b9d Rollup merge of #141666 - lolbinarycat:rustdoc-source_span_for_markdown_range-bug-141665, r=GuillaumeGomez
source_span_for_markdown_range: fix utf8 violation

it is non-trivial to reproduce this bug through rustdoc, which uses this function less than clippy, so the regression test was added as a unit test instead of an integration test.

fixes https://github.com/rust-lang/rust/issues/141665

r? ``@GuillaumeGomez``
2025-06-01 19:35:43 +02:00
Guillaume Gomez
cf4fbc0695 Rollup merge of #141622 - folkertdev:powerpc-va_arg, r=workingjubilee
implement `va_arg` for `powerpc`

tracking issue: https://github.com/rust-lang/rust/issues/44930

The llvm `va_arg` implementation is well-known to have serious limitations. Some planned changes to rust's `VaList` make it much more likely that LLVM miscompiles `va_arg`, so this PR adds support for the various powerpc targets. Now at least the targets that `core` has explicit support for will continue to work.

For `powerpc` (the 32-bit variant) this implementation also fixes a bug where only up to 20 variadic arguments were supported.

Locally (with qemu), these targets now pass the tests in https://github.com/rust-lang/rust/blob/master/tests/run-make/c-link-to-rust-va-list-fn/checkrust.rs. That test does not actually run for the powerpc targets in CI though.

The implementation is based on clang:

- handling of big endian architectures 3c8089d1ea/clang/lib/CodeGen/ABIInfoImpl.cpp (L191-L193)
- 64-bit 3c8089d1ea/clang/lib/CodeGen/Targets/PPC.cpp (L969)
- 32-bit 3c8089d1ea/clang/lib/CodeGen/Targets/PPC.cpp (L430)

cc `@daltenty` (target maintainer)
r? `@workingjubilee`
`@rustbot` label: +F-c_variadic
2025-06-01 19:35:42 +02:00
Guillaume Gomez
335232d958 Rollup merge of #141224 - RalfJung:no-objects, r=traviscross
terminology: allocated object → allocation

Rust does not have "objects" in memory so "allocated object" is a somewhat odd name. I am not sure where the term comes from. "object" has been used to refer to allocations already [in 1.0 docs](https://doc.rust-lang.org/1.0.0/std/primitive.pointer.html#method.offset); this was apparently later changed to "allocated object".

"Allocation" is already the terminology used in Miri and in the [UCG](https://rust-lang.github.io/unsafe-code-guidelines/glossary.html#allocation). We should properly move to that terminology, and avoid any confusion about whether Rust has an object memory model. (It does not. Memory contains untyped bytes.)

Cc ``@rust-lang/opsem`` ``@rust-lang/lang``
2025-06-01 19:35:42 +02:00