rust/tests
Matthias Krüger 3f1e8cc1b5 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](f34ba774c7/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)
2025-10-07 07:04:17 +02:00
..
test_utils Move/rename lazy::Sync{OnceCell,Lazy} to sync::{Once,Lazy}Lock 2022-06-16 19:54:42 +04:00
ui Rollup merge of #147165 - Muscraft:subtract-code-offset, r=davidtwco 2025-10-07 07:04:17 +02:00
ui-cargo Merge commit '2dc84cb744' into clippy-subtree-update 2025-10-06 18:10:37 +02:00
ui-internal Merge commit 'e9b70454e4' into clippy-subtree-update 2025-09-04 18:27:27 -04:00
ui-toml Merge commit '2dc84cb744' into clippy-subtree-update 2025-10-06 18:10:37 +02:00
workspace_test Merge commit 'cb806113e0' into clippy-subtree-update 2024-08-08 19:13:50 +02:00
check-fmt.rs Merge commit 'cb806113e0' into clippy-subtree-update 2024-08-08 19:13:50 +02:00
clippy.toml Merge commit '0621446356' into clippy-subtree-update 2025-04-22 18:24:43 +02:00
compile-test.rs Merge commit '2dc84cb744' into clippy-subtree-update 2025-10-06 18:10:37 +02:00
config-consistency.rs Merge commit 'e9b70454e4' into clippy-subtree-update 2025-09-04 18:27:27 -04:00
config-metadata.rs Merge commit 'a109190d70' into clippy-subtree-update 2024-10-18 13:44:06 +02:00
dogfood.rs Merge commit 'c5dbd1de07' into clippy-subtree-update 2025-06-27 12:20:57 +02:00
integration.rs Merge commit '0450db33a5' into clippy-subtree-update 2025-05-15 19:28:39 +02:00
lint_message_convention.rs Merge commit '1e5237f4a5' into clippy-subtree-update 2025-03-20 22:34:29 +01:00
missing-test-files.rs Apply cfg(bootstrap) replacement 2025-09-26 19:09:23 -04:00
no-profile-in-cargo-toml.rs Merge commit '20ce69b9a6' into clippy-subtree-update 2025-09-18 17:21:44 +02:00
symbols-used.rs Merge commit '334fb906ae' into clippy-subtree-update 2025-08-07 17:05:15 +02:00
versioncheck.rs Merge commit 'c5dbd1de07' into clippy-subtree-update 2025-06-27 12:20:57 +02:00
workspace.rs Stabilize LazyCell and LazyLock (lazy_cell) 2024-02-20 20:55:13 -07:00