File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
56use std:: any:: TypeId ;
67
78trait Trait { }
8- impl Trait for [ u8 ; 1 << 63 ] { }
9+ impl Trait for [ u8 ; usize :: MAX ] { }
910
1011fn main ( ) { }
1112
1213const _: ( ) = 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} ;
1617const _: ( ) = 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} ;
Original file line number Diff line number Diff line change 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 |
77note: inside `TypeId::trait_info_of_trait_type_id`
88 --> $SRC_DIR/core/src/any.rs:LL:COL
99note: 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 |
1818note: inside `TypeId::trait_info_of::<dyn Trait>`
1919 --> $SRC_DIR/core/src/any.rs:LL:COL
You can’t perform that action at this time.
0 commit comments