rust/src/librustdoc
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
..
clean Make top-level rustc_parse functions fallible. 2024-06-05 10:38:03 +10:00
doctest add extra indent spaces for rust-playground link 2024-02-15 18:57:21 +08:00
formats rustc: Use tcx.used_crates(()) more 2024-05-22 18:02:51 +03:00
html Use checked_sub 2024-06-04 16:05:51 +02:00
json Rollup merge of #125635 - fmease:mv-type-binding-assoc-item-constraint, r=compiler-errors 2024-05-31 08:50:22 +02:00
passes Make top-level rustc_parse functions fallible. 2024-06-05 10:38:03 +10:00
theme rustdoc: merge theme css into rustdoc.css 2023-09-15 07:40:17 -07:00
askama.toml Remove unneeded minus sign in jinja tags 2023-03-06 11:38:15 +01:00
Cargo.toml Remove direct dependencies on lazy_static, once_cell and byteorder 2024-04-28 14:35:00 +01:00
config.rs Auto merge of #124611 - Urgau:rustdoc-stdin, r=GuillaumeGomez 2024-05-18 10:53:47 +00:00
core.rs Make body_owned_by return the body directly. 2024-05-29 10:04:08 +00:00
docfs.rs remove redundant imports 2023-12-10 10:56:22 +08:00
doctest.rs Make top-level rustc_parse functions fallible. 2024-06-05 10:38:03 +10:00
error.rs Remove crate visibility modifier in libs, tests 2022-05-21 00:32:47 -04:00
externalfiles.rs Auto merge of #124577 - GuillaumeGomez:stabilize-custom_code_classes_in_docs, r=rustdoc 2024-06-01 10:18:01 +00:00
fold.rs rustdoc: bind typedef inner type items to the folding system 2023-08-26 00:15:02 +02:00
lib.rs remove tracing tree indent lines 2024-05-30 15:26:48 +02:00
lint.rs Fix some typos in comments 2024-04-25 10:47:24 +08:00
markdown.rs Auto merge of #124577 - GuillaumeGomez:stabilize-custom_code_classes_in_docs, r=rustdoc 2024-06-01 10:18:01 +00:00
README.md
scrape_examples.rs Rollup merge of #124976 - petrochenkov:usedcrates, r=oli-obk 2024-05-23 14:09:23 +02:00
theme.rs Shorten some error invocations. 2024-01-10 07:33:06 +11:00
visit.rs rustdoc: Rename clean items from typedef to type alias 2023-08-21 13:56:22 -07:00
visit_ast.rs Don't require visit_body to take a lifetime that must outlive the function call 2024-05-29 10:04:08 +00:00
visit_lib.rs Correctly handle --document-hidden-items 2023-07-14 17:25:09 +02:00

For more information about how librustdoc works, see the rustc dev guide.