Commit graph

162719 commits

Author SHA1 Message Date
Matthias Krüger
72f60fb700
Rollup merge of #141914 - onur-ozkan:follow-ups, r=Kobzol
redesign stage 0 std follow-ups

Various follow-ups pointed out on Zulip during post-merge discussions of [redesign stage 0 std #119899](https://github.com/rust-lang/rust/pull/119899).

r? `@jieyouxu`

Fixes https://github.com/rust-lang/rust/issues/141902.
Fixes https://github.com/rust-lang/rust/issues/141905.

cc `@jyn514`
2025-06-03 15:00:34 +02:00
Matthias Krüger
5d32b5cad1
Rollup merge of #141861 - jieyouxu:windows-server-2025-20250527, r=Kobzol
Switch `x86_64-msvc-{1,2}` back to Windows Server 2025 images

New Windows Server 2025 images have been released (**20250527.1.0**). New images appear to not exhibit the lack-of-disk-space problem as tracked by rust-lang/rust#141022, and the new runner image's storage capacity appears to be configured correctly.

Windows Server 2025 image version **20250527.1.0** release notes: <https://github.com/actions/runner-images/releases/tag/win25%2F20250527.1>.

Resolves rust-lang/rust#141022.
2025-06-03 15:00:33 +02:00
onur-ozkan
59d993b6c7 use better default stage for check::Std when stage isn't explicit
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-06-03 12:59:33 +03:00
onur-ozkan
9505178d50 run x check on mingw-check-2
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-06-03 08:51:22 +00:00
onur-ozkan
ecc7dde80a handle stage0 on Std::check
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-06-03 08:51:19 +00:00
onur-ozkan
8a65d9febb make library profile to use stage 1 on x check
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-06-03 11:00:33 +03:00
onur-ozkan
4e71f24a6b make x check to use stage0 by default
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-06-03 11:00:30 +03:00
bors
c68032fd4c Auto merge of #141944 - matthiaskrgr:rollup-e7xhp6w, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - rust-lang/rust#140715 (Clarify &mut-methods' docs on sync::OnceLock)
 - rust-lang/rust#141677 (Async drop - type instead of async drop fn, fixes rust-lang/rust#140484)
 - rust-lang/rust#141741 (Overhaul `UsePath`)
 - rust-lang/rust#141873 (Fixed a typo in `ManuallyDrop`'s doc)
 - rust-lang/rust#141876 (Don't declare variables in `ExprKind::Let` in invalid positions)
 - rust-lang/rust#141886 (Add missing 2015 edition directives)
 - rust-lang/rust#141889 (Add missing `dyn` keywords to tests that do not test for them)
 - rust-lang/rust#141891 (Fix borrowck mentioning a name from an external macro we (deliberately) don't save)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-06-03 06:34:44 +00:00
Matthias Krüger
8db6881620
Rollup merge of #141741 - nnethercote:overhaul-UsePath, r=petrochenkov
Overhaul `UsePath`

It currently uses `SmallVec<[Res; 3]>` which is really weird. Details in the individual commits.

r? `@petrochenkov`
2025-06-03 07:03:43 +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
Nicholas Nethercote
8747ccbcdf Overhaul UsePath.
`UsePath` contains a `SmallVec<[Res; 3]>`. This holds up to three `Res`
results, one per namespace (type, value, or macro). `lower_import_res`
takes a `PerNS<Option<Res<NodeId>>>` result and lowers it into the
`SmallVec`. This is pretty weird. The input `PerNS` makes it clear which
`Res` belongs to which namespace, but the `SmallVec` throws that
information away.

And code that operates on the `SmallVec` tends to use iteration (or even
just grabbing the first entry!) without knowing which namespace the
`Res` belongs to. Even weirder! Also, `SmallVec` is an overly flexible
type to use here, because it can contain any number of elements (even
though it's optimized for 3 in this case).

This commit changes `UsePath` so it also contains a
`PerNS<Option<Res<HirId>>>`. This type preserves more information and is
more self-documenting. The commit also changes a lot of the use sites to
access the result for a particular namespace. E.g. if you're looking up
a trait, it will be in the `Res` for the type namespace if it's present;
it's silly to look in the `Res` for the value namespace or macro
namespace. Overall I find the new code much easier to understand.

However, some use sites still iterate. These now use `present_items`
because that filters out the `None` results.

Also, `redundant_pub_crate.rs` gets a bigger change. A
`UseKind:ListStem` item gets no `Res` results, which means the old `all`
call in `is_not_macro_export` would succeed (because `all` succeeds on
an empty iterator) and the `ListStem` would be ignored. This is what we
want, but was more by luck than design. The new code detects `ListStem`
explicitly. The commit generalizes the name of that function
accordingly.

Finally, the commit also removes the `use_path` arena, because
`PerNS<Option<Res>>` impls `Copy` (unlike `SmallVec`) and it can be
allocated in the arena shared by all `Copy` types.
2025-06-03 08:23:21 +10: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
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
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
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
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
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
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
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
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
Tshepang Mbambo
1e77768dd6
Merge pull request #2437 from rust-lang/rustc-pull
Rustc pull update
2025-06-02 11:47:49 +02: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
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
Nicholas Nethercote
176c34a946 Invert the sense of is_not_macro_export.
I find it much easier to think about in the positive sense.
2025-06-02 09:53:35 +10: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
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
Nadrieril
1e169d8dc4 Optionally don't steal the THIR 2025-06-01 19:14:13 +02:00
Jieyou Xu
861ee47551
ci: switch x86_64-msvc-{1,2} back to Windows Server 2025 images
New Windows Server 2025 images have been released (20250527).
2025-06-01 22:47:36 +08:00
Ralf Jung
0884c683ad tweak comment and use a weaker fence 2025-06-01 16:32:18 +02:00
Noratrieb
b88cbed741 Make sure to sync on file-io.rs tokio test
Tokio `AsyncWriteExt::write` doesn't actually ensure that the contents
have written, it just *starts* the write operation. To ensure that the
file has actually been written, we need to `sync_all` first.
2025-06-01 15:43:14 +02:00
onur-ozkan
a71c00a713 resolve if-let-chain FIXME on bootstrap
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-06-01 14:43:02 +03:00
Noratrieb
9f8e157a1f Fix tokio/file-io.rs test relying on read/write not being short
The test did `write` and `read` and hoped that it would read/write
everything, which doesn't always happen and caused CI failures.
Switch to `write_all` and `read_to_end` to make it more reliable.
2025-06-01 11:43:55 +02:00
Stan Manilov
171312aa4e
Add opaque type attributes
This allows for the code to compile on `nightly`.
2025-06-01 10:36:28 +03:00
王宇逸
810a564d9b Fix TLS model on bootstrap for cygwin 2025-06-01 14:56:54 +08:00
The Miri Cronjob Bot
2150180050 Merge from rustc 2025-06-01 05:05:10 +00:00
The Miri Cronjob Bot
de289e45fd Preparing for merge from rustc 2025-06-01 04:57:44 +00:00
Jacob Pratt
ac49339e03
Rollup merge of #141521 - ruancomelli:const-float-rounding, r=RalfJung
Add `const` support for float rounding methods

# Add `const` support for float rounding methods

This PR makes the following float rounding methods `const`:

- `f64::{floor, ceil, trunc, round, round_ties_even}`
- and the corresponding methods for `f16`, `f32` and `f128`

Tracking issue: https://github.com/rust-lang/rust/issues/141555

## Procedure

I followed c09ed3e767 as closely as I could in making float methods `const`, and also received great guidance from https://internals.rust-lang.org/t/const-rounding-methods-in-float-types/22957/3?u=ruancomelli.

## Note

This is my first code contribution to the Rust project, so please let me know if I missed anything - I'd be more than happy to revise and learn more. Thank you for taking the time to review it!
2025-06-01 00:35:53 +02:00
Jacob Pratt
c4ba6b00cc
Rollup merge of #141277 - RalfJung:miri-ci, r=oli-obk
Miri CI: test aarch64-apple-darwin in PRs instead of the x86_64 target

The aarch64 target is more important, and also this ensures we cover all main architectures (x86_64, i686, aarch64) in PR CI.
2025-06-01 00:35:51 +02:00
Jacob Pratt
241ec137fb
Rollup merge of #141072 - Rynibami:stabilize-const-result-flatten, r=jhpratt
Stabilize feature `result_flattening`

Stabilizes the `Result::flatten` method

## Implementations

- [x] Implementation `Result::flatten`: https://github.com/rust-lang/rust/pull/70140
- [x] Implementation `const` `Result::flatten`: https://github.com/rust-lang/rust/pull/130692
- [x] Update stabilization attribute macros (this PR)

## Stabilization process

- [x] Created this PR [suggested](https://github.com/rust-lang/rust/issues/70142#issuecomment-2885044548) by ``@RalfJung``
- [x] FCP (haven't found any, is it applicable here?)
- [ ] Close issue rust-lang/rust#70142
2025-06-01 00:35:50 +02:00
Tshepang Mbambo
755a5e32dd update surname (was lekhonkhobe previously) and email 2025-05-31 23:06:14 +02:00
nora
8e5ca3068c
Merge pull request #2432 from rust-lang/tshepang-patch-1
suggest build/rust-analyzer instead of build-rust-analyzer
2025-05-31 22:53:01 +02:00
Tshepang Mbambo
db4e60286b
replace a broken sentence 2025-05-31 22:30:00 +02:00