mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-03 05:27:36 +00:00
![]() Cleanup: delete `//@ pretty-expanded` directive This PR removes the `//@ pretty-expanded` directive support in compiletest and removes its usage inside ui tests because it does not actually do anything, and its existence is itself misleading. This PR is split into two commits: 1. The first commit just drops `pretty-expanded` directive support in compiletest. 2. The second commit is created by `sd '//@ pretty-expanded.*\n' '' tests/ui/**/*.rs`[^1], reblessing, and slightly adjusting some leading whitespace in a few tests. We can tell this is fully removed because compiletest doesn't complain about unknown directive when running the `ui` test suite. cc #23616 ### History Originally, there was some effort to introduce more test coverage for `-Z unpretty=expanded` (in 2015 this was called `--pretty=expanded`). In [Make it an error to not declare used features #23598][pr-23598], there was a flip from `//@ no-pretty-expanded` (opt-out of `-Z unpretty=expanded` test) to `//@ pretty-expanded` (opt-in to `-Z unpretty=expanded` test). This was needed because back then the dedicated `tests/pretty` ("pretty") test suite did not existed, and the pretty tests were grouped together under `run-pass` tests (I believe the `ui` test suite didn't exist back then either). Unfortunately, in this process the replacement `//@ pretty-expanded` directives contained a `FIXME #23616` linking to [There are very few tests for `-Z unpretty` expansion #23616][issue-23616]. But this was arguably backwards and somewhat misleading, as noted in [#23616](https://github.com/rust-lang/rust/issues/23616#issuecomment-484999901): The attribute is off by default and things just work if you don't test it, people have not been adding the `pretty-expanded` annotation to new tests even if it would work. Which basically renders this useless. ### Current status As of Nov 2024, we have a dedicated `pretty` test suite, and some time over the years the split between `run-pass` into `ui` and `pretty` test suites caused all the `//@ pretty-expanded` in `ui` tests to do absolutely nothing: the compiletest logic for `pretty-expanded` only triggers in the *pretty* test suite, but none of the pretty tests use it. Oops. Nobody remembers this, nobody uses this, it's misleading in ui tests. Let's get rid of this directive altogether. [pr-23598]: https://github.com/rust-lang/rust/pull/23598 [issue-23616]: https://github.com/rust-lang/rust/issues/23616 ### Follow-ups - [x] Yeet this directive from rustc-dev-guide docs. https://github.com/rust-lang/rustc-dev-guide/pull/2147 [^1]: https://github.com/chmln/sd r? compiler |
||
---|---|---|
.. | ||
bad-main.rs | ||
bad-main.stderr | ||
dyn-fn-alignment.rs | ||
expr-fn-panic.rs | ||
expr-fn.rs | ||
fn_def_coercion.rs | ||
fn_def_coercion.stderr | ||
fn_def_opaque_coercion_to_fn_ptr.rs | ||
fn_def_opaque_coercion_to_fn_ptr.stderr | ||
fn_def_opaque_coercion.rs | ||
fn-bad-block-type.rs | ||
fn-bad-block-type.stderr | ||
fn-closure-mutable-capture.rs | ||
fn-closure-mutable-capture.stderr | ||
fn-compare-mismatch.rs | ||
fn-compare-mismatch.stderr | ||
fn-item-type.rs | ||
fn-item-type.stderr | ||
fn-pointer-mismatch.rs | ||
fn-pointer-mismatch.stderr | ||
fn-ptr-trait-int-float-infer-var.rs | ||
fn-ptr-trait.rs | ||
fn-recover-return-sign2.rs | ||
fn-recover-return-sign2.stderr | ||
fn-recover-return-sign.fixed | ||
fn-recover-return-sign.rs | ||
fn-recover-return-sign.stderr | ||
fn-trait-formatting.rs | ||
fn-trait-formatting.stderr | ||
fun-call-variants.rs | ||
implied-bounds-impl-header-projections.rs | ||
implied-bounds-unnorm-associated-type-2.rs | ||
implied-bounds-unnorm-associated-type-2.stderr | ||
implied-bounds-unnorm-associated-type-3.rs | ||
implied-bounds-unnorm-associated-type-4.rs | ||
implied-bounds-unnorm-associated-type-4.stderr | ||
implied-bounds-unnorm-associated-type-5.rs | ||
implied-bounds-unnorm-associated-type-5.stderr | ||
implied-bounds-unnorm-associated-type.rs | ||
implied-bounds-unnorm-associated-type.stderr | ||
issue-1451.rs | ||
issue-1900.rs | ||
issue-1900.stderr | ||
issue-3044.rs | ||
issue-3044.stderr | ||
issue-3099.rs | ||
issue-3099.stderr | ||
issue-3904.rs | ||
issue-39259.rs | ||
issue-39259.stderr | ||
issue-80179.rs | ||
issue-80179.stderr | ||
keyword-order.rs | ||
keyword-order.stderr | ||
nested-function-names-issue-8587.rs | ||
param-mismatch-no-names.rs | ||
param-mismatch-no-names.stderr | ||
signature-error-reporting-under-verbose.rs | ||
signature-error-reporting-under-verbose.stderr | ||
suggest-return-closure.rs | ||
suggest-return-closure.stderr | ||
suggest-return-future.rs | ||
suggest-return-future.stderr |