This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit dc911b3
authored
Unrolled build for rust-lang#133470
Rollup merge of rust-lang#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 rust-lang#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 rust-lang#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 rust-lang#23616` linking to [There are very few tests for `-Z unpretty` expansion rust-lang#23616][issue-23616]. But this was arguably backwards and somewhat misleading, as noted in [rust-lang#23616](rust-lang#23616 (comment)):
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]: rust-lang#23598
[issue-23616]: rust-lang#23616
### Follow-ups
- [x] Yeet this directive from rustc-dev-guide docs. rust-lang/rustc-dev-guide#2147
[^1]: https://github.com/chmln/sd
r? compilerFile tree
659 files changed
+23
-684
lines changed- src/tools/compiletest/src
- runtest
- tests/ui
- abi
- cross-crate
- extern
- foreign
- array-slice-vec
- associated-types
- attributes
- autoref-autoderef
- bench
- binding
- borrowck
- box
- unit
- builtin-superkinds
- cfg
- closures
- codegen
- coercion
- coherence
- consts
- cross-crate
- deriving
- dropck
- drop
- dynamically-sized-types
- enum
- expr
- if
- extern
- feature-gates
- fn
- for-loop-while
- foreign
- functions-closures
- generics
- higher-ranked/trait-bounds
- hygiene
- imports
- import-crate-with-invalid-spans
- inference
- issues
- iterators
- linkage-attr
- lint
- dead-code
- non-snake-case
- liveness
- loops
- macros
- methods
- modules
- moves
- never_type
- numbers-arithmetic
- object-lifetime
- overloaded
- panic-handler
- parser
- issues
- pattern/usefulness
- privacy
- reachable
- recursion
- regions
- resolve
- return
- self
- simd
- statics
- static
- structs-enums
- structs
- threads-sendsync
- traits
- bound
- default-method
- inheritance
- type-alias
- typeck
- type
- unboxed-closures
- unsafe
- use
- where-clauses
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
659 files changed
+23
-684
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
218 | 217 | | |
219 | 218 | | |
220 | 219 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
128 | | - | |
129 | 127 | | |
130 | 128 | | |
131 | 129 | | |
| |||
218 | 216 | | |
219 | 217 | | |
220 | 218 | | |
221 | | - | |
222 | 219 | | |
223 | 220 | | |
224 | 221 | | |
| |||
278 | 275 | | |
279 | 276 | | |
280 | 277 | | |
281 | | - | |
282 | 278 | | |
283 | 279 | | |
284 | 280 | | |
| |||
425 | 421 | | |
426 | 422 | | |
427 | 423 | | |
428 | | - | |
429 | 424 | | |
430 | 425 | | |
431 | 426 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | 87 | | |
104 | 88 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | 2 | | |
4 | 3 | | |
5 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | 2 | | |
4 | 3 | | |
5 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
| |||
0 commit comments