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 {
298298}
299299
300300#[ derive( Clone ) ]
301- pub struct DiagSymbolList ( Vec < Symbol > ) ;
301+ pub struct DiagSymbolList < S = Symbol > ( Vec < S > ) ;
302302
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 {
305305 DiagSymbolList ( v)
306306 }
307307}
308308
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 > {
310316 fn into_diag_arg ( self ) -> DiagArgValue {
311317 DiagArgValue :: StrListSepByAnd (
312318 self . 0 . into_iter ( ) . map ( |sym| Cow :: Owned ( format ! ( "`{sym}`" ) ) ) . collect ( ) ,
You can’t perform that action at this time.
0 commit comments