rust/tests
bors 8538562429 Auto merge of #13567 - y21:span_debug_assertions, r=flip1995
Add debug assertions for empty replacements and overlapping spans

rustc has debug assertions [^1] [^2] that check that a substitution doesn't have an empty suggestion string and an empty span at the same time, as well as that spans in multipart suggestions don't overlap.
However, since we link to the rustc-dev distributed compiler, these debug assertions are always disabled and so we never actually run them.

This leads to the problem that the debug ICE is not necessarily caught in the PR and only triggered in the rust repo sync, and in one of the last syncs this was a blocker and delayed the sync by several weeks because the fix was not obvious.

So this PR essentially copies the checks over and runs them in clippy debug builds as well, so that we can catch these errors in PRs directly.

-----
As for the second commit, this also *did* cause an ICE in a sync before and was fixed in the sync PR (see https://github.com/rust-lang/rust/pull/120345#issuecomment-1911005554), but it seems like that commit didn't make it back into the clippy repo (cc `@flip1995),` so the fixed code is in the rust repo but not in the clippy repo.

changelog: none

[^1]: https://doc.rust-lang.org/1.82.0/nightly-rustc/src/rustc_errors/diagnostic.rs.html#1019
[^2]: https://doc.rust-lang.org/1.82.0/nightly-rustc/src/rustc_errors/diagnostic.rs.html#932
2024-10-21 08:26:32 +00:00
..
test_utils
ui Auto merge of #13567 - y21:span_debug_assertions, r=flip1995 2024-10-21 08:26:32 +00:00
ui-cargo
ui-internal Add test 2024-10-13 21:03:39 +01:00
ui-toml Merge remote-tracking branch 'upstream/master' into rustup 2024-10-18 13:25:37 +02:00
workspace_test
check-fmt.rs
clippy.toml
compile-test.rs Fix lints syntax highlighting 2024-10-18 18:03:16 +02:00
config-metadata.rs Apply updated needless_raw_strings to Clippy sources 2024-10-07 18:29:25 +02:00
dogfood.rs Merge commit '7901289135257ca0fbed3a5522526f95b0f5edba' into clippy-subtree-update 2024-09-24 11:58:04 +02:00
headers.rs
integration.rs
lint_message_convention.rs
missing-test-files.rs
versioncheck.rs Turn declare_clippy_lint into a declarative macro 2024-09-24 15:47:36 +02:00
workspace.rs