@@ -2080,6 +2080,54 @@ impl<I> FromIterator<I> for Box<[I]> {
20802080 }
20812081}
20822082
2083+ #[ cfg( not( no_global_oom_handling) ) ]
2084+ #[ stable( feature = "boxed_str_from_iter" , since = "CURRENT_RUSTC_VERSION" ) ]
2085+ impl FromIterator < char > for Box < str > {
2086+ fn from_iter < T : IntoIterator < Item = char > > ( iter : T ) -> Self {
2087+ String :: from_iter ( iter) . into_boxed_str ( )
2088+ }
2089+ }
2090+
2091+ #[ cfg( not( no_global_oom_handling) ) ]
2092+ #[ stable( feature = "boxed_str_from_iter" , since = "CURRENT_RUSTC_VERSION" ) ]
2093+ impl < ' a > FromIterator < & ' a char > for Box < str > {
2094+ fn from_iter < T : IntoIterator < Item = & ' a char > > ( iter : T ) -> Self {
2095+ String :: from_iter ( iter) . into_boxed_str ( )
2096+ }
2097+ }
2098+
2099+ #[ cfg( not( no_global_oom_handling) ) ]
2100+ #[ stable( feature = "boxed_str_from_iter" , since = "CURRENT_RUSTC_VERSION" ) ]
2101+ impl < ' a > FromIterator < & ' a str > for Box < str > {
2102+ fn from_iter < T : IntoIterator < Item = & ' a str > > ( iter : T ) -> Self {
2103+ String :: from_iter ( iter) . into_boxed_str ( )
2104+ }
2105+ }
2106+
2107+ #[ cfg( not( no_global_oom_handling) ) ]
2108+ #[ stable( feature = "boxed_str_from_iter" , since = "CURRENT_RUSTC_VERSION" ) ]
2109+ impl FromIterator < String > for Box < str > {
2110+ fn from_iter < T : IntoIterator < Item = String > > ( iter : T ) -> Self {
2111+ String :: from_iter ( iter) . into_boxed_str ( )
2112+ }
2113+ }
2114+
2115+ #[ cfg( not( no_global_oom_handling) ) ]
2116+ #[ stable( feature = "boxed_str_from_iter" , since = "CURRENT_RUSTC_VERSION" ) ]
2117+ impl < A : Allocator > FromIterator < Box < str , A > > for Box < str > {
2118+ fn from_iter < T : IntoIterator < Item = Box < str , A > > > ( iter : T ) -> Self {
2119+ String :: from_iter ( iter) . into_boxed_str ( )
2120+ }
2121+ }
2122+
2123+ #[ cfg( not( no_global_oom_handling) ) ]
2124+ #[ stable( feature = "boxed_str_from_iter" , since = "CURRENT_RUSTC_VERSION" ) ]
2125+ impl < ' a > FromIterator < Cow < ' a , str > > for Box < str > {
2126+ fn from_iter < T : IntoIterator < Item = Cow < ' a , str > > > ( iter : T ) -> Self {
2127+ String :: from_iter ( iter) . into_boxed_str ( )
2128+ }
2129+ }
2130+
20832131#[ cfg( not( no_global_oom_handling) ) ]
20842132#[ stable( feature = "box_slice_clone" , since = "1.3.0" ) ]
20852133impl < T : Clone , A : Allocator + Clone > Clone for Box < [ T ] , A > {
0 commit comments