rust/src/tools
bors 70e04bd88d Auto merge of #111748 - nnethercote:Cow-DiagnosticMessage, r=WaffleLapkin
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.

r? `@WaffleLapkin`
2023-05-29 07:10:44 +00:00
..
build-manifest Promote loongarch64-unknown-linux-gnu to Tier 2 with host tools 2023-05-23 18:33:57 +08:00
build_helper Group entire build steps in the gha logs 2023-04-22 22:20:12 +00:00
bump-stage0 remove some unneeded imports 2023-04-12 19:27:18 +02:00
cargo@64fb38c97a Update cargo 2023-05-23 23:20:16 +01:00
cargotest Override linker in cargotest on windows 2022-10-23 19:33:03 -05:00
clippy Use Cow in {D,Subd}iagnosticMessage. 2023-05-29 09:23:43 +10:00
collect-license-metadata Fix remaining typos 2023-04-10 21:02:49 +02:00
compiletest Auto merge of #111813 - scottmcm:pretty-mir, r=cjgillot 2023-05-28 21:53:56 +00:00
error_index_generator refactor: improve error-index-generator dependency 2023-02-26 20:13:06 +13:00
expand-yaml-anchors Run expand-yaml-anchors in x test tidy 2023-02-05 14:46:52 -06:00
generate-copyright Fix remaining typos 2023-04-10 21:02:49 +02:00
generate-windows-sys Sort windows_sys.lst alphabetically 2023-05-05 20:48:17 +01:00
html-checker
jsondocck Fix remaining typos 2023-04-10 21:02:49 +02:00
jsondoclint IAT: Rustdoc integration 2023-05-04 16:59:11 +02:00
linkchecker Appease lints 2023-05-14 22:00:23 +02:00
lint-docs Fix x test lint-docs when download-rustc is enabled 2023-04-18 23:08:48 -05:00
lld-wrapper fix lld-wrapper lld flavor detection 2022-09-07 14:51:54 +02:00
miri Use Cow in {D,Subd}iagnosticMessage. 2023-05-29 09:23:43 +10:00
miropt-test-tools add passes to miroptfiles struct and passed to -zdump-mir args 2023-05-04 18:56:32 -04:00
remote-test-client tools/remote-test-{server,client}: Use /data/local/tmp on Android 2022-10-06 13:42:32 -07:00
remote-test-server Use u32 methods instead of manual shifting 2022-12-23 16:08:23 +05:30
replace-version-placeholder Only depend on CFG_VERSION in rustc_interface 2023-05-17 23:54:21 -05:00
rls chore: remove rustc-workspace-hack 2023-04-16 19:32:20 +01:00
rust-analyzer Remove identity_future from stdlib 2023-05-07 10:52:01 +02:00
rust-demangler
rust-installer Rollup merge of #110188 - Nilstrieb:remove-remove-dir-all, r=jyn514 2023-04-12 17:04:32 +02:00
rustbook bump few deps 2023-04-06 18:21:37 +03:00
rustdoc rustdoc: Use unix_sigpipe instead of rustc_driver::set_sigpipe_handler 2022-10-24 20:40:46 +02:00
rustdoc-gui Migrate to 0.16.0 browser-ui-test version 2023-05-11 11:34:22 +02:00
rustdoc-gui-test create new tool rustdoc-gui-test 2023-05-20 14:40:11 +03:00
rustdoc-js rustdoc: restructure type search engine to pick-and-use IDs 2023-04-17 12:16:54 -07:00
rustdoc-themes
rustfmt Rollup merge of #110989 - jyn514:bug-report-url, r=WaffleLapkin 2023-05-06 13:30:04 +02:00
suggest-tests Fix the test directories suggested by ./x.py suggest 2023-04-30 11:05:13 +10:00
tidy Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
tier-check Encourage developers not to use periods in target names 2022-11-17 10:41:41 +01:00
unicode-table-generator remove some unneeded imports 2023-04-12 19:27:18 +02:00
unstable-book-gen unstable-book-gen: use std::fs::write 2022-08-28 00:40:58 +02:00
x make x look for x.py if shell script does not exist 2023-02-15 15:19:49 +08:00
cherry-pick.sh
publish_toolstate.py rename maybe_delink to maybe_remove_mention 2023-04-11 14:04:50 +02:00