]> git.lizzy.rs Git - rust.git/commit - compiler/rustc_parse/src/lexer/unicode_chars.rs
Auto merge of #105924 - TimNN:ui-remap, r=Mark-Simulacrum
authorbors <bors@rust-lang.org>
Sat, 21 Jan 2023 17:44:20 +0000 (17:44 +0000)
committerbors <bors@rust-lang.org>
Sat, 21 Jan 2023 17:44:20 +0000 (17:44 +0000)
commit52372f9c71d8ade4cb815524f179119656f0aa2e
tree51c43eee96f5468666e9e8df4eff85cb3ce66f22
parent005fc0f00f2d4ceaf523b67a8f9c5665b8ac5baf
parentcd1d0bc20cd2c18ec844f6447396dadf90b762e9
Auto merge of #105924 - TimNN:ui-remap, r=Mark-Simulacrum

Remap paths in UI tests by default

If you think this needs further discussions / something RFC-like, please let me know the best forum for that.

This PR runs UI tests with a remapped "src base" directory by default.

Why? Because some UI tests currently depend on the length of the absolute path to the `src/test/ui` directory. Remapping makes the tests independent of the absolute path.

The path to the source file (which is absolute on CI) is part of the type name of closures. `rustc` diagnostic output depends on the length of type names (long type names are truncated). So a long absolute path leads to long closure type names, which leads to truncation and changed diagnostics.

(I initially tried just disabling type name truncation, but that made some error messages stupid long (thousands of characters, IIRC)).

Additional changes:

* All boolean `compiletest` directives now support explicit `no-` versions to disable them.
* Adapt existing tests when necessary:
  * Disable remapping for individual tests that fail with it enabled (when there's no obvious alternative fix).
  * For tests that already check something remapping related switch to the new option unless we gain something significant by keeping the manual remap.

Passed Windows CI in https://github.com/rust-lang/rust/actions/runs/3933100590
src/tools/compiletest/src/header.rs