rust/src
bors 71b68da1bd Auto merge of #139578 - ferrocene:pa-compiletest-edition, r=jieyouxu
Fix breakage when running compiletest with `--test-args=--edition=2015`

Compiletest has an `--edition` flag to change the default edition tests are run with. Unfortunately no test suite successfully executes when that flag is passed. If the edition is set to something greater than 2015 the breakage is expected, since the test suite currently supports only edition 2015 (Ferrous Systems will open an MCP about fixing that soonish). Surprisingly, the test suite is also broken if `--edition=2015` is passed to compiletest. This PR focuses on fixing the latter.

This PR fixes the two categories of failures happening when `--edition=2015` is passed:

* Some edition-specific tests set their edition through `//@ compile-flags` instead of `//@ edition`. Compiletest doesn't parse the compile flags, so it would see no `//@ edition` and add another `--edition` flag, leading to a rustc error.
* Compiletest would add the edition after `//@ compile-flags`, while some tests depend on flags passed to `//@ compile-flags` being the last flags in the rustc invocation.

Note that for the first category, I opted to manually go and replace all `//@ compile-flags` setting an edition with an explicit `//@ edition`. We could've changed compiletest to instead check whether an edition was set in `//@ compile-flags`, but I thought it was better to enforce a consistent way to set the edition in tests.

I also added the edition to the stamp, so that changing `--edition` results in tests being re-executed.

r? `@jieyouxu`
2025-04-11 10:53:45 +00:00
..
bootstrap Rollup merge of #139574 - onur-ozkan:better-channel-handling, r=onur-ozkan 2025-04-11 13:31:48 +10:00
build_helper Add CI metadata to bootstrap metrics 2025-03-27 17:03:08 +01:00
ci Rollup merge of #139481 - Kobzol:post-merge-links, r=marcoieni 2025-04-09 14:52:39 +02:00
doc Auto merge of #139578 - ferrocene:pa-compiletest-edition, r=jieyouxu 2025-04-11 10:53:45 +00:00
etc Rollup merge of #139214 - bjorn3:edition_2024_rustfmt, r=compiler-errors 2025-04-02 13:10:42 +11:00
gcc@13cc824322 Update GCC submodule 2025-03-19 15:35:47 +01:00
librustdoc Rollup merge of #138682 - Alexendoo:extra-symbols, r=fee1-dead 2025-04-11 13:31:44 +10:00
llvm-project@a9865ceca0 Update to LLVM 20.1.2 2025-04-02 20:19:43 +08:00
rustc-std-workspace update rustc-std-workspace crates 2024-11-04 07:45:15 +01:00
rustdoc-json-types rustdoc: Use own logic to print #[repr(..)] attributes in JSON output. 2025-03-22 18:47:12 +00:00
tools Auto merge of #139578 - ferrocene:pa-compiletest-edition, r=jieyouxu 2025-04-11 10:53:45 +00:00
README.md
stage0 bump stage0 2025-04-09 12:29:59 +01:00
version Bump to 1.88.0 2025-03-28 16:53:17 +00: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.