rust/src
Stuart Cook 24873aac00
Rollup merge of #147955 - Zalathar:handlers, r=jieyouxu
compiletest: Migrate `TestProps` directive handling to a system of named handlers

One of the very silly things about directive processing in compiletest is that for each directive in the test file, we proceed to check it against dozens of different directive names in linear sequence, without any kind of indexed lookup, and without any early-exit after a known directive name is found (unless a panic occurs).

This PR is a big step away from that, by taking the `iter_directives` loop in `TestProps::load_from` and making all of its directive processing dispatch to a hashtable of individual name-specific handlers instead.

---

The handler system is set up in a way that should allow us to add capabilities or change the implementation as needed, without having to mass-modify the existing handlers (e.g. this is why the `handler` and `multi_handler` functions are used).

---

This PR is focused on mass-migrating all of the `TestProps` directive processing into handlers. Most of the resulting handlers could obviously be simplified further (e.g. by avoiding the redundant name checks that were needed in the pre-migration code), but I've avoided doing any such simplifications in this PR to keep its scope limited and make reviewing easier.

The patches in this PR have been arranged so that the main migration can be inspected with `git diff --color-moved --color-moved-ws=ignore-all-space` to verify that it moves all of the relevant lines intact, without modifying or discarding any of them.

r? jieyouxu
2025-11-11 21:09:36 +11:00
..
bootstrap Auto merge of #148685 - Zalathar:lldb-python, r=jieyouxu 2025-11-10 05:45:10 +00:00
build_helper Include additional hashes in src/stage0 2025-09-27 08:43:22 -04:00
ci Change default branch to main 2025-11-10 10:21:34 +01:00
doc Auto merge of #148435 - ZhongyaoChen:promote-riscv64a23-to-tier2, r=jieyouxu 2025-11-09 19:57:56 +00:00
etc Auto merge of #148685 - Zalathar:lldb-python, r=jieyouxu 2025-11-10 05:45:10 +00:00
gcc@4e995bd73c Update GCC submodule 2025-08-26 18:09:42 +02:00
librustdoc Rollup merge of #147833 - aDotInTheVoid:rdj-shuffle, r=camelid 2025-11-11 21:09:35 +11:00
llvm-project@16b5ac8b0a Update LLVM to 21.1.5 2025-11-08 10:21:22 +08:00
rustc-std-workspace Generalize branch references to HEAD 2025-11-02 11:15:55 +01:00
rustdoc-json-types Add new doc(attribute = "...") attribute 2025-08-28 15:56:29 +02:00
tools Rollup merge of #147955 - Zalathar:handlers, r=jieyouxu 2025-11-11 21:09:36 +11:00
README.md
stage0 Change default branch to main 2025-11-10 10:21:34 +01:00
version Bump the version number to 1.93.0 2025-10-24 11:12:06 -07: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.