From bd83bbc93adce97e34c1c4d5d8d74f7b19068326 Mon Sep 17 00:00:00 2001 From: Jhonny Bill Mena Date: Sun, 21 Aug 2022 00:42:59 -0400 Subject: [PATCH] UPDATE - accept String instead of unused 'str --- compiler/rustc_symbol_mangling/src/errors.rs | 12 ++++++------ compiler/rustc_symbol_mangling/src/test.rs | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/compiler/rustc_symbol_mangling/src/errors.rs b/compiler/rustc_symbol_mangling/src/errors.rs index db8b3159a6f..c0e49e07bfc 100644 --- a/compiler/rustc_symbol_mangling/src/errors.rs +++ b/compiler/rustc_symbol_mangling/src/errors.rs @@ -5,24 +5,24 @@ #[derive(SessionDiagnostic)] #[error(symbol_mangling::invalid_symbol_name)] -pub struct InvalidSymbolName<'a> { +pub struct InvalidSymbolName { #[primary_span] pub span: Span, - pub mangled_formatted: &'a str, + pub mangled_formatted: String, } #[derive(SessionDiagnostic)] #[error(symbol_mangling::invalid_trait_item)] -pub struct InvalidTraitItem<'a> { +pub struct InvalidTraitItem { #[primary_span] pub span: Span, - pub demangling_formatted: &'a str, + pub demangling_formatted: String, } #[derive(SessionDiagnostic)] #[error(symbol_mangling::alt_invalid_trait_item)] -pub struct AltInvalidTraitItem<'a> { +pub struct AltInvalidTraitItem { #[primary_span] pub span: Span, - pub alt_demangling_formatted: &'a str, + pub alt_demangling_formatted: String, } diff --git a/compiler/rustc_symbol_mangling/src/test.rs b/compiler/rustc_symbol_mangling/src/test.rs index 06efefb726c..2ed1dea357d 100644 --- a/compiler/rustc_symbol_mangling/src/test.rs +++ b/compiler/rustc_symbol_mangling/src/test.rs @@ -62,16 +62,16 @@ fn process_attrs(&mut self, def_id: LocalDefId) { let mangled = tcx.symbol_name(instance); tcx.sess.emit_err(InvalidSymbolName { span: attr.span, - mangled_formatted: &format!("{mangled}"), + mangled_formatted: format!("{mangled}"), }); if let Ok(demangling) = rustc_demangle::try_demangle(mangled.name) { tcx.sess.emit_err(InvalidTraitItem { span: attr.span, - demangling_formatted: &format!("{demangling}"), + demangling_formatted: format!("{demangling}"), }); tcx.sess.emit_err(AltInvalidTraitItem { span: attr.span, - alt_demangling_formatted: &format!("{:#}", demangling), + alt_demangling_formatted: format!("{:#}", demangling), }); } }