Skip to content

Commit 2307e47

Browse files
Add a test for the type_name intrinsic.
1 parent e1a0f66 commit 2307e47

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/run-pass/intrinsics.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#![feature(core_intrinsics)]
2+
3+
use std::intrinsics::type_name;
14
use std::mem::{size_of, size_of_val};
25

36
fn main() {
@@ -7,4 +10,6 @@ fn main() {
710
assert_eq!(size_of_val(&[] as &[i32]), 0);
811
assert_eq!(size_of_val(&[1, 2, 3] as &[i32]), 12);
912
assert_eq!(size_of_val("foobar"), 6);
13+
14+
assert_eq!(unsafe { type_name::<Option<i32>>() }, "core::option::Option<i32>");
1015
}

0 commit comments

Comments
 (0)