rust/tests/ui/fn
Guillaume Gomez 0d9a57d979
Rollup merge of #133470 - jieyouxu:ugly, r=compiler-errors
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
2024-11-26 15:32:18 +01:00
..
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 show fnsig's output when there is difference 2024-07-06 23:29:58 +08:00
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 Tweak parameter mismatch explanation to not say unknown 2024-11-25 03:04:07 +00:00
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 Make parse error suggestions verbose and fix spans 2024-07-12 03:02:57 +00:00
fn-recover-return-sign.fixed Make parse error suggestions verbose and fix spans 2024-07-12 03:02:57 +00:00
fn-recover-return-sign.rs
fn-recover-return-sign.stderr Make parse error suggestions verbose and fix spans 2024-07-12 03:02:57 +00:00
fn-trait-formatting.rs
fn-trait-formatting.stderr Use parenthetical notation for Fn traits 2024-05-29 22:26:54 +00:00
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 Peel off explicit (or implicit) deref before suggesting clone on move error in borrowck 2024-07-26 14:41:56 -04:00
implied-bounds-unnorm-associated-type-5.rs Enforce supertrait outlives obligations hold when confirming impl 2024-08-05 09:55:14 -04:00
implied-bounds-unnorm-associated-type-5.stderr Enforce supertrait outlives obligations hold when confirming impl 2024-08-05 09:55:14 -04:00
implied-bounds-unnorm-associated-type.rs
implied-bounds-unnorm-associated-type.stderr Peel off explicit (or implicit) deref before suggesting clone on move error in borrowck 2024-07-26 14:41:56 -04:00
issue-1451.rs tests: remove //@ pretty-expanded usages 2024-11-26 02:50:48 +08:00
issue-1900.rs
issue-1900.stderr
issue-3044.rs
issue-3044.stderr Use ordinal number in argument error 2024-07-14 13:50:09 +09:00
issue-3099.rs
issue-3099.stderr
issue-3904.rs
issue-39259.rs Rename HIR TypeBinding to AssocItemConstraint and related cleanup 2024-05-30 22:52:33 +02:00
issue-39259.stderr Auto merge of #125778 - estebank:issue-67100, r=compiler-errors 2024-06-03 08:14:03 +00:00
issue-80179.rs
issue-80179.stderr
keyword-order.rs
keyword-order.stderr
nested-function-names-issue-8587.rs
param-mismatch-no-names.rs Tweak parameter mismatch explanation to not say unknown 2024-11-25 03:04:07 +00:00
param-mismatch-no-names.stderr Tweak parameter mismatch explanation to not say unknown 2024-11-25 03:04:07 +00:00
signature-error-reporting-under-verbose.rs
signature-error-reporting-under-verbose.stderr
suggest-return-closure.rs
suggest-return-closure.stderr More accurate mutability suggestion 2024-07-04 05:36:34 +00:00
suggest-return-future.rs
suggest-return-future.stderr