Nicholas Nethercote
e8d02fe1cb
Make top-level rustc_parse functions fallible.
...
Currently we have an awkward mix of fallible and infallible functions:
```
new_parser_from_source_str
maybe_new_parser_from_source_str
new_parser_from_file
(maybe_new_parser_from_file) // missing
(new_parser_from_source_file) // missing
maybe_new_parser_from_source_file
source_str_to_stream
maybe_source_file_to_stream
```
We could add the two missing functions, but instead this commit removes
of all the infallible ones and renames the fallible ones leaving us with
these which are all fallible:
```
new_parser_from_source_str
new_parser_from_file
new_parser_from_source_file
source_str_to_stream
source_file_to_stream
```
This requires making `unwrap_or_emit_fatal` public so callers of
formerly infallible functions can still work.
This does make some of the call sites slightly more verbose, but I think
it's worth it for the simpler API. Also, there are two `catch_unwind`
calls and one `catch_fatal_errors` call in this diff that become
removable thanks this change. (I will do that in a follow-up PR.)
2024-06-05 10:38:03 +10:00
..
2024-05-30 10:49:05 +02:00
2024-05-21 10:39:30 -07:00
2024-05-30 10:49:05 +02:00
2024-06-05 10:38:03 +10:00
2024-05-30 10:49:05 +02:00
2024-05-30 10:49:05 +02:00
2024-05-30 10:49:05 +02:00
2024-06-03 20:36:27 -04:00
2024-05-30 10:49:05 +02:00
2024-05-30 16:46:31 +00:00
2024-05-30 08:00:11 +00:00
2024-05-30 10:49:05 +02:00
2024-04-04 19:52:55 +02:00
2024-05-29 10:04:08 +00:00
2024-05-30 10:49:05 +02:00
2024-05-30 10:49:05 +02:00
2023-12-01 18:21:58 +01:00
2024-04-04 19:52:55 +02:00
2024-04-18 17:48:52 +02:00
2024-05-30 10:49:05 +02:00
2024-05-30 10:49:05 +02:00
2024-04-04 19:52:55 +02:00
2024-05-30 10:49:05 +02:00
2024-05-21 10:39:30 -07:00
2024-01-16 17:12:10 +00:00
2024-04-04 19:52:55 +02:00
2024-04-04 19:52:55 +02:00
2024-04-04 19:52:55 +02:00
2023-12-01 18:21:58 +01:00
2024-04-18 17:48:52 +02:00
2023-12-16 14:12:50 +01:00
2024-05-02 17:26:44 +02:00
2023-12-01 18:21:58 +01:00
2024-04-04 19:52:55 +02:00
2023-12-01 18:21:58 +01:00
2024-05-02 17:26:44 +02:00
2023-12-01 18:21:58 +01:00
2024-05-02 17:26:44 +02:00
2023-12-01 18:21:58 +01:00
2024-04-04 19:44:04 +02:00
2024-05-30 10:49:05 +02:00
2024-05-30 10:49:05 +02:00
2024-05-21 10:39:30 -07:00
2024-04-04 19:52:55 +02:00
2024-04-04 19:52:55 +02:00
2024-05-30 16:46:31 +00:00
2024-05-30 10:49:05 +02:00
2024-04-04 19:52:55 +02:00
2022-06-30 10:50:09 +02:00
2024-05-30 16:46:31 +00:00
2024-04-16 16:29:13 +10:00
2024-05-30 10:49:05 +02:00
2024-04-04 19:52:55 +02:00
2024-04-04 19:52:55 +02:00
2024-04-04 19:52:55 +02:00
2024-05-30 10:49:05 +02:00
2024-04-04 19:52:55 +02:00
2023-12-01 18:21:58 +01:00
2024-05-30 10:49:05 +02:00
2024-04-04 19:52:55 +02:00
2024-05-30 10:49:05 +02:00
2024-05-30 10:49:05 +02:00
2024-05-30 10:49:05 +02:00
2024-05-30 10:49:05 +02:00
2024-05-30 10:49:05 +02:00
2024-04-04 19:52:55 +02:00
2023-12-01 18:21:58 +01:00
2024-03-21 11:42:49 -04:00
2024-05-30 10:49:05 +02:00
2024-05-21 10:39:30 -07:00
2024-06-01 12:50:58 -04:00
2024-04-04 19:52:55 +02:00
2023-12-01 18:21:58 +01:00
2024-05-30 10:49:05 +02:00
2024-05-30 10:49:05 +02:00
2024-05-21 10:39:30 -07:00
2024-04-04 19:52:55 +02:00
2023-12-01 18:21:58 +01:00
2024-05-30 10:49:05 +02:00
2024-04-04 19:52:55 +02:00
2024-05-21 10:39:30 -07:00
2024-05-21 10:39:30 -07:00
2024-05-30 10:49:05 +02:00
2024-05-21 10:39:30 -07:00
2024-04-04 19:52:55 +02:00
2023-12-01 18:21:58 +01:00
2024-01-26 09:42:12 +01:00
2024-04-16 16:29:13 +10:00
2024-05-21 10:39:30 -07:00
2024-06-03 09:27:52 -04:00
2024-02-28 08:55:35 +11:00
2023-12-01 18:21:58 +01:00
2024-05-30 10:49:05 +02:00
2024-03-22 20:48:36 +01:00
2023-12-01 18:21:58 +01:00
2024-05-29 10:04:08 +00:00
2024-05-30 10:49:05 +02:00
2024-04-16 16:29:13 +10:00
2024-01-19 20:10:39 -08:00
2024-05-30 22:52:33 +02:00
2024-04-04 19:52:55 +02:00
2023-12-01 18:21:58 +01:00
2024-05-02 17:26:44 +02:00
2024-05-30 10:49:05 +02:00
2023-12-28 19:33:07 +01:00
2023-12-01 18:21:58 +01:00
2024-05-30 10:49:05 +02:00
2024-05-17 18:33:37 -03:00
2024-05-30 10:49:05 +02:00
2024-04-04 19:52:55 +02:00
2024-04-04 19:52:55 +02:00
2023-12-01 18:21:58 +01:00
2024-05-30 10:49:05 +02:00
2024-04-04 19:52:55 +02:00
2024-04-18 17:48:52 +02:00
2023-12-01 18:21:58 +01:00
2023-12-01 18:21:58 +01:00
2024-04-04 19:52:55 +02:00
2024-05-30 10:49:05 +02:00
2024-05-19 11:10:56 -03:00
2023-12-01 18:21:58 +01:00
2024-04-16 16:29:13 +10:00
2024-04-04 19:52:55 +02:00
2024-05-30 10:49:05 +02:00
2024-05-02 17:26:44 +02:00
2024-04-04 19:52:55 +02:00
2024-04-18 17:48:52 +02:00
2024-06-01 07:50:32 -04:00
2024-04-17 09:34:39 -04:00
2024-05-30 10:49:05 +02:00
2024-03-22 20:36:21 +01:00
2021-10-07 11:21:30 +02:00
2024-05-21 10:39:30 -07:00
2024-04-18 17:48:52 +02:00
2024-04-04 19:52:55 +02:00
2024-05-30 10:49:05 +02:00
2024-05-29 10:04:08 +00:00
2024-03-10 23:33:00 +08:00
2024-04-04 19:52:55 +02:00
2024-05-08 16:57:31 +10:00
2024-05-30 22:52:33 +02:00
2024-04-04 19:52:55 +02:00
2024-05-21 10:39:30 -07:00
2023-12-16 14:12:50 +01:00
2024-04-17 09:34:39 -04:00
2024-05-02 17:26:44 +02:00
2024-03-14 12:42:04 +01:00
2023-12-01 18:21:58 +01:00
2023-12-20 00:07:34 +00:00
2024-01-19 20:10:39 -08:00
2024-03-22 20:48:36 +01:00
2024-03-21 22:20:40 +01:00
2023-12-01 18:21:58 +01:00
2023-12-16 14:12:50 +01:00
2024-04-04 19:52:55 +02:00
2024-04-18 17:48:52 +02:00
2024-04-04 19:52:55 +02:00
2024-04-04 19:52:55 +02:00
2024-04-04 19:52:55 +02:00
2024-05-30 10:49:05 +02:00
2023-12-01 18:21:58 +01:00
2024-04-17 09:34:39 -04:00
2024-05-09 20:58:46 -04:00
2024-05-30 10:49:05 +02:00
2024-05-30 10:49:05 +02:00
2023-12-24 08:05:28 +11:00
2024-05-30 10:49:05 +02:00
2024-01-11 17:27:03 +01:00
2024-04-04 19:52:55 +02:00
2024-05-30 10:49:05 +02:00
2024-05-30 10:49:05 +02:00
2024-05-30 10:49:05 +02:00
2024-05-30 10:49:05 +02:00
2023-12-01 18:21:58 +01:00
2024-05-02 17:26:44 +02:00
2024-05-30 10:49:05 +02:00
2024-05-02 17:26:44 +02:00
2024-03-21 22:20:40 +01:00
2024-04-15 18:48:12 -04:00
2024-04-04 19:52:55 +02:00
2024-05-30 10:49:05 +02:00
2024-04-17 09:34:39 -04:00
2024-05-30 10:49:05 +02:00
2024-04-17 09:34:39 -04:00
2024-06-03 20:36:27 -04:00
2024-05-21 10:39:30 -07:00
2023-12-01 18:21:58 +01:00
2024-05-02 17:26:44 +02:00
2023-12-16 14:12:50 +01:00
2024-05-21 10:39:30 -07:00
2023-12-01 18:21:58 +01:00
2024-05-21 10:39:30 -07:00
2024-05-21 10:39:30 -07:00
2024-04-04 19:52:55 +02:00
2023-12-01 18:21:58 +01:00
2023-12-01 18:21:58 +01:00
2023-12-01 18:21:58 +01:00
2024-05-17 18:33:37 -03:00
2024-05-21 10:39:30 -07:00
2023-12-01 18:21:58 +01:00
2024-05-02 17:26:44 +02:00
2024-05-02 17:26:44 +02:00
2024-05-30 10:49:05 +02:00
2024-01-11 17:27:03 +01:00
2024-04-04 19:52:55 +02:00
2024-04-04 19:52:55 +02:00
2024-04-04 19:52:55 +02:00
2024-05-29 10:04:08 +00:00
2023-12-01 18:21:58 +01:00
2024-04-17 09:34:39 -04:00
2023-12-01 18:21:58 +01:00
2024-05-30 10:49:05 +02:00
2024-05-30 10:49:05 +02:00
2024-05-30 10:49:05 +02:00
2023-12-01 18:21:58 +01:00
2023-12-01 18:21:58 +01:00
2024-04-17 09:34:39 -04:00
2024-05-30 10:49:05 +02:00
2023-12-01 18:21:58 +01:00
2023-12-01 18:21:58 +01:00
2024-04-04 19:52:55 +02:00
2024-05-29 10:04:08 +00:00
2024-02-27 15:50:17 +01:00
2024-05-30 10:49:05 +02:00
2024-05-30 10:49:05 +02:00
2024-05-29 10:04:08 +00:00
2024-04-04 19:52:55 +02:00
2024-05-30 10:49:05 +02:00
2023-12-01 18:21:58 +01:00
2024-03-22 20:36:21 +01:00
2023-12-28 19:33:07 +01:00
2024-01-15 19:07:11 +01:00
2024-05-08 16:57:31 +10:00
2024-03-06 00:35:19 -05:00
2024-03-07 17:19:29 +01:00
2024-04-17 09:34:39 -04:00
2024-04-04 19:52:55 +02:00
2024-05-30 10:49:05 +02:00
2024-04-04 19:52:55 +02:00
2024-05-30 10:49:05 +02:00
2023-12-01 18:21:58 +01:00
2024-05-30 10:49:05 +02:00
2023-12-01 18:21:58 +01:00
2024-04-04 19:52:55 +02:00
2023-12-16 14:12:50 +01:00
2024-05-02 17:26:44 +02:00
2024-04-17 09:34:39 -04:00
2023-12-01 18:21:58 +01:00
2024-05-30 10:49:05 +02:00
2024-05-30 10:49:05 +02:00
2024-04-04 19:52:55 +02:00
2024-05-30 10:49:05 +02:00
2024-05-08 16:57:31 +10:00
2024-04-04 19:52:55 +02:00
2024-05-30 10:49:05 +02:00
2024-04-16 16:29:15 +10:00
2024-05-30 16:46:31 +00:00
2024-05-30 10:49:05 +02:00
2024-04-14 18:45:28 +02:00
2024-04-04 19:52:55 +02:00
2024-03-22 11:13:29 -04:00
2024-05-02 17:26:44 +02:00
2024-05-02 17:26:44 +02:00
2024-05-30 10:49:05 +02:00
2024-05-30 10:49:05 +02:00
2024-02-27 15:50:17 +01:00
2024-03-06 00:35:19 -05:00
2024-04-04 19:52:55 +02:00
2024-05-30 10:49:05 +02:00
2023-12-01 18:21:58 +01:00
2024-04-04 19:52:55 +02:00
2023-12-01 18:21:58 +01:00
2023-12-01 18:21:58 +01:00
2024-05-30 10:49:05 +02:00
2024-05-02 17:26:44 +02:00
2023-12-01 18:21:58 +01:00
2024-05-02 17:26:44 +02:00
2024-04-04 19:52:55 +02:00
2024-05-02 17:26:44 +02:00
2024-03-22 20:48:36 +01:00
2024-05-29 10:04:08 +00:00
2024-05-30 10:49:05 +02:00
2024-05-30 10:49:05 +02:00
2024-03-22 06:31:40 +01:00
2024-03-14 12:42:04 +01:00
2024-06-03 20:36:27 -04:00
2023-12-06 09:03:48 +01:00
2024-04-04 19:52:55 +02:00
2024-04-04 19:52:55 +02:00
2023-12-01 18:21:58 +01:00
2024-05-30 10:49:05 +02:00
2024-04-17 09:34:39 -04:00
2024-04-04 19:52:55 +02:00
2024-04-17 09:34:39 -04:00
2024-04-14 18:45:28 +02:00
2024-02-10 12:24:46 +03:00
2024-04-04 19:52:55 +02:00
2024-03-22 20:48:36 +01:00
2024-04-04 19:52:55 +02:00
2023-12-01 18:21:58 +01:00
2024-02-27 15:50:17 +01:00
2024-05-30 10:49:05 +02:00
2024-05-21 10:39:30 -07:00
2024-04-04 19:52:55 +02:00
2024-04-04 19:52:55 +02:00
2024-04-17 09:34:39 -04:00
2024-05-02 17:26:44 +02:00
2024-05-02 17:26:44 +02:00
2024-05-30 10:49:05 +02:00
2024-03-21 22:20:40 +01:00
2024-05-30 10:49:05 +02:00
2024-04-04 19:52:55 +02:00
2024-03-22 20:48:36 +01:00
2024-04-16 16:29:13 +10:00