File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
compiler/rustc_errors/src Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -298,15 +298,21 @@ impl IntoDiagArg for hir::def::Namespace {
298
298
}
299
299
300
300
#[ derive( Clone ) ]
301
- pub struct DiagSymbolList ( Vec < Symbol > ) ;
301
+ pub struct DiagSymbolList < S = Symbol > ( Vec < S > ) ;
302
302
303
- impl From < Vec < Symbol > > for DiagSymbolList {
304
- fn from ( v : Vec < Symbol > ) -> Self {
303
+ impl < S > From < Vec < S > > for DiagSymbolList < S > {
304
+ fn from ( v : Vec < S > ) -> Self {
305
305
DiagSymbolList ( v)
306
306
}
307
307
}
308
308
309
- impl IntoDiagArg for DiagSymbolList {
309
+ impl < S > FromIterator < S > for DiagSymbolList < S > {
310
+ fn from_iter < T : IntoIterator < Item = S > > ( iter : T ) -> Self {
311
+ iter. into_iter ( ) . collect :: < Vec < _ > > ( ) . into ( )
312
+ }
313
+ }
314
+
315
+ impl < S : std:: fmt:: Display > IntoDiagArg for DiagSymbolList < S > {
310
316
fn into_diag_arg ( self ) -> DiagArgValue {
311
317
DiagArgValue :: StrListSepByAnd (
312
318
self . 0 . into_iter ( ) . map ( |sym| Cow :: Owned ( format ! ( "`{sym}`" ) ) ) . collect ( ) ,
You can’t perform that action at this time.
0 commit comments