- Notifications
You must be signed in to change notification settings - Fork47
Add option to anonymize line numbers#3
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
phansch commentedJun 9, 2019
One of my small gripes with Rust is that it doesn't have keyword arguments (yet?). That would make passing these boolean options much more understandable at the call sites. I'm not sure if there's currently a clearer way? |
oli-obk commentedJun 11, 2019
you can always create structs with appropriate field names ;) |
Uh oh!
There was an error while loading.Please reload this page.
With the current diagnostics emitter of Rust, the `-Z ui-testing` flagallows 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 muchless noisy.To support this with `annotate-snippet`, we add a second parameter to`DisplayListFormatter` that, when true, replaces the line numbers in theleft column with the text `LL`. The replacement text is always `LL` andit does not affect the initial location line number.In the new `annotate-snippet` emitter in rustc, we can then use thisparameter depending on whether the `-Z ui-testing` flag is set or not.
3d97fb9 tod6c36a6Comparephansch commentedJun 13, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Replaced the magic constant. @zbraniecki what are your feelings regarding the change of the api of the |
zbraniecki commentedJun 13, 2019
Yep, it's an internal API, I'm fine with adjusting it later. |
oli-obk commentedJun 13, 2019
I wonder... @bors r+ |
oli-obk commentedJun 13, 2019
I guess not |
phansch commentedJun 13, 2019
Thanks! I think this will also need a new release before it can be used in rustc, right? |
phansch commentedJun 25, 2019
@zbraniecki (or someone else?) could you push a new version to crates.io? |
zbraniecki commentedJun 26, 2019
yeah, will do. |
zbraniecki commentedJun 26, 2019
done. 0.6.0 released. |
zbraniecki commentedJul 10, 2019
@phansch did you intend to turn also context lines (without numbers) to I see this: turned into: I think I'd expect: instead. |
phansch commentedJul 11, 2019
Yeah I noticed that, too. That's a bug of the current implementation. My current plan is to only show (I've been a bit time restricted the past month or so but I want to get back into it again this month) |
This adds support for the `-Z ui-testing` flag to the newannotate-snippet diagnostic emitter.The support for the flag was added to `annotate-snippet-rs` in these PRs:*rust-lang/annotate-snippets-rs#3*rust-lang/annotate-snippets-rs#5Closesrust-lang#61811
…estebanklibrustc_errors: Support ui-testing flag in annotate-snippet emitterThis adds support for the `-Z ui-testing` flag to the newannotate-snippet diagnostic emitter.Support for the flag was added to `annotate-snippet-rs` in these PRs:*rust-lang/annotate-snippets-rs#3*rust-lang/annotate-snippets-rs#5r?@estebankClosesrust-lang#61811
…estebanklibrustc_errors: Support ui-testing flag in annotate-snippet emitterThis adds support for the `-Z ui-testing` flag to the newannotate-snippet diagnostic emitter.Support for the flag was added to `annotate-snippet-rs` in these PRs:*rust-lang/annotate-snippets-rs#3*rust-lang/annotate-snippets-rs#5r?@estebankClosesrust-lang#61811
…estebanklibrustc_errors: Support ui-testing flag in annotate-snippet emitterThis adds support for the `-Z ui-testing` flag to the newannotate-snippet diagnostic emitter.Support for the flag was added to `annotate-snippet-rs` in these PRs:*rust-lang/annotate-snippets-rs#3*rust-lang/annotate-snippets-rs#5r?@estebankClosesrust-lang#61811
Uh oh!
There was an error while loading.Please reload this page.
With the current diagnostics emitter of Rust, the
-Z ui-testingflagallows to 'anonymize' line numbers in the UI test output.
This means that a line such as:
is turned into:
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 toDisplayListFormatterthat, when true, replaces the line numbers in theleft column with the text
LL. The replacement text is alwaysLLandit does not affect the initial location line number.
In the new
annotate-snippetemitter in rustc, we can then use thisparameter depending on whether the
-Z ui-testingflag is set or not.Closes#2
ccrust-lang/rust#59346