Matthias Krüger
b4266b0bcd
Rollup merge of #135557 - estebank:wtf8, r=fee1-dead
...
Point at invalid utf-8 span on user's source code
```
error: couldn't read `$DIR/not-utf8-bin-file.rs`: stream did not contain valid UTF-8
--> $DIR/not-utf8-2.rs:6:5
|
LL | include!("not-utf8-bin-file.rs");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: byte `193` is not valid utf-8
--> $DIR/not-utf8-bin-file.rs:2:14
|
LL | let _ = "�|�␂!5�cc␕␂��";
| ^
= note: this error originates in the macro `include` (in Nightly builds, run with -Z macro-backtrace for more info)
```
When we attempt to load a Rust source code file, if there is a OS file failure we try reading the file as bytes. If that succeeds we try to turn it into UTF-8. If *that* fails, we provide additional context about *where* the file has the first invalid UTF-8 character.
Fix #76869 .
2025-01-22 20:37:24 +01:00
..
2024-12-08 15:32:04 +08:00
2024-12-13 07:10:20 +11:00
2025-01-22 20:37:24 +01:00
2024-10-28 14:20:28 +11:00
2024-11-24 19:42:33 +01:00
2024-12-21 03:02:07 +00:00
2025-01-07 16:04:14 +01:00
2024-10-30 16:47:47 -07:00
2024-12-10 11:34:13 +08:00
2024-12-17 19:09:00 +08:00
2024-12-17 19:09:00 +08:00
2024-11-10 23:57:18 +01:00
2025-01-07 16:04:14 +01:00
2025-01-07 16:04:14 +01:00
2025-01-07 16:04:14 +01:00
2024-11-16 20:03:31 +00:00
2025-01-07 16:04:14 +01:00
2025-01-07 16:04:14 +01:00
2024-09-18 20:37:56 +02:00
2024-12-11 16:23:04 +01:00
2024-12-02 16:50:44 +00:00
2024-12-02 16:50:44 +00:00
2024-09-22 23:29:25 +03:00
2024-11-16 20:03:31 +00:00
2024-11-29 06:10:15 +11:00
2024-12-13 07:10:20 +11:00
2024-12-13 07:10:20 +11:00
2024-12-10 18:17:24 +00:00
2024-11-16 20:03:31 +00:00
2024-11-16 20:03:31 +00:00
2024-12-12 23:36:27 +00:00
2025-01-04 11:41:51 +01:00
2025-01-04 11:41:51 +01:00
2024-10-11 11:30:08 -04:00
2024-10-11 11:30:08 -04:00
2024-11-22 11:12:15 -08:00
2024-11-29 06:10:15 +11:00
2024-11-03 18:59:31 +00:00
2025-01-07 16:04:14 +01:00
2025-01-07 16:04:14 +01:00
2025-01-07 16:04:14 +01:00
2024-11-16 20:03:31 +00:00
2025-01-07 16:04:14 +01:00
2025-01-07 16:04:14 +01:00
2025-01-22 00:52:27 +00:00
2025-01-22 00:52:27 +00:00
2024-11-28 01:37:01 +00:00
2024-11-28 01:37:01 +00:00
2024-10-11 11:30:08 -04:00
2024-10-11 11:30:08 -04:00
2024-11-26 02:50:48 +08:00
2024-11-23 08:57:25 -07:00
2024-11-23 08:57:25 -07:00
2024-11-24 19:42:33 +01:00
2024-11-24 19:42:33 +01:00
2024-11-23 08:57:25 -07:00
2024-12-09 21:55:13 +00:00
2024-12-09 21:55:13 +00:00
2024-10-29 16:26:57 +00:00
2024-11-17 22:30:11 +00:00
2024-11-17 22:30:11 +00:00
2024-11-17 22:30:11 +00:00
2024-09-25 13:26:48 +02:00
2024-09-21 20:29:22 +03:00
2024-09-21 20:29:22 +03:00
2024-09-21 20:29:22 +03:00
2024-09-21 20:07:52 +03:00
2024-09-21 20:07:52 +03:00
2024-09-21 20:07:52 +03:00
2024-12-04 19:52:53 +00:00
2024-12-04 19:52:53 +00:00
2024-12-31 05:03:22 +00:00
2024-12-31 05:03:22 +00:00
2024-11-15 17:43:29 +00:00
2024-11-15 17:43:29 +00:00
2024-11-15 17:43:29 +00:00
2024-10-30 16:47:47 -07:00
2024-10-30 16:47:47 -07:00
2024-10-30 16:47:47 -07:00
2024-10-30 16:47:47 -07:00