diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-01-07 17:17:23 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-01-07 17:17:23 -0800 |
| commit | 6301c7878ebcaa45e77315db2a9afd8b5d1425c8 (patch) | |
| tree | 90576b7ba7ac0ee4e9f5c91e6b6bc20a454dbc37 /src/libstd | |
| parent | f3b67afcab9293faf77aafeaccfdda19e5a08d38 (diff) | |
| parent | dd3e89aaf25c667fa8207f8800c4b60d70d76c1b (diff) | |
| download | rust-6301c7878ebcaa45e77315db2a9afd8b5d1425c8.tar.gz rust-6301c7878ebcaa45e77315db2a9afd8b5d1425c8.zip | |
rollup merge of #20680: nick29581/target-word
Closes #20421 [breaking-change] r? @brson
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/num/mod.rs | 42 | ||||
| -rw-r--r-- | src/libstd/rand/mod.rs | 4 | ||||
| -rw-r--r-- | src/libstd/sys/common/backtrace.rs | 7 | ||||
| -rw-r--r-- | src/libstd/sys/unix/c.rs | 4 | ||||
| -rw-r--r-- | src/libstd/sys/unix/stack_overflow.rs | 6 |
5 files changed, 41 insertions, 22 deletions
diff --git a/src/libstd/num/mod.rs b/src/libstd/num/mod.rs index f433cd1e664..9c6911cf4d1 100644 --- a/src/libstd/num/mod.rs +++ b/src/libstd/num/mod.rs @@ -424,12 +424,14 @@ mod tests { assert_eq!(int::MIN.to_u32(), None); assert_eq!(int::MIN.to_u64(), None); - #[cfg(target_word_size = "32")] + #[cfg(any(all(stage0, target_word_size = "32"), + all(not(stage0), target_pointer_width = "32")))] fn check_word_size() { assert_eq!(int::MIN.to_i32(), Some(int::MIN as i32)); } - #[cfg(target_word_size = "64")] + #[cfg(any(all(stage0, target_word_size = "64"), + all(not(stage0), target_pointer_width = "64")))] fn check_word_size() { assert_eq!(int::MIN.to_i32(), None); } @@ -492,12 +494,14 @@ mod tests { assert_eq!(i64::MIN.to_u32(), None); assert_eq!(i64::MIN.to_u64(), None); - #[cfg(target_word_size = "32")] + #[cfg(any(all(stage0, target_word_size = "32"), + all(not(stage0), target_pointer_width = "32")))] fn check_word_size() { assert_eq!(i64::MIN.to_int(), None); } - #[cfg(target_word_size = "64")] + #[cfg(any(all(stage0, target_word_size = "64"), + all(not(stage0), target_pointer_width = "64")))] fn check_word_size() { assert_eq!(i64::MIN.to_int(), Some(i64::MIN as int)); } @@ -517,13 +521,15 @@ mod tests { // int::MAX.to_u32() is word-size specific assert_eq!(int::MAX.to_u64(), Some(int::MAX as u64)); - #[cfg(target_word_size = "32")] + #[cfg(any(all(stage0, target_word_size = "32"), + all(not(stage0), target_pointer_width = "32")))] fn check_word_size() { assert_eq!(int::MAX.to_i32(), Some(int::MAX as i32)); assert_eq!(int::MAX.to_u32(), Some(int::MAX as u32)); } - #[cfg(target_word_size = "64")] + #[cfg(any(all(stage0, target_word_size = "64"), + all(not(stage0), target_pointer_width = "64")))] fn check_word_size() { assert_eq!(int::MAX.to_i32(), None); assert_eq!(int::MAX.to_u32(), None); @@ -587,13 +593,15 @@ mod tests { assert_eq!(i64::MAX.to_u32(), None); assert_eq!(i64::MAX.to_u64(), Some(i64::MAX as u64)); - #[cfg(target_word_size = "32")] + #[cfg(any(all(stage0, target_word_size = "32"), + all(not(stage0), target_pointer_width = "32")))] fn check_word_size() { assert_eq!(i64::MAX.to_int(), None); assert_eq!(i64::MAX.to_uint(), None); } - #[cfg(target_word_size = "64")] + #[cfg(any(all(stage0, target_word_size = "64"), + all(not(stage0), target_pointer_width = "64")))] fn check_word_size() { assert_eq!(i64::MAX.to_int(), Some(i64::MAX as int)); assert_eq!(i64::MAX.to_uint(), Some(i64::MAX as uint)); @@ -684,13 +692,15 @@ mod tests { // uint::MAX.to_u32() is word-size specific assert_eq!(uint::MAX.to_u64(), Some(uint::MAX as u64)); - #[cfg(target_word_size = "32")] + #[cfg(any(all(stage0, target_word_size = "32"), + all(not(stage0), target_pointer_width = "32")))] fn check_word_size() { assert_eq!(uint::MAX.to_u32(), Some(uint::MAX as u32)); assert_eq!(uint::MAX.to_i64(), Some(uint::MAX as i64)); } - #[cfg(target_word_size = "64")] + #[cfg(any(all(stage0, target_word_size = "64"), + all(not(stage0), target_pointer_width = "64")))] fn check_word_size() { assert_eq!(uint::MAX.to_u32(), None); assert_eq!(uint::MAX.to_i64(), None); @@ -740,12 +750,14 @@ mod tests { assert_eq!(u32::MAX.to_u32(), Some(u32::MAX as u32)); assert_eq!(u32::MAX.to_u64(), Some(u32::MAX as u64)); - #[cfg(target_word_size = "32")] + #[cfg(any(all(stage0, target_word_size = "32"), + all(not(stage0), target_pointer_width = "32")))] fn check_word_size() { assert_eq!(u32::MAX.to_int(), None); } - #[cfg(target_word_size = "64")] + #[cfg(any(all(stage0, target_word_size = "64"), + all(not(stage0), target_pointer_width = "64")))] fn check_word_size() { assert_eq!(u32::MAX.to_int(), Some(u32::MAX as int)); } @@ -766,12 +778,14 @@ mod tests { assert_eq!(u64::MAX.to_u32(), None); assert_eq!(u64::MAX.to_u64(), Some(u64::MAX as u64)); - #[cfg(target_word_size = "32")] + #[cfg(any(all(stage0, target_word_size = "32"), + all(not(stage0), target_pointer_width = "32")))] fn check_word_size() { assert_eq!(u64::MAX.to_uint(), None); } - #[cfg(target_word_size = "64")] + #[cfg(any(all(stage0, target_word_size = "64"), + all(not(stage0), target_pointer_width = "64")))] fn check_word_size() { assert_eq!(u64::MAX.to_uint(), Some(u64::MAX as uint)); } diff --git a/src/libstd/rand/mod.rs b/src/libstd/rand/mod.rs index d3e6cd166ec..91e3b4a0687 100644 --- a/src/libstd/rand/mod.rs +++ b/src/libstd/rand/mod.rs @@ -230,9 +230,9 @@ use rc::Rc; use result::Result::{Ok, Err}; use vec::Vec; -#[cfg(not(target_word_size="64"))] +#[cfg(any(all(stage0, target_word_size = "32"), all(not(stage0), target_pointer_width = "32")))] use core_rand::IsaacRng as IsaacWordRng; -#[cfg(target_word_size="64")] +#[cfg(any(all(stage0, target_word_size = "64"), all(not(stage0), target_pointer_width = "64")))] use core_rand::Isaac64Rng as IsaacWordRng; pub use core_rand::{Rand, Rng, SeedableRng, Open01, Closed01}; diff --git a/src/libstd/sys/common/backtrace.rs b/src/libstd/sys/common/backtrace.rs index be44aa99f49..f6161ec193d 100644 --- a/src/libstd/sys/common/backtrace.rs +++ b/src/libstd/sys/common/backtrace.rs @@ -12,8 +12,11 @@ use prelude::v1::*; use io::IoResult; -#[cfg(target_word_size = "64")] pub const HEX_WIDTH: uint = 18; -#[cfg(target_word_size = "32")] pub const HEX_WIDTH: uint = 10; +#[cfg(any(all(stage0, target_word_size = "64"), all(not(stage0), target_pointer_width = "64")))] +pub const HEX_WIDTH: uint = 18; + +#[cfg(any(all(stage0, target_word_size = "32"), all(not(stage0), target_pointer_width = "32")))] +pub const HEX_WIDTH: uint = 10; // All rust symbols are in theory lists of "::"-separated identifiers. Some // assemblers, however, can't handle these characters in symbol names. To get diff --git a/src/libstd/sys/unix/c.rs b/src/libstd/sys/unix/c.rs index cc661877bc0..1d523ed6edd 100644 --- a/src/libstd/sys/unix/c.rs +++ b/src/libstd/sys/unix/c.rs @@ -169,13 +169,13 @@ mod signal { unsafe impl ::marker::Sync for sigaction { } #[repr(C)] - #[cfg(target_word_size = "32")] + #[cfg(any(all(stage0, target_word_size = "32"), all(not(stage0), target_pointer_width = "32")))] pub struct sigset_t { __val: [libc::c_ulong; 32], } #[repr(C)] - #[cfg(target_word_size = "64")] + #[cfg(any(all(stage0, target_word_size = "64"), all(not(stage0), target_pointer_width = "64")))] pub struct sigset_t { __val: [libc::c_ulong; 16], } diff --git a/src/libstd/sys/unix/stack_overflow.rs b/src/libstd/sys/unix/stack_overflow.rs index 1fd619a28db..48a51813ba4 100644 --- a/src/libstd/sys/unix/stack_overflow.rs +++ b/src/libstd/sys/unix/stack_overflow.rs @@ -182,12 +182,14 @@ mod imp { sa_restorer: *mut libc::c_void, } - #[cfg(target_word_size = "32")] + #[cfg(any(all(stage0, target_word_size = "32"), + all(not(stage0), target_pointer_width = "32")))] #[repr(C)] pub struct sigset_t { __val: [libc::c_ulong; 32], } - #[cfg(target_word_size = "64")] + #[cfg(any(all(stage0, target_word_size = "64"), + all(not(stage0), target_pointer_width = "64")))] #[repr(C)] pub struct sigset_t { __val: [libc::c_ulong; 16], |
