rust/compiler/rustc_interface/src
Nicholas Nethercote b9037339cb 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
..
callbacks.rs Give TRACK_DIAGNOSTIC a return value. 2024-03-01 13:27:47 +11:00
errors.rs Make incremental sessions identity no longer depend on the crate names provided by source code 2024-03-13 16:40:02 +01:00
interface.rs Make top-level rustc_parse functions fallible. 2024-06-05 10:38:03 +10:00
lib.rs Remove #[macro_use] extern crate tracing from rustc_interface. 2024-05-23 18:02:17 +10:00
passes.rs Make top-level rustc_parse functions fallible. 2024-06-05 10:38:03 +10:00
proc_macro_decls.rs Move expansion of query macros in rustc_middle to rustc_middle::query 2023-05-15 08:49:13 +02:00
queries.rs Remove feed_local_crate in favor of creating the CrateNum via TyCtxt 2024-04-19 14:16:18 +00:00
tests.rs Rollup merge of #124655 - Darksonn:fixed-x18, r=lqd,estebank 2024-05-29 20:12:32 +02:00
util.rs Remove #[macro_use] extern crate tracing from rustc_interface. 2024-05-23 18:02:17 +10:00