Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to anonymize line numbers #3

Merged
merged 2 commits into from
Jun 13, 2019

Commits on Jun 13, 2019

  1. Add option to anonymize line numbers

    With the current diagnostics emitter of Rust, the `-Z ui-testing` flag
    allows to 'anonymize' line numbers in the UI test output.
    
    This means that a line such as:
    
         2 |     concat!(b'f');
    
    is turned into:
    
        LL |     concat!(b'f');
    
    This is done because it makes the diff of UI test output changes much
    less noisy.
    
    To support this with `annotate-snippet`, we add a second parameter to
    `DisplayListFormatter` that, when true, replaces the line numbers in the
    left column with the text `LL`. The replacement text is always `LL` and
    it does not affect the initial location line number.
    
    In the new `annotate-snippet` emitter in rustc, we can then use this
    parameter depending on whether the `-Z ui-testing` flag is set or not.
    phansch committed Jun 13, 2019
    Configuration menu
    Copy the full SHA
    e353781 View commit details
    Browse the repository at this point in the history
  2. Replace magic constant '2'

    phansch committed Jun 13, 2019
    Configuration menu
    Copy the full SHA
    d6c36a6 View commit details
    Browse the repository at this point in the history