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-11-27 07:18:25 -08:00
2024-09-11 13:29:25 -07:00
2025-01-07 16:04:14 +01:00
2024-07-12 03:02:57 +00:00
2024-07-12 03:02:57 +00:00
2024-09-27 15:41:04 +08:00
2024-09-27 15:41:04 +08:00
2024-09-27 15:41:04 +08:00
2024-08-04 00:11:16 +08:00
2024-08-04 00:11:16 +08:00
2024-07-18 20:08:38 +00:00
2024-07-12 03:22:32 +00:00
2025-01-22 00:52:27 +00:00
2025-01-22 00:52:27 +00:00
2024-11-26 02:50:48 +08:00
2024-06-21 19:00:18 -04:00
2024-07-12 03:02:57 +00:00
2024-11-29 06:10:15 +11:00
2024-07-26 15:14:05 +02:00
2024-07-26 15:14:05 +02:00
2024-11-26 02:50:48 +08:00
2024-07-12 03:02:57 +00:00
2024-11-23 08:57:25 -07:00
2024-11-23 08:57:25 -07:00
2024-07-12 03:02:57 +00:00
2024-08-04 00:11:16 +08:00
2024-08-04 00:11:16 +08:00
2024-08-04 00:11:16 +08:00
2024-07-12 03:02:57 +00:00
2024-04-25 13:09:13 +02:00
2024-10-26 11:35:56 +08:00
2024-07-12 03:02:57 +00:00
2024-07-12 03:02:57 +00:00
2024-05-20 21:36:20 +02:00
2024-07-12 03:02:57 +00:00
2024-07-12 03:02:57 +00:00
2024-07-12 03:02:57 +00:00
2024-07-12 03:02:57 +00:00
2024-07-12 03:02:57 +00:00
2024-07-12 03:02:57 +00:00
2024-07-18 20:08:38 +00:00
2024-07-18 20:08:38 +00:00
2024-07-18 20:08:38 +00:00
2024-07-18 20:08:38 +00:00
2024-07-18 20:08:38 +00:00
2024-05-02 19:42:31 -04:00
2024-07-18 20:08:38 +00:00
2024-07-18 20:08:38 +00:00
2024-03-17 23:35:18 +00:00
2024-03-17 23:35:18 +00:00
2024-12-21 20:37:27 +00:00
2024-07-12 03:02:57 +00:00
2024-07-18 20:08:38 +00:00
2024-07-18 20:08:38 +00:00
2024-07-18 20:08:38 +00:00
2024-07-18 20:08:38 +00:00
2024-07-12 03:02:57 +00:00
2024-07-12 03:02:57 +00:00
2024-03-22 20:53:42 -04:00
2024-09-12 21:27:44 -04:00
2024-11-24 19:42:33 +01:00
2024-11-24 19:42:33 +01:00
2024-07-12 03:02:57 +00:00
2024-06-04 14:19:42 -03:00
2024-06-04 14:19:42 -03:00
2024-06-04 14:19:42 -03:00
2024-06-04 14:19:42 -03:00
2024-06-04 14:19:42 -03:00
2024-06-04 14:19:42 -03:00
2024-07-18 20:08:38 +00:00
2024-07-18 20:08:38 +00:00
2024-07-18 20:08:38 +00:00
2024-07-18 20:08:38 +00:00
2024-06-04 14:19:42 -03:00
2024-06-04 14:19:42 -03:00
2024-07-12 03:22:32 +00:00
2024-06-04 14:19:42 -03:00
2024-06-04 14:19:42 -03:00
2024-06-04 14:19:42 -03:00
2024-06-04 14:19:42 -03:00
2024-07-18 20:08:38 +00:00
2025-01-02 23:39:16 +00:00
2025-01-02 23:39:16 +00:00
2024-11-27 07:18:25 -08:00
2024-07-12 03:02:57 +00:00
2024-07-12 03:02:57 +00:00
2024-07-12 03:02:57 +00:00
2024-07-12 03:02:57 +00:00
2024-07-18 17:47:31 +00:00
2024-07-18 17:47:31 +00:00
2024-04-07 01:16:45 +02:00
2024-04-07 01:16:45 +02:00
2024-07-12 03:22:32 +00:00
2024-07-18 20:08:38 +00:00
2024-05-28 11:55:20 +00:00
2024-05-28 11:55:20 +00:00
2024-07-18 20:08:38 +00:00
2024-07-18 20:08:38 +00:00
2024-08-03 07:57:31 -04:00
2024-08-03 07:57:31 -04:00
2024-08-03 07:57:31 -04:00
2024-07-18 20:08:38 +00:00
2024-07-12 03:02:57 +00:00
2024-07-12 03:02:58 +00:00
2024-04-22 17:47:35 +02:00
2024-07-12 03:22:32 +00:00
2024-07-04 19:16:47 -04:00
2024-07-04 19:16:47 -04:00
2024-07-04 19:16:47 -04:00
2024-07-04 19:16:47 -04:00
2024-07-04 19:16:47 -04:00
2024-07-04 19:16:47 -04:00
2024-07-04 19:16:47 -04:00
2024-07-04 19:16:47 -04:00
2024-07-04 19:16:47 -04:00
2024-07-04 19:16:47 -04:00
2024-07-12 03:02:57 +00:00
2024-07-12 03:02:57 +00:00