File tree 1 file changed +13
-0
lines changed
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -1013,6 +1013,12 @@ impl<A: Step> Iterator for ops::RangeFrom<A> {
1013
1013
1014
1014
#[ inline]
1015
1015
fn next ( & mut self ) -> Option < A > {
1016
+ #[ cfg( not( bootstrap) ) ]
1017
+ if crate :: intrinsics:: overflow_checks ( ) {
1018
+ self . start = Step :: forward ( self . start . clone ( ) , 1 ) ;
1019
+ return Some ( self . start . clone ( ) ) ;
1020
+ }
1021
+
1016
1022
let n = Step :: forward ( self . start . clone ( ) , 1 ) ;
1017
1023
Some ( mem:: replace ( & mut self . start , n) )
1018
1024
}
@@ -1024,6 +1030,13 @@ impl<A: Step> Iterator for ops::RangeFrom<A> {
1024
1030
1025
1031
#[ inline]
1026
1032
fn nth ( & mut self , n : usize ) -> Option < A > {
1033
+ #[ cfg( not( bootstrap) ) ]
1034
+ if crate :: intrinsics:: overflow_checks ( ) {
1035
+ let plus_n = Step :: forward ( self . start . clone ( ) , n) ;
1036
+ self . start = Step :: forward ( plus_n. clone ( ) , 1 ) ;
1037
+ return Some ( self . start . clone ( ) ) ;
1038
+ }
1039
+
1027
1040
let plus_n = Step :: forward ( self . start . clone ( ) , n) ;
1028
1041
self . start = Step :: forward ( plus_n. clone ( ) , 1 ) ;
1029
1042
Some ( plus_n)
You can’t perform that action at this time.
0 commit comments