File tree Expand file tree Collapse file tree 2 files changed +33
-2
lines changed Expand file tree Collapse file tree 2 files changed +33
-2
lines changed Original file line number Diff line number Diff line change @@ -165,8 +165,16 @@ macro_rules! step_impl_no_between {
165165 ) * )
166166}
167167
168- step_impl_unsigned ! ( usize u8 u16 u32 ) ;
169- step_impl_signed ! ( [ isize : usize ] [ i8 : u8 ] [ i16 : u16 ] [ i32 : u32 ] ) ;
168+ step_impl_unsigned ! ( usize u8 u16 ) ;
169+ #[ cfg( not( target_pointer_witdth = "16" ) ) ]
170+ step_impl_unsigned ! ( u32 ) ;
171+ #[ cfg( target_pointer_witdth = "16" ) ]
172+ step_impl_no_between ! ( u32 ) ;
173+ step_impl_signed ! ( [ isize : usize ] [ i8 : u8 ] [ i16 : u16 ] ) ;
174+ #[ cfg( not( target_pointer_witdth = "16" ) ) ]
175+ step_impl_signed ! ( [ i32 : u32 ] ) ;
176+ #[ cfg( target_pointer_witdth = "16" ) ]
177+ step_impl_no_between ! ( i32 ) ;
170178#[ cfg( target_pointer_width = "64" ) ]
171179step_impl_unsigned ! ( u64 ) ;
172180#[ cfg( target_pointer_width = "64" ) ]
Original file line number Diff line number Diff line change 1+ // Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2+ // file at the top-level directory of this distribution and at
3+ // http://rust-lang.org/COPYRIGHT.
4+ //
5+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+ // option. This file may not be copied, modified, or distributed
9+ // except according to those terms.
10+
11+ #![ feature( step_trait) ]
12+
13+ use std:: iter:: Step ;
14+
15+ #[ cfg( target_pointer_width = "16" ) ]
16+ fn main ( ) {
17+ assert ! ( Step :: steps_between( & 0u32 , & :: std:: u32 :: MAX ) . is_none( ) ) ;
18+ }
19+
20+ #[ cfg( any( target_pointer_width = "32" , target_pointer_width = "64" ) ) ]
21+ fn main ( ) {
22+ assert ! ( Step :: steps_between( & 0u32 , & :: std:: u32 :: MAX ) . is_some( ) ) ;
23+ }
You can’t perform that action at this time.
0 commit comments