Skip to content

Commit 4f94ec6

Browse files
committed
add type_name test
1 parent 247aa5e commit 4f94ec6

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

src/compile_test.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,7 @@ run_test! {intrinsics,size_of_val,stable}
718718
run_test! {intrinsics,transmute,stable}
719719
run_test! {intrinsics,trigonometry,stable}
720720
run_test! {intrinsics,type_id,stable}
721+
run_test! {intrinsics,type_name,stable}
721722
run_test! {intrinsics,wrapping_ops,stable}
722723
run_test! {iter,fold,stable}
723724
run_test! {statics,thread_local,stable}

test/intrinsics/type_name.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#![feature(
2+
lang_items,
3+
adt_const_params,
4+
associated_type_defaults,
5+
core_intrinsics,
6+
start,
7+
unsized_const_params
8+
)]
9+
#![allow(
10+
internal_features,
11+
incomplete_features,
12+
unused_variables,
13+
dead_code,
14+
unused_imports
15+
)]
16+
#![no_std]
17+
18+
use core::intrinsics::type_name;
19+
20+
include!("../common.rs");
21+
22+
fn main() {
23+
test_eq!(
24+
type_name::<Option<u32>>(),
25+
black_box("core::option::Option<core::primitive::u32>")
26+
);
27+
}

0 commit comments

Comments
 (0)