rust/compiler/rustc_codegen_ssa/src/back
Nicholas Nethercote 781111ef35 Use Cow in {D,Subd}iagnosticMessage.
Each of `{D,Subd}iagnosticMessage::{Str,Eager}` has a comment:
```
// FIXME(davidtwco): can a `Cow<'static, str>` be used here?
```
This commit answers that question in the affirmative. It's not the most
compelling change ever, but it might be worth merging.

This requires changing the `impl<'a> From<&'a str>` impls to `impl
From<&'static str>`, which involves a bunch of knock-on changes that
require/result in call sites being a little more precise about exactly
what kind of string they use to create errors, and not just `&str`. This
will result in fewer unnecessary allocations, though this will not have
any notable perf effects given that these are error paths.

Note that I was lazy within Clippy, using `to_string` in a few places to
preserve the existing string imprecision. I could have used `impl
Into<{D,Subd}iagnosticMessage>` in various places as is done in the
compiler, but that would have required changes to *many* call sites
(mostly changing `&format("...")` to `format!("...")`) which didn't seem
worthwhile.
2023-05-29 09:23:43 +10:00
..
rpath Remove LibSource 2021-07-05 10:49:07 +02:00
archive.rs Recognize AIX style archive kind 2023-04-19 11:10:47 +08:00
command.rs Reduce usage of Symbol in the linker code 2022-06-28 18:38:36 +00:00
link.rs Use Cow in {D,Subd}iagnosticMessage. 2023-05-29 09:23:43 +10:00
linker.rs Don't assume that -Bdynamic is the default linker mode 2023-05-17 22:52:54 +02:00
lto.rs Merge new_metadata into codegen_allocator 2022-04-30 21:20:08 +02:00
metadata.rs Fix Mac Catalyst linking by adding build version 2023-05-25 00:02:13 -07:00
mod.rs Use the object crate for metadata reading 2021-05-07 18:48:58 +02:00
rpath.rs pass -Wl,-z,origin to set DF_ORIGIN when using rpath 2021-12-17 11:27:14 +00:00
symbol_export.rs Auto merge of #86844 - bjorn3:global_alloc_improvements, r=pnkfelix 2023-05-25 16:59:57 +00:00
write.rs Use Cow in {D,Subd}iagnosticMessage. 2023-05-29 09:23:43 +10:00