rust/src/librustdoc
Nicholas Nethercote 01e33a3600 Avoid &format("...") calls in error message code.
Error message all end up passing into a function as an `impl
Into<{D,Subd}iagnosticMessage>`. If an error message is creatd as
`&format("...")` that means we allocate a string (in the `format!`
call), then take a reference, and then clone (allocating again) the
reference to produce the `{D,Subd}iagnosticMessage`, which is silly.

This commit removes the leading `&` from a lot of these cases. This
means the original `String` is moved into the
`{D,Subd}iagnosticMessage`, avoiding the double allocations. This
requires changing some function argument types from `&str` to `String`
(when all arguments are `String`) or `impl
Into<{D,Subd}iagnosticMessage>` (when some arguments are `String` and
some are `&str`).
2023-05-16 17:59:56 +10:00
..
clean refactor: add chunks method to TokenStream to obviate rustdoc clones 2023-05-13 16:59:28 -05:00
doctest pass unused_extern_crates in librustdoc::doctest::make_test 2023-04-25 17:20:58 +03:00
formats Correctly handle associated items of a trait inside a #[doc(hidden)] item 2023-05-05 21:33:44 +02:00
html Avoid &format("...") calls in error message code. 2023-05-16 17:59:56 +10:00
json IAT: Rustdoc integration 2023-05-04 16:59:11 +02:00
passes Avoid &format("...") calls in error message code. 2023-05-16 17:59:56 +10:00
theme Spelling librustdoc 2023-04-16 21:44:12 -04:00
askama.toml Remove unneeded minus sign in jinja tags 2023-03-06 11:38:15 +01:00
Cargo.toml rustdoc: DocFS: Replace rayon with threadpool and enable it for all targets 2023-03-14 20:28:00 +01:00
config.rs Restrict From<S> for {D,Subd}iagnosticMessage. 2023-05-03 08:44:39 +10:00
core.rs Restrict From<S> for {D,Subd}iagnosticMessage. 2023-05-03 08:44:39 +10:00
docfs.rs Update docsfs module documentation 2023-03-15 16:47:14 +01:00
doctest.rs handle cfg(bootstrap) 2023-04-28 08:47:55 -07:00
error.rs Remove crate visibility modifier in libs, tests 2022-05-21 00:32:47 -04:00
externalfiles.rs Restrict From<S> for {D,Subd}iagnosticMessage. 2023-05-03 08:44:39 +10:00
fold.rs clean: Always store enum disriminant. 2023-01-01 18:11:53 +00:00
lib.rs Avoid &format("...") calls in error message code. 2023-05-16 17:59:56 +10:00
lint.rs Add rustdoc::unescaped_backtick lint 2023-04-29 13:13:25 +02:00
markdown.rs Turn MarkdownWithToc into a struct with named fields 2023-02-06 16:31:17 +01:00
README.md rust-lang.github.io/rustc-dev-guide -> rustc-dev-guide.rust-lang.org 2020-03-10 17:08:18 -03:00
scrape_examples.rs Restrict From<S> for {D,Subd}iagnosticMessage. 2023-05-03 08:44:39 +10:00
theme.rs Restrict From<S> for {D,Subd}iagnosticMessage. 2023-05-03 08:44:39 +10:00
visit.rs clean: Always store enum disriminant. 2023-01-01 18:11:53 +00:00
visit_ast.rs Require impl Trait in associated types to appear in method signatures 2023-05-12 10:24:03 +00:00
visit_lib.rs rustdoc: Eliminate remaining uses of resolver 2023-02-13 00:10:15 +04:00

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