Commit 7486b9c
committed
Auto merge of rust-lang#59044 - petrochenkov:uiui, r=davidtwco
Filter away test annotations from UI test output
If you worked with UI tests for some time you could notice one issue affecting their readability and also readability of diffs when the tests change.
Look at the output of this test.
```rust
fn main() {
let 1 = 2; //~ ERROR refutable pattern in local binding
}
```
```
error[E0005]: refutable pattern in local binding: `-2147483648i32..=0i32` not covered
--> src/main.rs:2:9
|
2 | let 1 = 2; //~ ERROR refutable pattern in local binding
| ^ pattern `-2147483648i32..=0i32` not covered
error: aborting due to previous error
For more information about this error, try `rustc --explain E0005`.
```
You can see that the "refutable pattern in local binding" is duplicated.
One instance is the actual error, and the second instance is the expected error annotation.
This annotation is useful in the test input, but in the output it clutters the text and makes it harder to see what text refers to actual errors and what is just comments, especially if there are many errors in a single test file.
@estebank [reported](rust-lang#57379 (comment)) using the next trick to avoid the clutter
```rust
fn main() {
let 1 = 2;
//~^ ERROR refutable pattern in local binding
}
```
```
error[E0005]: refutable pattern in local binding: `-2147483648i32..=0i32` not covered
--> src/main.rs:2:9
|
2 | let 1 = 2;
| ^ pattern `-2147483648i32..=0i32` not covered
error: aborting due to previous error
For more information about this error, try `rustc --explain E0005`.
```
, i.e. using `//~^` and placing the annotation one line below will remove the annotation from the output.
However, this doesn't always works (consider errors with multi-line spans), and shouldn't be necessary in general!
`compiletest` could automatically filter away its own annotations from the output instead.
This is exactly what this PR does.
r? @davidtwcoFile tree
2,940 files changed
+7506
-7548
lines changed- src
- test
- rustdoc-ui
- ui-fulldeps
- ui
- alloc-error
- allocator
- asm
- associated-const
- associated-item
- associated-types
- associated-type
- await-keyword
- bad
- bind-by-move
- binop
- block-result
- borrowck
- c-variadic
- cast
- chalkify
- check_match
- closure-expected-type
- closure_context
- closures
- closure-expected-type
- codemap_tests
- coercion
- coherence
- compare-method
- conditional-compilation
- confuse-field-and-method
- const-generics
- consts
- const-eval
- min_const_fn
- miri_unleashed
- cross
- custom-derive
- dep-graph
- deprecation
- derived-errors
- derives
- did_you_mean
- directory_ownership
- disallowed-deconstructing
- discrim
- dollar-crate
- dropck
- dst
- duplicate
- e0119
- editions
- empty
- enum
- error-codes
- exclusive-range
- existential_types
- explicit
- extenv
- extern
- feature-gates
- feature-gate
- fmt
- for
- functional-struct-update
- generator
- generic
- hrtb
- hygiene
- if
- impl-header-lifetime-elision
- impl-trait
- imports
- extern-crate-self
- in-band-lifetimes
- include-macros
- inference
- infinite
- internal
- invalid
- issues
- issue-37311-type-length-limit
- issue-40402-ref-hints
- keyword
- extern
- kindck
- label
- lifetimes
- lifetime-errors
- lint
- liveness
- loops
- lub-glb
- macros
- malformed
- marker_trait_attr
- match
- methods
- mir-dataflow
- mismatched_types
- missing
- missing-items
- mod
- moves
- mut
- namespace
- nll
- closure-requirements
- relate_tys
- ty-outlives
- user-annotations
- non-exhaustive
- not-panic
- object-lifetime
- object-safety
- on-unimplemented
- panic-handler
- panic-runtime
- parser
- macro
- raw
- pattern
- privacy
- restricted
- proc-macro
- pub
- qualified
- range
- reachable
- recursion
- regions
- repr
- reserved
- resolve
- return
- rfc-1937-termination-trait
- rfc-2005-default-binding-mode
- rfc-2008-non-exhaustive
- rfc-2093-infer-outlives
- rfc-2126-crate-paths
- rfc-2126-extern-absolute-paths
- rfc-2166-underscore-imports
- rfc-2361-dbg-macro
- rfc1598-generic-associated-types
- rust-2018
- uniform-paths
- self
- shadowed
- single-use-lifetime
- span
- specialization
- defaultimpl
- stability-attribute
- static
- structs
- str
- suggestions
- dont-suggest-ref
- svh
- symbol-names
- tool-attributes
- traits
- transmute
- trivial-bounds
- try-block
- tuple
- tuple-struct-fields
- typeck
- type
- type-check
- ufcs
- unboxed-closures
- underscore-lifetime
- uninhabited
- union
- unreachable
- unresolved
- unsafe
- unsized-locals
- unused
- use
- use-mod
- variance
- variants
- vec
- wf
- where-clauses
- tools/compiletest/src
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
2,940 files changed
+7506
-7548
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
0 commit comments