Skip to content

Commit c9575a6

Browse files
committed
Add std::mem::transmute_copy slice test
1 parent f832add commit c9575a6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

library/core/tests/mem.rs

+5
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@ fn test_transmute_copy_shrink() {
121121
assert_eq!(0_u8, unsafe { transmute_copy(&0_u64) });
122122
}
123123

124+
#[test]
125+
fn test_transmute_copy_slice() {
126+
assert_eq!(1, unsafe { transmute_copy(&[1][..]) });
127+
}
128+
124129
#[test]
125130
fn test_transmute_copy_unaligned() {
126131
#[repr(C)]

0 commit comments

Comments
 (0)