about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-01-30 15:27:16 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2024-01-30 18:46:06 +1100
commitb9d44eef7ad1fc21d3c6fed7f0ca5401ae59f5f8 (patch)
tree9cbbabe2626b54c2ef9f87d077ce1d02dd657f92
parentbb121d111d7be01461e7ae1bcf8a060afce0fa57 (diff)
downloadrust-b9d44eef7ad1fc21d3c6fed7f0ca5401ae59f5f8.tar.gz
rust-b9d44eef7ad1fc21d3c6fed7f0ca5401ae59f5f8.zip
Remove the lifetime from `DiagnosticArgValue`.
Because it's almost always static.

This makes `impl IntoDiagnosticArg for DiagnosticArgValue` trivial,
which is nice.

There are a few diagnostics constructed in
`compiler/rustc_mir_build/src/check_unsafety.rs` and
`compiler/rustc_mir_transform/src/errors.rs` that now need symbols
converted to `String` with `to_string` instead of `&str` with `as_str`,
but that' no big deal, and worth it for the simplifications elsewhere.
-rw-r--r--src/errors.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/errors.rs b/src/errors.rs
index e9283b19894..cc0fbe46dcc 100644
--- a/src/errors.rs
+++ b/src/errors.rs
@@ -35,7 +35,7 @@ pub(crate) enum PossibleFeature<'a> {
 struct ExitCode(Option<i32>);
 
 impl IntoDiagnosticArg for ExitCode {
-    fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
+    fn into_diagnostic_arg(self) -> DiagnosticArgValue {
         let ExitCode(exit_code) = self;
         match exit_code {
             Some(t) => t.into_diagnostic_arg(),