Skip to content

Commit 1c9248b

Browse files
author
Jasper Wolny
committed
fix 32 bit
1 parent 0d9f1bc commit 1c9248b

2 files changed

Lines changed: 14 additions & 13 deletions

File tree

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1+
//@ normalize-stderr: "\[u8; [0-9]+\]" -> "[u8; N]"
12
//! Test for https://github.com/rust-lang/rust/pull/152003
23
34
#![feature(type_info)]
45

56
use std::any::TypeId;
67

78
trait Trait {}
8-
impl Trait for [u8; 1 << 63] {}
9+
impl Trait for [u8; usize::MAX] {}
910

1011
fn main() {}
1112

1213
const _: () = const {
13-
TypeId::of::<[u8; 1 << 63]>().trait_info_of_trait_type_id(TypeId::of::<dyn Trait>());
14-
//~^ ERROR values of the type `[u8; 9223372036854775808]` are too big for the target architecture [E0080]
14+
TypeId::of::<[u8; usize::MAX]>().trait_info_of_trait_type_id(TypeId::of::<dyn Trait>());
15+
//~^ ERROR values of the type `[u8; usize::MAX]` are too big for the target architecture
1516
};
1617
const _: () = const {
17-
TypeId::of::<[u8; 1 << 63]>().trait_info_of::<dyn Trait>();
18-
//~^ ERROR values of the type `[u8; 9223372036854775808]` are too big for the target architecture [E0080]
18+
TypeId::of::<[u8; usize::MAX]>().trait_info_of::<dyn Trait>();
19+
//~^ ERROR values of the type `[u8; usize::MAX]` are too big for the target architecture
1920
};

tests/ui/reflection/trait_info_of_too_big.stderr

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
error[E0080]: values of the type `[u8; 9223372036854775808]` are too big for the target architecture
2-
--> $DIR/trait_info_of_too_big.rs:13:5
1+
error[E0080]: values of the type `[u8; usize::MAX]` are too big for the target architecture
2+
--> $DIR/trait_info_of_too_big.rs:14:5
33
|
4-
LL | TypeId::of::<[u8; 1 << 63]>().trait_info_of_trait_type_id(TypeId::of::<dyn Trait>());
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `_::{constant#0}` failed inside this call
4+
LL | TypeId::of::<[u8; usize::MAX]>().trait_info_of_trait_type_id(TypeId::of::<dyn Trait>());
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `_::{constant#0}` failed inside this call
66
|
77
note: inside `TypeId::trait_info_of_trait_type_id`
88
--> $SRC_DIR/core/src/any.rs:LL:COL
99
note: inside `type_info::<impl TypeId>::info`
1010
--> $SRC_DIR/core/src/mem/type_info.rs:LL:COL
1111

12-
error[E0080]: values of the type `[u8; 9223372036854775808]` are too big for the target architecture
13-
--> $DIR/trait_info_of_too_big.rs:17:5
12+
error[E0080]: values of the type `[u8; usize::MAX]` are too big for the target architecture
13+
--> $DIR/trait_info_of_too_big.rs:18:5
1414
|
15-
LL | TypeId::of::<[u8; 1 << 63]>().trait_info_of::<dyn Trait>();
16-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `_::{constant#0}` failed inside this call
15+
LL | TypeId::of::<[u8; usize::MAX]>().trait_info_of::<dyn Trait>();
16+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `_::{constant#0}` failed inside this call
1717
|
1818
note: inside `TypeId::trait_info_of::<dyn Trait>`
1919
--> $SRC_DIR/core/src/any.rs:LL:COL

0 commit comments

Comments
 (0)