rollup merge of #20680: nick29581/target-word
Closes #20421 [breaking-change] r? @brson
This commit is contained in:
commit
6301c7878e
36 changed files with 91 additions and 69 deletions
|
|
@ -12,12 +12,12 @@
|
|||
|
||||
// FIXME: work properly with higher limits
|
||||
|
||||
#[cfg(target_word_size = "32")]
|
||||
#[cfg(any(all(stage0, target_word_size = "32"), all(not(stage0), target_pointer_width = "32")))]
|
||||
fn main() {
|
||||
let big: Option<[u32; (1<<29)-1]> = None;
|
||||
}
|
||||
|
||||
#[cfg(target_word_size = "64")]
|
||||
#[cfg(any(all(stage0, target_word_size = "64"), all(not(stage0), target_pointer_width = "64")))]
|
||||
fn main() {
|
||||
let big: Option<[u32; (1<<45)-1]> = None;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,14 +10,14 @@
|
|||
|
||||
// error-pattern: too big for the current architecture
|
||||
|
||||
#[cfg(target_word_size = "64")]
|
||||
#[cfg(any(all(stage0, target_word_size = "64"), all(not(stage0), target_pointer_width = "64")))]
|
||||
fn main() {
|
||||
let n = 0u;
|
||||
let a = box [&n; 0xF000000000000000u];
|
||||
println!("{}", a[0xFFFFFFu]);
|
||||
}
|
||||
|
||||
#[cfg(target_word_size = "32")]
|
||||
#[cfg(any(all(stage0, target_word_size = "32"), all(not(stage0), target_pointer_width = "32")))]
|
||||
fn main() {
|
||||
let n = 0u;
|
||||
let a = box [&n; 0xFFFFFFFFu];
|
||||
|
|
|
|||
|
|
@ -10,12 +10,12 @@
|
|||
|
||||
use std::mem::size_of;
|
||||
|
||||
#[cfg(target_word_size = "32")]
|
||||
#[cfg(any(all(stage0, target_word_size = "32"), all(not(stage0), target_pointer_width = "32")))]
|
||||
pub fn main() {
|
||||
assert_eq!(size_of::<[u8; (1 << 31) - 1]>(), (1 << 31) - 1);
|
||||
}
|
||||
|
||||
#[cfg(target_word_size = "64")]
|
||||
#[cfg(any(all(stage0, target_word_size = "64"), all(not(stage0), target_pointer_width = "64")))]
|
||||
pub fn main() {
|
||||
assert_eq!(size_of::<[u8; (1 << 47) - 1]>(), (1 << 47) - 1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ pub fn main() {
|
|||
|
||||
// FIXME #10183
|
||||
// FIXME #18069
|
||||
//if cfg!(target_word_size = "64") {
|
||||
//if cfg!(target_pointer_width = "64") {
|
||||
// assert_eq!(size_of::<[u8; (1 << 32)]>(), (1u << 32));
|
||||
//}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue