Skip to content

Commit b9d44ee

Browse files
committed
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.
1 parent bb121d1 commit b9d44ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pub(crate) enum PossibleFeature<'a> {
3535
struct ExitCode(Option<i32>);
3636

3737
impl IntoDiagnosticArg for ExitCode {
38-
fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
38+
fn into_diagnostic_arg(self) -> DiagnosticArgValue {
3939
let ExitCode(exit_code) = self;
4040
match exit_code {
4141
Some(t) => t.into_diagnostic_arg(),

0 commit comments

Comments
 (0)