Files
rust/tests/crashes
Kurashina Hinata 8c3ae6023e Don't build format string suggestions from concat! offsets
When a format string does not come directly from a string literal in
the source, e.g. when it is produced by `concat!`, the parser's inner
offsets are relative to the expanded string rather than to the source.
The primary error span and the `RemoveRawIdent` suggestion already
check `is_source_literal` before calling `fmt_span.from_inner`, but the
`UsePositional`, `ReorderFormatParameter` and `AddMissingColon`
suggestions did not.

As a result, these suggestions could point into the middle of a
multibyte character and ICE when rendered, or suggest a bogus argument
copied from unrelated source text. Only emit them when the format
string is a source literal, like the other suggestions do.

The crash test is moved to `tests/ui/fmt`, with cases covering each of
these suggestions.
2026-09-26 18:08:15 +09:00
..
…
…
…
…
…
…
…
…
…
2026-08-04 18:44:28 +00:00
…
…
…
…
2026-08-24 10:03:03 +00:00
…
2026-07-13 10:54:53 +02:00
…
…
…
2026-07-13 10:54:53 +02:00
…
…
2025-12-25 12:27:17 +00:00
…
…
…
…
…
…
…
…
…
2026-07-13 10:54:53 +02:00
…
…
…
…
…
2025-12-25 12:27:17 +00:00
2025-09-26 15:37:19 -07:00
…
2026-07-13 10:54:53 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2025-09-29 11:04:50 +10:00
…
…
…
…
…
…
2026-08-16 18:00:38 +00:00
…
…
…
…
…
…
…
…
…
2026-07-13 10:54:53 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2026-08-14 09:04:25 +00:00
…
2026-09-25 13:04:03 +02:00
…
2026-08-24 10:03:03 +00:00
…
…
…
…
…
…
…
…
…
2026-09-07 08:56:08 +00:00
…
…
2026-08-14 09:04:25 +00:00
2026-08-16 18:00:38 +00:00
2026-08-24 10:03:03 +00:00
2026-08-16 18:00:38 +00:00
2026-08-24 10:03:03 +00:00
2026-08-16 18:00:38 +00:00
2026-09-07 08:56:08 +00:00
2026-09-07 08:56:08 +00:00
2026-03-09 18:51:25 -04:00
2026-06-27 08:51:24 +00:00
2026-08-14 09:04:25 +00:00
2026-08-16 18:00:38 +00:00
2026-08-16 18:00:38 +00:00
2026-06-27 08:51:24 +00:00
2026-08-14 09:04:25 +00:00
2026-08-14 09:04:25 +00:00
2026-06-27 08:51:24 +00:00
2026-06-27 08:51:24 +00:00
2026-08-14 09:04:25 +00:00
2026-06-27 08:51:24 +00:00
2026-09-07 08:56:08 +00:00
2026-06-27 08:51:24 +00:00
2026-08-24 10:03:03 +00:00
2026-06-28 09:39:21 +00:00
2026-09-25 13:04:03 +02:00
2026-09-25 13:04:03 +02:00
2026-06-28 09:39:21 +00:00
2026-03-09 18:51:25 -04:00
2026-06-28 09:39:21 +00:00
2026-06-28 09:39:21 +00:00
2026-06-28 09:39:21 +00:00
2026-09-25 13:04:03 +02:00
2026-06-28 09:39:21 +00:00
2026-06-27 08:51:24 +00:00
2026-06-27 08:51:24 +00:00
2026-08-16 18:00:38 +00:00
2026-08-24 10:03:03 +00:00
2026-08-24 10:03:03 +00:00
2026-08-24 10:03:03 +00:00
2026-09-07 08:56:08 +00:00
2026-09-07 08:56:08 +00:00
2026-06-27 08:51:24 +00:00
2026-08-24 10:03:03 +00:00
2026-08-24 10:03:03 +00:00
2026-06-27 08:51:24 +00:00
2026-09-07 08:56:08 +00:00
2026-09-07 08:56:08 +00:00
2026-09-07 08:56:08 +00:00
2026-09-07 08:56:08 +00:00
2026-09-07 08:56:08 +00:00
2026-09-07 08:56:08 +00:00
2025-12-17 21:25:19 +02:00

Documentation on crash tests is at https://rustc-dev-guide.rust-lang.org/tests/compiletest#crash-tests.

Alternatively, you can build the documentation from this repository:

mdbook serve --open src/doc/rustc-dev-guide

The documentation will then be available at http://localhost:3000/tests/compiletest.html#crash-tests.