Skip to content

Diffs from UI tests are noisy when line numbers changeΒ #46643

Closed
@petrochenkov

Description

@petrochenkov

Here's a typical example: #46640

One line added at the start of the test source (// must-compile-successfully) causes changes in all line numbers in the test's output.

 warning: unreachable pattern
-  --> $DIR/issue-43253.rs:37:9
+  --> $DIR/issue-43253.rs:39:9
    |
-37 |         9 => {},
+39 |         9 => {},
    |         ^
    |
 note: lint level defined here
-  --> $DIR/issue-43253.rs:12:9
+  --> $DIR/issue-43253.rs:14:9
    |
-12 | #![warn(unreachable_patterns)]
+14 | #![warn(unreachable_patterns)]
    |         ^^^^^^^^^^^^^^^^^^^^
 
 warning: unreachable pattern
-  --> $DIR/issue-43253.rs:43:9
+  --> $DIR/issue-43253.rs:45:9
    |
-43 |         8...9 => {},
+45 |         8...9 => {},
    |         ^^^^^
 
 warning: unreachable pattern
-  --> $DIR/issue-43253.rs:49:9
+  --> $DIR/issue-43253.rs:51:9
    |
-49 |         9...9 => {},
+51 |         9...9 => {},
    |         ^^^^^

There are probably tests in which specific values of line numbers are important, but maybe they can be replaced with some placeholder by default?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-testsuiteArea: The testsuite used to check the correctness of rustcC-feature-requestCategory: A feature request, i.e: not implemented / a PR.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions