-
Notifications
You must be signed in to change notification settings - Fork 13.8k
test: Subtract code_offset from width for ui_testing #147165
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
Conversation
The Miri subtree was changed cc @rust-lang/miri Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
r? @nnethercote rustbot has assigned @nnethercote. Use |
From a test suite maintenance perspective this looks not great -- how does one know whether one has to add a random |
Personally, I would only add
|
Without commenting on whether we want to have those output changes or not -- if the output does change like that, I'd much rather just have the stderr files updated in Miri than add random compiler flags. |
@@ -1,4 +1,5 @@ | |||
//@aux-build:proc_macros.rs | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for splitting this out into a separate commit!
I'm going to pass this on to David, who already had intelligent things to say in the Zulip thread. r? davidtwco |
dc0d2c6
to
47268e1
Compare
I updated the PR so that the |
47268e1
to
9c6897b
Compare
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This seems sensible to me, this has very little impact on the diagnostic output, and means that we'll be closer to matching annotate-snippets' output when we switch over to that. |
@bors r+ |
…avidtwco test: Subtract code_offset from width for ui_testing `annotate-snippets` does not have a "UI test" mode like `rustc`, [where the code offset is not subtracted from the column width](https://github.com/rust-lang/rust/blob/f34ba774c78ea32b7c40598b8ad23e75cdac42a6/compiler/rustc_errors/src/emitter.rs#L1985-L1987). This makes it so `annotate-snippets` will shift the output for some very long tests 5 - 7 columns to the left. As part of my work to have `rustc` use `annotate-snippets`, and to reduce the test differences between the two, I figured it would be best if `rustc` started subtracting the code offset from the width as well. The first commit exists to keep the test output changes of adding a new line to a test separate from adding the `--diagnostic-width` flag in the second commit. This makes it easier to verify that adding the flag does not affect the test's output. [Zulip discussion](https://rust-lang.zulipchat.com/#narrow/channel/147480-t-compiler.2Fdiagnostics/topic/annotate-snippets.20hurdles)
Rollup of 7 pull requests Successful merges: - #145495 (Use declarative macro for `#[derive(TryFromU32)]`) - #147165 (test: Subtract code_offset from width for ui_testing) - #147354 (Fix wrong span for hightlight for duplicated diff lines) - #147395 (Improve diagnostics: update note and add help message) - #147396 (Fluent tidy improvements) - #147407 (Update books) - #147413 (don't panic on extern with just multiple quotes in the name) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #147165 - Muscraft:subtract-code-offset, r=davidtwco test: Subtract code_offset from width for ui_testing `annotate-snippets` does not have a "UI test" mode like `rustc`, [where the code offset is not subtracted from the column width](https://github.com/rust-lang/rust/blob/f34ba774c78ea32b7c40598b8ad23e75cdac42a6/compiler/rustc_errors/src/emitter.rs#L1985-L1987). This makes it so `annotate-snippets` will shift the output for some very long tests 5 - 7 columns to the left. As part of my work to have `rustc` use `annotate-snippets`, and to reduce the test differences between the two, I figured it would be best if `rustc` started subtracting the code offset from the width as well. The first commit exists to keep the test output changes of adding a new line to a test separate from adding the `--diagnostic-width` flag in the second commit. This makes it easier to verify that adding the flag does not affect the test's output. [Zulip discussion](https://rust-lang.zulipchat.com/#narrow/channel/147480-t-compiler.2Fdiagnostics/topic/annotate-snippets.20hurdles)
Rollup of 7 pull requests Successful merges: - rust-lang/rust#145495 (Use declarative macro for `#[derive(TryFromU32)]`) - rust-lang/rust#147165 (test: Subtract code_offset from width for ui_testing) - rust-lang/rust#147354 (Fix wrong span for hightlight for duplicated diff lines) - rust-lang/rust#147395 (Improve diagnostics: update note and add help message) - rust-lang/rust#147396 (Fluent tidy improvements) - rust-lang/rust#147407 (Update books) - rust-lang/rust#147413 (don't panic on extern with just multiple quotes in the name) r? `@ghost` `@rustbot` modify labels: rollup
annotate-snippets
does not have a "UI test" mode likerustc
, where the code offset is not subtracted from the column width. This makes it soannotate-snippets
will shift the output for some very long tests 5 - 7 columns to the left. As part of my work to haverustc
useannotate-snippets
, and to reduce the test differences between the two, I figured it would be best ifrustc
started subtracting the code offset from the width as well.The first commit exists to keep the test output changes of adding a new line to a test separate from adding the
--diagnostic-width
flag in the second commit. This makes it easier to verify that adding the flag does not affect the test's output.Zulip discussion