Commit Graph

303456 Commits

Author SHA1 Message Date
Makai 0c8485f023 suggest using pub(crate) for E0364 2025-08-13 20:22:18 +08:00
Cathal Mullan ebcbcc8b73 bootstrap: Fix jemalloc 64K page support for aarch64 tools 2025-08-13 13:18:06 +01:00
lcnr 4d841497da add test 2025-08-13 14:10:19 +02:00
lcnr f979bf018f fn new_coroutine_witness_for_coroutine woops 2025-08-13 14:10:19 +02:00
lcnr a95a2ac476 rework add_placeholder_from_predicate_note 2025-08-13 14:03:26 +02:00
lcnr d62e8578c5 also consider HR bounds 2025-08-13 14:03:25 +02:00
lcnr 4e2d420ac5 avoid duplicate error string 2025-08-13 14:03:25 +02:00
bors 350d0ef0ec Auto merge of #144722 - ywxt:parallel-reproducibile, r=SparrowLii
Fix parallel rustc not being reproducible due to unstable sorts of items

Currently, A tuple `(DefId, SymbolName)` is used to determine the order of items in the final binary. However `DefId` is expected as non-deterministic, which leads to some not reproducible issues under parallel compilation. (See https://github.com/rust-lang/rust/issues/140425#issuecomment-3111802148)

Theoretically, we don't need the sorting because the order of these items is already deterministic.

However, codegen tests reply on the same order of items  between in binary and source.

So here we added a new option `codegen-source-order` to indicate whether sorting based on the order in source. For codegen tests, items are sorted according to the order in the source code, whereas in the normal path, no sorting is performed.

Specially, for codegen tests, in preparation for parallel compilation potentially being enabled by default in the future,  we use `Span` replacing `DefId` to make the order deterministic.

This PR is purposed to fix rust-lang/rust#140425, but seemly works on rust-lang/rust#140413 too.

This behavior hasn't added into any test until we have a test suit for the parallel frontend. (See https://github.com/rust-lang/rust/pull/143953)

Related discussion: [Zulip](https://rust-lang.zulipchat.com/#narrow/channel/187679-t-compiler.2Fparallel-rustc/topic/Async.20closures.20not.20reproducible.28.23140425.29) https://github.com/rust-lang/rust/pull/144576

Update rust-lang/rust#113349

r? `@oli-obk`
cc `@lqd` `@cramertj` `@matthiaskrgr` `@Zoxc` `@SparrowLii` `@bjorn3` `@cjgillot` `@joshtriplett`
2025-08-13 10:39:15 +00:00
Jakub Beránek f40a784e12 Remove the libgccjit.so.0 alias and only create the versioned library when installing libgccjit.so 2025-08-13 11:20:53 +02:00
Jakub Beránek 76bc558e7e Make sure that we won't accidentally ship libgccjit.so in the dist component 2025-08-13 10:50:54 +02:00
Jakub Beránek 6e5a6e0211 Install libgccjit into the compiler's sysroot when the GCC codegen backend is enabled 2025-08-13 10:34:58 +02:00
bors 1c9952f4dd Auto merge of #145334 - Kobzol:rollup-fs5a133, r=Kobzol
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#143467 (Add ASCII-related methods from `u8` and `MIN`/`MAX` to `core::ascii::Char`)
 - rust-lang/rust#144519 (Constify `SystemTime` methods)
 - rust-lang/rust#144642 (editorconfig: don't trim trailing whitespace in tests)
 - rust-lang/rust#144870 (Stabilize `path_file_prefix` feature)
 - rust-lang/rust#145269 (Deprecate RUST_TEST_* env variables)
 - rust-lang/rust#145274 (Remove unused `#[must_use]`)
 - rust-lang/rust#145289 (chore(ci): upgrade checkout to v5)
 - rust-lang/rust#145303 (Docs: Link to payload_as_str() from payload().)
 - rust-lang/rust#145308 (Adjust documentation of `dangling`)
 - rust-lang/rust#145320 (Allow cross-compiling the Cranelift dist component)
 - rust-lang/rust#145325 (Add `cast_init` and `cast_uninit` methods for pointers)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-08-13 07:27:12 +00:00
lcnr 3339fa5fcc check args in new_coroutine_witness 2025-08-13 08:53:48 +02:00
Jakub Beránek 2e4e0fcdb9 Bless tests 2025-08-13 08:11:00 +02:00
Jakub Beránek 0acfe86faa Manually optimize steps performed by x clippy ci 2025-08-13 08:11:00 +02:00
Jakub Beránek 92e1541f76 Only check rustc when linting rustc_codegen_gcc 2025-08-13 08:11:00 +02:00
Jakub Beránek 75c5c36c0f Add change tracker entry 2025-08-13 08:11:00 +02:00
Jakub Beránek 27347831bd Lint code in CI using in-tree Clippy 2025-08-13 08:11:00 +02:00
Jakub Beránek 23bb607184 Add more tests 2025-08-13 08:11:00 +02:00
Jakub Beránek 87d92eecf9 Fix staging of linting tools 2025-08-13 08:11:00 +02:00
Jakub Beránek c5dac1aa2a Fix staging for x clippy std 2025-08-13 08:11:00 +02:00
Jakub Beránek 2071a68bd6 Add snapshot test for x clippy std 2025-08-13 08:11:00 +02:00
Jakub Beránek 5ffd5c2ec2 Fix Clippy staging for compiler 2025-08-13 08:11:00 +02:00
Jakub Beránek ba27938c8c Add snapshot test for x clippy ci 2025-08-13 08:11:00 +02:00
Jakub Beránek d2165674e7 Forbid running Clippy on stage 0 2025-08-13 08:11:00 +02:00
Jakub Beránek 5d1535ca29 Implement clippy::CodegenGcc as a separate step
To correctly pass `RustcPrivateCompilers` to it and to avoid running it on `x clippy compiler`.
2025-08-13 08:11:00 +02:00
Jakub Beránek 6e7e243ef2 Prepare standard library for checking rustc in prepare_compiler_for_check 2025-08-13 08:07:55 +02:00
Jakub Beránek 8cb78fe3b6 Rollup merge of #145325 - clarfonthey:cast-init, r=scottmcm
Add `cast_init` and `cast_uninit` methods for pointers

ACP: rust-lang/libs-team#627
Tracking issue: rust-lang/rust#145036

This includes an incredibly low-effort search to find uses that could be switched to using these methods. I only searched for `cast::<\w>` and `cast::<MaybeUninit` because there would otherwise be way too much to look through, and I also didn't modify anything inside submodules/subtrees.
2025-08-13 07:03:52 +02:00
Jakub Beránek c4e82abe93 Rollup merge of #145320 - Kobzol:fix-cranelift-codegen-dist, r=shepmaster
Allow cross-compiling the Cranelift dist component

Should help unblock https://github.com/rust-lang/rust/pull/145252 (https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/macos-13.20shutting.20down/with/534032174).
2025-08-13 07:03:51 +02:00
Jakub Beránek b60d5b3672 Rollup merge of #145308 - giltho:dangling-doc, r=scottmcm
Adjust documentation of `dangling`

I believe the current doc of `dangling` is slightly off as it indicates:
`Note that the pointer value may potentially represent a valid pointer to a T`

The returned pointer has no provenance, so it may not be a valid pointer (except in the case of ZSTs, but I don't think this is what the documentation is trying to warn about).

See: https://rust-lang.zulipchat.com/#narrow/channel/136281-t-opsem/topic/Dangling.20pointers.3A.20definition

The value returned by dangling may never be used to dereference a value that isn't a ZST, even if address equality is detected with that of a valid pointer.
This is a minor fix, but this doc still got me confused for a second
2025-08-13 07:03:51 +02:00
Jakub Beránek a0ed0889bb Rollup merge of #145303 - m-ou-se:payload-as-str-doc, r=jhpratt
Docs: Link to payload_as_str() from payload().
2025-08-13 07:03:50 +02:00
Jakub Beránek 6e14364b5b Rollup merge of #145289 - rejected-l:master, r=Kobzol
chore(ci): upgrade checkout to v5

Maintenance update to actions/checkout@v5 to align with the current runner stack (Node 24); nothing else modified.

Release notes: https://github.com/actions/checkout/releases/tag/v5.0.0
2025-08-13 07:03:49 +02:00
Jakub Beránek c2bc9265f0 Rollup merge of #145274 - compiler-errors:unused-must-use, r=fmease
Remove unused `#[must_use]`

Self-explanatory

Fixes https://github.com/rust-lang/rust/issues/145257
2025-08-13 07:03:49 +02:00
Jakub Beránek 4b1deef096 Rollup merge of #145269 - epage:test-env, r=jhpratt
Deprecate RUST_TEST_* env variables

Like with rust-lang/rust#139224, this is a documentation-only deprecation for now. Over time, we can
- warn and then remove on use of unstable environment variables
- warn on use of stable environment variables (no plan to remove due to compatibility)

Longer term, we expect test runners, like `cargo test`, to provide the necessary mechanisms for environmental or persistent configuration (e.g. using cargo config which supports `.cargo/config.toml` as well as environment variables).

This would include:
- `RUST_TEST_THREADS`
- `RUST_TEST_NOCAPTURE`
- `RUST_TEST_SHUFFLE` (unstable)
- `RUST_TEST_SHUFFLE_SEED` (unstable)

The primary outcomes for this change are
- Reducing the scope of what is expected for custom test harnesses to implement
- Reduce the mechanisms that test runners, like `cargo test`, are expected to track when they are being bypassed to protect against negative interactions, e.g.  `RUST_TEST_NOCAPTURE=1` when json output is being read.

For testing-devex FCP, see rust-lang/testing-devex-team#10

Fixes rust-lang/testing-devex-team#10

History
-------

At each step, I could not find evidence of design discussions on whether to support CLI, env, or both.  The first env variable seems to come from the fact that it was being forked out of an existing env variable that had a much wider scope.

At best, this seems like a way to offer a more persistent configuration for these flags but environment variables hidden away in libtest is a bit clunky and this seems like the wrong layer to handle this problem.

**Originally:** `RUST_THREADS` was respected by the Rust runtime and libextra/test got this for free

**2013:** rust-lang/rust#7335 suggested splitting `RUST_TEST_TASKS` out of `RUST_THREADS`.  In that issue and the implementation (rust-lang/rust#8823).

**2014:** rust-lang/rust#13374 ask for support to disable capturing of stdout/stderr.  `--nocapture` and `RUST_TEST_NOCAPTURE` were added together.

**2015:** rust-lang/rust#23525 renamed `RUST_TEST_TASKS` to `RUST_TEST_THREADS`

**2016:** rust-lang/rust#25636 asked to configure `RUST_TEST_THREADS` via `--test-threads` which was implemented in rust-lang/rust#35414

**2021:** rust-lang/rust#85440 asked for test randomization which was implemented in rust-lang/rust#89082, adding `--shuffle` / RUST_TEST_SHUFFLE` and `--shuffle-seed SEED` / `RUST_TEST_SHUFFLE_SEED`

Potentially relevant issues
---------------------------

- rust-lang/rust#74845
2025-08-13 07:03:48 +02:00
Jakub Beránek ff44871be5 Rollup merge of #144870 - Kivooeo:file_prefix-stabilize, r=tgross35
Stabilize `path_file_prefix` feature

This stabilises `Path::file_prefix`, following the FCP in [tracking issue ](https://github.com/rust-lang/rust/issues/86319)

(FCP ended almost a year ago, so if it's needed for proccess we could rerun it)

Closes: https://github.com/rust-lang/rust/issues/86319
2025-08-13 07:03:47 +02:00
Jakub Beránek 900e568026 Rollup merge of #144642 - lolbinarycat:editorconfig-no-run-make, r=lcnr
editorconfig: don't trim trailing whitespace in tests

some test snapshot files require trailing whitespace, and previously manually editing those snapshot files (as is required for run-make tests and some platform-specific tests) in an editor with editorconfig support would cause that whitespace to be removed, [causing CI failures like this one](https://github.com/rust-lang/rust/pull/144596#issuecomment-3130442996)
2025-08-13 07:03:47 +02:00
Jakub Beránek bd2db284fd Rollup merge of #144519 - clarfonthey:const-system-time, r=jhpratt
Constify `SystemTime` methods

This is separated out from rust-lang/rust#143949 due to the fact that it touches nontrivial system code. While the same arithmetic methods on `Instant` could be made const, since that type explicitly cannot be constructed at const-time, we don't bother. However, due to the fact that `SystemTime::UNIX_EPOCH` exists, it can be useful to create other anchors at other points in time, and thus these methods should be possible to use in const context.

> Side comment: I would honestly like to just move every single implementation which is a thin wrapper over `Duration` or some integer clock into their own module which is tested on all targets, so that we don't have to worry about code for lower-tier targets not being tested. However, the comments in `std::sys_common` pointing out the desire to move things to `std::sys::common` confused me, particularly due to the fact that `std::sys::common` is taken from the hellish asterisk-import of `std::sys::pal::common` and others.
>
> I think that, for trivial types like this, we should just have a platform-independent module that can be tested on all platforms, to both ensure that the code is properly tested regardless of whether higher-tier platforms needed, and to avoid the extreme mental gymnastics required to determine where in the code it lies.
>
> However, since I'm not on any of the teams maintaining this code and am not involved, I'll settle for just copy-pasting like everyone else has been doing. I just want to express how I'm not happy about that.

**Reviewer note: please only pay attention to the last commit of this PR, until its blocker is merged.**

Since this depends on the previous PR:
`@rustbot` blocked
2025-08-13 07:03:46 +02:00
Jakub Beránek fb9cd24d2e Rollup merge of #143467 - ChaiTRex:ascii_char_is_ascii, r=tgross35
Add ASCII-related methods from `u8` and `MIN`/`MAX` to `core::ascii::Char`

* Add ASCII-related methods from `u8` to `core::ascii::Char`.
* Add `core::ascii::Char::MIN` and `core::ascii::Char::MAX`.
2025-08-13 07:03:46 +02:00
bors b1b26b834d Auto merge of #145093 - nikic:dead-on-return, r=nnethercote
Set dead_on_return attribute for indirect arguments

Set the dead_on_return attribute (added in LLVM 21) for arguments that are passed indirectly, but not byval.

This indicates that the value of the argument on return does not matter, enabling additional dead store elimination.

From LangRef:

> This attribute indicates that the memory pointed to by the argument is dead upon function return, both upon normal return and if the calls unwinds, meaning that the caller will not depend on its contents. Stores that would be observable either on the return path or on the unwind path may be elided.
>
> Specifically, the behavior is as-if any memory written through the pointer during the execution of the function is overwritten with a poison value upon function return. The caller may access the memory, but any load not preceded by a store will return poison.
>
> This attribute does not imply aliasing properties. For pointer arguments that do not alias other memory locations, noalias attribute may be used in conjunction. Conversely, this attribute always implies dead_on_unwind.
>
> This attribute cannot be applied to return values.

This fixes parts of https://github.com/rust-lang/rust/issues/96497.
2025-08-13 04:18:43 +00:00
Tim (Theemathas) Chirananthavat 605621224f Make std use the edition 2024 prelude
This seem to have been overlooked in <https://github.com/rust-lang/rust/pull/138162>
2025-08-13 11:16:00 +07:00
ywxt bc8a521619 Fix pgo tests 2025-08-13 09:42:46 +08:00
ywxt 075ce31bd3 Fix parallel rustc not being reproducible due to unstable sorting of items. 2025-08-13 08:59:32 +08:00
Waffle Lapkin 85d1c89e0f fix tail calls to #[track_caller] functions 2025-08-13 02:26:52 +02:00
bors 1553adfe68 Auto merge of #145295 - Kobzol:unify-stages, r=jieyouxu
Consolidate stage directories and group logs in bootstrap

My post-stage-0-redesign bootstrap fixes aren't done yet, but I think that enough steps have been migrated to the new system that it makes sense to actually modify the directories on disk, and what gets printed when bootstrap runs, so that it actually corresponds to the new system. Before, the printed stages didn't always make sense.

This PR:
- Fixes the numbering of `stageN` directories in the build directory. It was not corresponding to the correct stages before; notice that I did not modify `bootstrap/README.md`, as it was essentially describing what happens after this PR (first commit).
- Unifies all steps that output a build group to use the `Builder::msg` method. It's probably not the final stage, and some of the test steps might not be fully accurate yet, because I didn't fix test step numbering yet, but I think that it's a clear improvement from before, and now that everything uses the same method, we can easily make changes across the board, to ensure that it stays unified (second commit).

r? `@jieyouxu`

try-job: dist-x86_64-msvc
try-job: dist-x86_64-linux
2025-08-12 21:06:10 +00:00
ltdk d6945f6d8c Add cast_init and cast_uninit methods for pointers 2025-08-12 16:57:56 -04:00
Michael Goulet 2c0409c7e8 Remove unused must_use 2025-08-12 19:54:57 +00:00
Jakub Beránek 614364c681 Allow cross-compiling the Cranelift dist component 2025-08-12 20:23:35 +02:00
ltdk 7ce620dd7c Constify SystemTime methods 2025-08-12 14:05:47 -04:00
Jakub Beránek 4360c52c4f Add change tracker entry 2025-08-12 18:40:42 +02:00
Jakub Beránek 72b606db89 Replace stage0-tools-bin with stage1-tools-bin 2025-08-12 18:39:09 +02:00