diff --git a/tests/pass/provenance.rs b/tests/pass/provenance.rs index b18d903e36..c411f748a0 100644 --- a/tests/pass/provenance.rs +++ b/tests/pass/provenance.rs @@ -10,6 +10,7 @@ fn main() { bytewise_ptr_methods(); bytewise_custom_memcpy(); bytewise_custom_memcpy_chunked(); + int_load_strip_provenance(); } /// Some basic smoke tests for provenance. @@ -137,3 +138,9 @@ fn bytewise_custom_memcpy_chunked() { assert_eq!(*ptr, 42); } } + +fn int_load_strip_provenance() { + let ptrs = [&42]; + let ints: [usize; 1] = unsafe { mem::transmute(ptrs) }; + assert_eq!(ptrs[0] as *const _ as usize, ints[0]); +}