Skip to content

Commit 6331c92

Browse files
committed
Adapt for 32bit.
1 parent fa58414 commit 6331c92

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
error[E0080]: values of the type `[&usize; usize::MAX]` are too big for the target architecture
2+
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
3+
|
4+
= note: evaluation of `<[&usize; usize::MAX] as std::mem::SizedTypeProperties>::SIZE` failed here
5+
6+
error[E0080]: values of the type `[&usize; usize::MAX]` are too big for the target architecture
7+
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
8+
|
9+
= note: evaluation of `<[&usize; usize::MAX] as std::mem::SizedTypeProperties>::ALIGN` failed here
10+
11+
note: the above error was encountered while instantiating `fn Box::<[&usize; usize::MAX]>::new`
12+
--> $DIR/issue-17913.rs:16:21
13+
|
14+
LL | let a: Box<_> = Box::new([&n; SIZE]);
15+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
16+
17+
error: aborting due to 2 previous errors
18+
19+
For more information about this error, try `rustc --explain E0080`.

tests/ui/limits/issue-17913.stderr renamed to tests/ui/limits/issue-17913.64bit.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ error[E0080]: values of the type `[&usize; usize::MAX]` are too big for the targ
99
= note: evaluation of `<[&usize; usize::MAX] as std::mem::SizedTypeProperties>::ALIGN` failed here
1010

1111
note: the above error was encountered while instantiating `fn Box::<[&usize; usize::MAX]>::new`
12-
--> $DIR/issue-17913.rs:7:21
12+
--> $DIR/issue-17913.rs:9:21
1313
|
14-
LL | let a: Box<_> = Box::new([&n; 0xF000000000000000_usize]);
14+
LL | let a: Box<_> = Box::new([&n; SIZE]);
1515
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1616

1717
error: aborting due to 2 previous errors

tests/ui/limits/issue-17913.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
//@ build-fail
2+
//@ stderr-per-bitwidth
23
//@ normalize-stderr: "\[&usize; \d+\]" -> "[&usize; usize::MAX]"
4+
//@ normalize-stderr: "\[&n; 0x[0-9A-F]+_usize\]" -> "[&n; SIZE]"
35

46
#[cfg(target_pointer_width = "64")]
57
fn main() {

0 commit comments

Comments
 (0)