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-16 10:01:47 +00:00
2026-06-09 13:16:26 +02:00
2025-10-13 15:20:49 +02: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
2026-07-15 11:50:42 -04:00
2025-12-25 12:27:17 +00:00
2025-10-13 15:20:49 +02:00
2026-07-13 10:54:53 +02:00
2025-12-17 20:47:47 +01:00
2025-12-17 20:47:47 +01:00
2025-12-17 20:47:47 +01:00
2025-12-25 12:27:17 +00:00
2025-09-26 15:37:19 -07:00
2025-09-27 14:41:09 +02: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-08-03 21:50:31 +01:00
2026-07-13 10:54:53 +02:00
2025-10-13 15:20:49 +02:00
2026-08-14 09:04:25 +00:00
2026-04-09 11:36:46 +02: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
2025-10-23 22:15:34 +00:00
2026-09-07 08:56:08 +00:00
2025-10-23 22:15:34 +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-09-23 09:52:49 -07: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-08-16 10:01:47 +00:00
2026-08-16 10:01:47 +00:00
2026-09-07 08:56:08 +00:00
2026-08-16 10:01:47 +00:00
2026-09-23 09:52:49 -07:00
2026-08-16 10:01:47 +00:00
2026-09-07 08:56:08 +00:00
2026-06-27 08:51:24 +00:00
2026-08-16 10:01:47 +00:00
2026-08-16 10:01:47 +00:00
2026-08-16 10:01:47 +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-20 22:06:40 +00:00
2026-09-20 22:06:40 +00:00
2026-09-07 08:56:08 +00:00
2026-05-02 21:07:24 +08: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