Esteban Küber
57dd42d613
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: `[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 00:52:27 +00:00
..
2024-11-27 07:18:25 -08:00
2024-12-01 19:10:44 -03:00
2024-10-23 02:45:24 -07:00
2025-01-01 15:58:29 +01:00
2024-10-28 14:20:28 +11:00
2024-10-28 14:20:28 +11:00
2024-07-12 03:02:57 +00:00
2024-10-28 14:20:28 +11:00
2024-10-28 14:20:28 +11:00
2024-09-23 09:14:30 +10:00
2024-07-12 18:52:52 +00:00
2024-10-04 09:09:20 +02:00
2024-10-04 09:09:20 +02:00
2024-05-20 19:55:59 -07:00
2024-05-20 19:55:59 -07:00
2024-11-22 16:49:10 +00:00
2024-11-22 16:49:10 +00:00
2024-05-30 21:39:41 -05:00
2024-10-01 07:51:58 +00:00
2024-10-01 07:51:58 +00:00
2024-10-01 07:51:58 +00:00
2024-11-22 11:12:15 -08:00
2024-10-28 14:20:28 +11:00
2024-10-28 14:20:28 +11:00
2024-11-22 11:12:15 -08:00
2024-10-01 07:51:58 +00:00
2024-10-28 14:20:28 +11:00
2024-10-28 14:20:28 +11:00
2024-11-22 11:12:15 -08:00
2024-10-14 10:07:57 +08:00
2024-10-14 10:07:57 +08:00
2024-10-14 10:07:57 +08:00
2024-05-11 00:13:27 +08:00
2024-05-11 00:13:27 +08:00
2024-12-15 19:18:46 +01:00
2024-10-01 07:51:58 +00:00
2024-11-26 02:50:48 +08:00
2024-10-01 07:51:58 +00:00
2024-10-28 14:12:45 +11:00
2024-10-28 14:12:45 +11:00
2024-07-24 13:16:46 -04:00
2024-10-14 23:22:51 +02:00
2024-10-28 14:12:45 +11:00
2024-10-28 14:12:45 +11:00
2024-06-03 07:25:32 +02:00
2024-06-03 07:25:32 +02:00
2025-01-15 08:58:17 +00:00
2025-01-15 08:58:17 +00:00
2025-01-02 23:39:17 +00:00
2025-01-02 23:39:17 +00:00
2024-11-27 07:18:25 -08:00
2024-04-27 10:54:31 +03:00
2024-10-28 14:12:45 +11:00
2024-10-28 14:12:45 +11:00
2024-11-26 02:50:48 +08:00
2024-11-26 02:50:48 +08:00
2024-10-28 14:20:28 +11:00
2024-10-28 14:20:28 +11:00
2024-10-28 14:20:28 +11:00
2024-10-28 14:20:28 +11:00
2024-05-04 11:30:38 +02:00
2024-10-28 14:12:45 +11:00
2024-10-28 14:12:45 +11:00
2024-05-11 00:13:27 +08:00
2024-05-11 00:13:27 +08:00
2024-10-28 14:12:45 +11:00
2024-10-28 14:12:45 +11:00
2024-10-28 14:12:45 +11:00
2024-11-26 02:50:48 +08:00
2024-08-16 21:27:06 +08:00
2024-05-04 11:30:38 +02:00
2024-07-24 13:16:46 -04:00
2024-11-28 14:32:45 -08:00
2024-11-28 14:32:45 -08:00
2024-11-28 14:32:45 -08:00
2024-10-28 14:20:28 +11:00
2024-10-28 14:20:28 +11:00
2024-11-26 02:50:48 +08:00
2024-07-12 18:52:52 +00:00
2024-11-27 07:18:25 -08:00
2024-11-12 14:05:42 +00:00
2024-11-22 16:49:10 +00:00
2024-05-15 10:28:44 +08:00
2024-05-15 10:28:44 +08:00
2024-11-03 13:55:52 -08:00
2024-11-03 13:55:52 -08:00
2024-05-04 11:30:38 +02:00
2024-12-27 19:58:16 +11:00
2024-12-21 19:14:58 +00:00
2024-07-24 21:03:27 +00:00
2024-05-10 12:29:17 -07:00
2024-05-10 12:29:17 -07:00
2024-11-22 11:12:15 -08:00
2024-07-12 03:02:57 +00:00
2024-10-28 14:20:28 +11:00
2024-10-28 14:20:28 +11:00
2024-05-18 18:56:12 +08:00
2024-05-18 18:56:12 +08:00
2024-05-20 19:55:59 -07:00
2024-05-20 19:55:59 -07:00
2024-05-20 19:55:59 -07:00
2024-05-20 19:55:59 -07:00
2024-10-28 14:20:28 +11:00
2024-10-28 14:20:28 +11:00
2025-01-22 00:52:27 +00:00
2025-01-22 00:52:27 +00:00
2024-07-06 15:36:30 +03:00
2024-07-01 00:25:25 +01:00
2024-11-26 02:50:48 +08:00
2024-05-18 01:05:56 +00:00
2024-05-18 01:05:56 +00:00
2024-11-27 07:18:25 -08:00
2024-11-26 02:50:48 +08:00
2024-11-26 02:50:48 +08:00
2024-07-12 03:02:57 +00:00
2024-11-27 07:18:25 -08:00
2024-11-27 07:18:25 -08:00
2025-01-08 07:34:59 +00:00
2024-10-28 14:12:45 +11:00
2024-10-28 14:12:45 +11:00
2024-05-04 11:30:38 +02:00
2024-06-05 13:07:32 +10:00
2024-10-28 14:20:28 +11:00
2025-01-03 12:01:31 +01:00
2025-01-03 12:01:31 +01:00