@@ -163,6 +163,7 @@ use core::ops::{
163
163
} ;
164
164
use core:: pin:: Pin ;
165
165
use core:: ptr:: { self , NonNull , Unique } ;
166
+ use core:: slice;
166
167
use core:: task:: { Context , Poll } ;
167
168
168
169
#[ cfg( not( no_global_oom_handling) ) ]
@@ -175,6 +176,7 @@ use crate::raw_vec::RawVec;
175
176
use crate :: str:: from_boxed_utf8_unchecked;
176
177
#[ cfg( not( no_global_oom_handling) ) ]
177
178
use crate :: string:: String ;
179
+ use crate :: vec;
178
180
#[ cfg( not( no_global_oom_handling) ) ]
179
181
use crate :: vec:: Vec ;
180
182
@@ -2036,6 +2038,42 @@ impl<I> FromIterator<I> for Box<[I]> {
2036
2038
}
2037
2039
}
2038
2040
2041
+ #[ stable( feature = "boxed_slice_into_iter" , since = "CURRENT_RUSTC_VERSION" ) ]
2042
+ impl < I , A : Allocator > !Iterator for Box < [ I ] , A > { }
2043
+
2044
+ #[ stable( feature = "boxed_slice_into_iter" , since = "CURRENT_RUSTC_VERSION" ) ]
2045
+ impl < I , A : Allocator > IntoIterator for Box < [ I ] , A > {
2046
+ type IntoIter = vec:: IntoIter < I , A > ;
2047
+ type Item = I ;
2048
+ fn into_iter ( self ) -> vec:: IntoIter < I , A > {
2049
+ self . into_vec ( ) . into_iter ( )
2050
+ }
2051
+ }
2052
+
2053
+ #[ stable( feature = "boxed_slice_into_iter" , since = "CURRENT_RUSTC_VERSION" ) ]
2054
+ impl < ' a , I , A : Allocator > !Iterator for & ' a Box < [ I ] , A > { }
2055
+
2056
+ #[ stable( feature = "boxed_slice_into_iter" , since = "CURRENT_RUSTC_VERSION" ) ]
2057
+ impl < ' a , I , A : Allocator > IntoIterator for & ' a Box < [ I ] , A > {
2058
+ type IntoIter = slice:: Iter < ' a , I > ;
2059
+ type Item = & ' a I ;
2060
+ fn into_iter ( self ) -> slice:: Iter < ' a , I > {
2061
+ self . iter ( )
2062
+ }
2063
+ }
2064
+
2065
+ #[ stable( feature = "boxed_slice_into_iter" , since = "CURRENT_RUSTC_VERSION" ) ]
2066
+ impl < ' a , I , A : Allocator > !Iterator for & ' a mut Box < [ I ] , A > { }
2067
+
2068
+ #[ stable( feature = "boxed_slice_into_iter" , since = "CURRENT_RUSTC_VERSION" ) ]
2069
+ impl < ' a , I , A : Allocator > IntoIterator for & ' a mut Box < [ I ] , A > {
2070
+ type IntoIter = slice:: IterMut < ' a , I > ;
2071
+ type Item = & ' a mut I ;
2072
+ fn into_iter ( self ) -> slice:: IterMut < ' a , I > {
2073
+ self . iter_mut ( )
2074
+ }
2075
+ }
2076
+
2039
2077
#[ cfg( not( no_global_oom_handling) ) ]
2040
2078
#[ stable( feature = "box_slice_clone" , since = "1.3.0" ) ]
2041
2079
impl < T : Clone , A : Allocator + Clone > Clone for Box < [ T ] , A > {
0 commit comments