rust/src
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
..
bootstrap Rollup merge of #145320 - Kobzol:fix-cranelift-codegen-dist, r=shepmaster 2025-08-13 07:03:51 +02:00
build_helper integrate build_helper::npm into js checks and package.json usage 2025-07-19 14:56:42 -05:00
ci Auto merge of #145295 - Kobzol:unify-stages, r=jieyouxu 2025-08-12 21:06:10 +00:00
doc Auto merge of #144722 - ywxt:parallel-reproducibile, r=SparrowLii 2025-08-13 10:39:15 +00:00
etc update completions 2025-07-19 14:52:31 -05:00
gcc@04ce66d8c9 Update src/gcc submodule to 04ce66d8c918de9273bd7101638ad8724edf5e21 2025-05-14 18:02:02 +02:00
librustdoc Rollup merge of #145216 - eval-exec:fix-145125-enum-rustdoc, r=fmease 2025-08-12 20:37:52 +10:00
llvm-project@d35840afa5 Update to LLVM 21 2025-08-01 10:17:04 +02:00
rustc-std-workspace update rustc-std-workspace crates 2024-11-04 07:45:15 +01:00
rustdoc-json-types rustdoc-json: Move #[macro_export] from Other to it's own variant 2025-07-30 19:57:32 +00:00
tools Auto merge of #144722 - ywxt:parallel-reproducibile, r=SparrowLii 2025-08-13 10:39:15 +00:00
README.md
stage0 bump stage0 2025-08-06 13:22:38 +01:00
version bump version 2025-08-01 09:04:01 +01:00

This directory contains some source code for the Rust project, including:

  • The bootstrapping build system
  • Various submodules for tools, like cargo, tidy, etc.

For more information on how various parts of the compiler work, see the rustc dev guide.