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 Show number in error message even for one error 2023-11-24 19:15:52 +01:00
dyn-fn-alignment.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
expr-fn-panic.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
expr-fn.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
fn_def_coercion.rs Add some FnDef LUB coercion tests 2024-04-24 10:05:32 +00:00
fn_def_coercion.stderr Add some FnDef LUB coercion tests 2024-04-24 10:05:32 +00:00
fn_def_opaque_coercion_to_fn_ptr.rs Allow coercing functions whose signature differs in opaque types in their defining scope into a shared function pointer type 2024-04-23 14:38:17 +00:00
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 Register hidden types when equating function definitions in coercion 2024-04-24 10:05:33 +00:00
fn-bad-block-type.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
fn-bad-block-type.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
fn-closure-mutable-capture.rs
fn-closure-mutable-capture.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
fn-compare-mismatch.rs
fn-compare-mismatch.stderr improve fn pointer notes 2023-01-26 05:07:34 +00:00
fn-item-type.rs Modify primary span label for E0308 2023-01-30 20:12:19 +00:00
fn-item-type.stderr Tweak parameter mismatch explanation to not say unknown 2024-11-25 03:04:07 +00:00
fn-pointer-mismatch.rs recurse into refs when comparing tys for diagnostics 2023-12-07 23:00:46 -05:00
fn-pointer-mismatch.stderr recurse into refs when comparing tys for diagnostics 2023-12-07 23:00:46 -05:00
fn-ptr-trait-int-float-infer-var.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
fn-ptr-trait.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
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 [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
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 Pretty print Fn traits in rustc_on_unimplemented 2023-11-02 20:57:05 +00:00
fn-trait-formatting.stderr Use parenthetical notation for Fn traits 2024-05-29 22:26:54 +00:00
fun-call-variants.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
implied-bounds-impl-header-projections.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
implied-bounds-unnorm-associated-type-2.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
implied-bounds-unnorm-associated-type-2.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
implied-bounds-unnorm-associated-type-3.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
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 [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
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 Move some tests 2024-03-31 14:58:17 -03:00
issue-1900.stderr Move some tests 2024-03-31 14:58:17 -03:00
issue-3044.rs
issue-3044.stderr Use ordinal number in argument error 2024-07-14 13:50:09 +09:00
issue-3099.rs Move tests 2023-05-08 17:58:01 -03:00
issue-3099.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-3904.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
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 [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
keyword-order.stderr Add explanatory note to 'expected item' error 2023-09-06 09:05:07 +05:30
nested-function-names-issue-8587.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
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 [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
signature-error-reporting-under-verbose.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
suggest-return-closure.rs Modify find_expr from Span to better account for closures 2024-04-24 22:21:13 +00:00
suggest-return-closure.stderr More accurate mutability suggestion 2024-07-04 05:36:34 +00:00
suggest-return-future.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
suggest-return-future.stderr