@@ -23,7 +23,7 @@ use std::process::ExitStatus;
2323pub struct DiagnosticArgFromDisplay < ' a > ( pub & ' a dyn fmt:: Display ) ;
2424
2525impl IntoDiagnosticArg for DiagnosticArgFromDisplay < ' _ > {
26- fn into_diagnostic_arg ( self ) -> DiagnosticArgValue < ' static > {
26+ fn into_diagnostic_arg ( self ) -> DiagnosticArgValue {
2727 self . 0 . to_string ( ) . into_diagnostic_arg ( )
2828 }
2929}
@@ -41,7 +41,7 @@ impl<'a, T: fmt::Display> From<&'a T> for DiagnosticArgFromDisplay<'a> {
4141}
4242
4343impl < ' a , T : Clone + IntoDiagnosticArg > IntoDiagnosticArg for & ' a T {
44- fn into_diagnostic_arg ( self ) -> DiagnosticArgValue < ' static > {
44+ fn into_diagnostic_arg ( self ) -> DiagnosticArgValue {
4545 self . clone ( ) . into_diagnostic_arg ( )
4646 }
4747}
@@ -50,7 +50,7 @@ macro_rules! into_diagnostic_arg_using_display {
5050 ( $( $ty: ty ) ,+ $( , ) ?) => {
5151 $(
5252 impl IntoDiagnosticArg for $ty {
53- fn into_diagnostic_arg( self ) -> DiagnosticArgValue < ' static > {
53+ fn into_diagnostic_arg( self ) -> DiagnosticArgValue {
5454 self . to_string( ) . into_diagnostic_arg( )
5555 }
5656 }
@@ -62,7 +62,7 @@ macro_rules! into_diagnostic_arg_for_number {
6262 ( $( $ty: ty ) ,+ $( , ) ?) => {
6363 $(
6464 impl IntoDiagnosticArg for $ty {
65- fn into_diagnostic_arg( self ) -> DiagnosticArgValue < ' static > {
65+ fn into_diagnostic_arg( self ) -> DiagnosticArgValue {
6666 // HACK: `FluentNumber` the underline backing struct represent
6767 // numbers using a f64 which can't represent all the i128 numbers
6868 // So in order to be able to use fluent selectors and still
@@ -99,7 +99,7 @@ into_diagnostic_arg_using_display!(
9999into_diagnostic_arg_for_number ! ( i8 , u8 , i16 , u16 , i32 , u32 , i64 , u64 , i128 , u128 , isize , usize ) ;
100100
101101impl IntoDiagnosticArg for bool {
102- fn into_diagnostic_arg ( self ) -> DiagnosticArgValue < ' static > {
102+ fn into_diagnostic_arg ( self ) -> DiagnosticArgValue {
103103 if self {
104104 DiagnosticArgValue :: Str ( Cow :: Borrowed ( "true" ) )
105105 } else {
@@ -109,63 +109,63 @@ impl IntoDiagnosticArg for bool {
109109}
110110
111111impl IntoDiagnosticArg for char {
112- fn into_diagnostic_arg ( self ) -> DiagnosticArgValue < ' static > {
112+ fn into_diagnostic_arg ( self ) -> DiagnosticArgValue {
113113 DiagnosticArgValue :: Str ( Cow :: Owned ( format ! ( "{self:?}" ) ) )
114114 }
115115}
116116
117117impl IntoDiagnosticArg for Vec < char > {
118- fn into_diagnostic_arg ( self ) -> DiagnosticArgValue < ' static > {
118+ fn into_diagnostic_arg ( self ) -> DiagnosticArgValue {
119119 DiagnosticArgValue :: StrListSepByAnd (
120120 self . into_iter ( ) . map ( |c| Cow :: Owned ( format ! ( "{c:?}" ) ) ) . collect ( ) ,
121121 )
122122 }
123123}
124124
125125impl IntoDiagnosticArg for Symbol {
126- fn into_diagnostic_arg ( self ) -> DiagnosticArgValue < ' static > {
126+ fn into_diagnostic_arg ( self ) -> DiagnosticArgValue {
127127 self . to_ident_string ( ) . into_diagnostic_arg ( )
128128 }
129129}
130130
131131impl < ' a > IntoDiagnosticArg for & ' a str {
132- fn into_diagnostic_arg ( self ) -> DiagnosticArgValue < ' static > {
132+ fn into_diagnostic_arg ( self ) -> DiagnosticArgValue {
133133 self . to_string ( ) . into_diagnostic_arg ( )
134134 }
135135}
136136
137137impl IntoDiagnosticArg for String {
138- fn into_diagnostic_arg ( self ) -> DiagnosticArgValue < ' static > {
138+ fn into_diagnostic_arg ( self ) -> DiagnosticArgValue {
139139 DiagnosticArgValue :: Str ( Cow :: Owned ( self ) )
140140 }
141141}
142142
143143impl < ' a > IntoDiagnosticArg for Cow < ' a , str > {
144- fn into_diagnostic_arg ( self ) -> DiagnosticArgValue < ' static > {
144+ fn into_diagnostic_arg ( self ) -> DiagnosticArgValue {
145145 DiagnosticArgValue :: Str ( Cow :: Owned ( self . into_owned ( ) ) )
146146 }
147147}
148148
149149impl < ' a > IntoDiagnosticArg for & ' a Path {
150- fn into_diagnostic_arg ( self ) -> DiagnosticArgValue < ' static > {
150+ fn into_diagnostic_arg ( self ) -> DiagnosticArgValue {
151151 DiagnosticArgValue :: Str ( Cow :: Owned ( self . display ( ) . to_string ( ) ) )
152152 }
153153}
154154
155155impl IntoDiagnosticArg for PathBuf {
156- fn into_diagnostic_arg ( self ) -> DiagnosticArgValue < ' static > {
156+ fn into_diagnostic_arg ( self ) -> DiagnosticArgValue {
157157 DiagnosticArgValue :: Str ( Cow :: Owned ( self . display ( ) . to_string ( ) ) )
158158 }
159159}
160160
161161impl IntoDiagnosticArg for PanicStrategy {
162- fn into_diagnostic_arg ( self ) -> DiagnosticArgValue < ' static > {
162+ fn into_diagnostic_arg ( self ) -> DiagnosticArgValue {
163163 DiagnosticArgValue :: Str ( Cow :: Owned ( self . desc ( ) . to_string ( ) ) )
164164 }
165165}
166166
167167impl IntoDiagnosticArg for hir:: ConstContext {
168- fn into_diagnostic_arg ( self ) -> DiagnosticArgValue < ' static > {
168+ fn into_diagnostic_arg ( self ) -> DiagnosticArgValue {
169169 DiagnosticArgValue :: Str ( Cow :: Borrowed ( match self {
170170 hir:: ConstContext :: ConstFn => "const_fn" ,
171171 hir:: ConstContext :: Static ( _) => "static" ,
@@ -175,57 +175,57 @@ impl IntoDiagnosticArg for hir::ConstContext {
175175}
176176
177177impl IntoDiagnosticArg for ast:: Expr {
178- fn into_diagnostic_arg ( self ) -> DiagnosticArgValue < ' static > {
178+ fn into_diagnostic_arg ( self ) -> DiagnosticArgValue {
179179 DiagnosticArgValue :: Str ( Cow :: Owned ( pprust:: expr_to_string ( & self ) ) )
180180 }
181181}
182182
183183impl IntoDiagnosticArg for ast:: Path {
184- fn into_diagnostic_arg ( self ) -> DiagnosticArgValue < ' static > {
184+ fn into_diagnostic_arg ( self ) -> DiagnosticArgValue {
185185 DiagnosticArgValue :: Str ( Cow :: Owned ( pprust:: path_to_string ( & self ) ) )
186186 }
187187}
188188
189189impl IntoDiagnosticArg for ast:: token:: Token {
190- fn into_diagnostic_arg ( self ) -> DiagnosticArgValue < ' static > {
190+ fn into_diagnostic_arg ( self ) -> DiagnosticArgValue {
191191 DiagnosticArgValue :: Str ( pprust:: token_to_string ( & self ) )
192192 }
193193}
194194
195195impl IntoDiagnosticArg for ast:: token:: TokenKind {
196- fn into_diagnostic_arg ( self ) -> DiagnosticArgValue < ' static > {
196+ fn into_diagnostic_arg ( self ) -> DiagnosticArgValue {
197197 DiagnosticArgValue :: Str ( pprust:: token_kind_to_string ( & self ) )
198198 }
199199}
200200
201201impl IntoDiagnosticArg for type_ir:: FloatTy {
202- fn into_diagnostic_arg ( self ) -> DiagnosticArgValue < ' static > {
202+ fn into_diagnostic_arg ( self ) -> DiagnosticArgValue {
203203 DiagnosticArgValue :: Str ( Cow :: Borrowed ( self . name_str ( ) ) )
204204 }
205205}
206206
207207impl IntoDiagnosticArg for std:: ffi:: CString {
208- fn into_diagnostic_arg ( self ) -> DiagnosticArgValue < ' static > {
208+ fn into_diagnostic_arg ( self ) -> DiagnosticArgValue {
209209 DiagnosticArgValue :: Str ( Cow :: Owned ( self . to_string_lossy ( ) . into_owned ( ) ) )
210210 }
211211}
212212
213213impl IntoDiagnosticArg for rustc_data_structures:: small_c_str:: SmallCStr {
214- fn into_diagnostic_arg ( self ) -> DiagnosticArgValue < ' static > {
214+ fn into_diagnostic_arg ( self ) -> DiagnosticArgValue {
215215 DiagnosticArgValue :: Str ( Cow :: Owned ( self . to_string_lossy ( ) . into_owned ( ) ) )
216216 }
217217}
218218
219219impl IntoDiagnosticArg for ast:: Visibility {
220- fn into_diagnostic_arg ( self ) -> DiagnosticArgValue < ' static > {
220+ fn into_diagnostic_arg ( self ) -> DiagnosticArgValue {
221221 let s = pprust:: vis_to_string ( & self ) ;
222222 let s = s. trim_end ( ) . to_string ( ) ;
223223 DiagnosticArgValue :: Str ( Cow :: Owned ( s) )
224224 }
225225}
226226
227227impl IntoDiagnosticArg for rustc_lint_defs:: Level {
228- fn into_diagnostic_arg ( self ) -> DiagnosticArgValue < ' static > {
228+ fn into_diagnostic_arg ( self ) -> DiagnosticArgValue {
229229 DiagnosticArgValue :: Str ( Cow :: Borrowed ( self . to_cmd_flag ( ) ) )
230230 }
231231}
@@ -240,15 +240,15 @@ impl From<Vec<Symbol>> for DiagnosticSymbolList {
240240}
241241
242242impl IntoDiagnosticArg for DiagnosticSymbolList {
243- fn into_diagnostic_arg ( self ) -> DiagnosticArgValue < ' static > {
243+ fn into_diagnostic_arg ( self ) -> DiagnosticArgValue {
244244 DiagnosticArgValue :: StrListSepByAnd (
245245 self . 0 . into_iter ( ) . map ( |sym| Cow :: Owned ( format ! ( "`{sym}`" ) ) ) . collect ( ) ,
246246 )
247247 }
248248}
249249
250250impl < Id > IntoDiagnosticArg for hir:: def:: Res < Id > {
251- fn into_diagnostic_arg ( self ) -> DiagnosticArgValue < ' static > {
251+ fn into_diagnostic_arg ( self ) -> DiagnosticArgValue {
252252 DiagnosticArgValue :: Str ( Cow :: Borrowed ( self . descr ( ) ) )
253253 }
254254}
@@ -334,13 +334,13 @@ pub struct DelayedAtWithoutNewline {
334334}
335335
336336impl IntoDiagnosticArg for DiagnosticLocation {
337- fn into_diagnostic_arg ( self ) -> DiagnosticArgValue < ' static > {
337+ fn into_diagnostic_arg ( self ) -> DiagnosticArgValue {
338338 DiagnosticArgValue :: Str ( Cow :: from ( self . to_string ( ) ) )
339339 }
340340}
341341
342342impl IntoDiagnosticArg for Backtrace {
343- fn into_diagnostic_arg ( self ) -> DiagnosticArgValue < ' static > {
343+ fn into_diagnostic_arg ( self ) -> DiagnosticArgValue {
344344 DiagnosticArgValue :: Str ( Cow :: from ( self . to_string ( ) ) )
345345 }
346346}
@@ -353,7 +353,7 @@ pub struct InvalidFlushedDelayedDiagnosticLevel {
353353 pub level : Level ,
354354}
355355impl IntoDiagnosticArg for Level {
356- fn into_diagnostic_arg ( self ) -> DiagnosticArgValue < ' static > {
356+ fn into_diagnostic_arg ( self ) -> DiagnosticArgValue {
357357 DiagnosticArgValue :: Str ( Cow :: from ( self . to_string ( ) ) )
358358 }
359359}
@@ -368,7 +368,7 @@ pub struct IndicateAnonymousLifetime {
368368}
369369
370370impl IntoDiagnosticArg for type_ir:: ClosureKind {
371- fn into_diagnostic_arg ( self ) -> DiagnosticArgValue < ' static > {
371+ fn into_diagnostic_arg ( self ) -> DiagnosticArgValue {
372372 DiagnosticArgValue :: Str ( self . as_str ( ) . into ( ) )
373373 }
374374}
0 commit comments