1 // { dg-additional-options "-w" }
2 // { dg-output "t1sz=5 t2sz=10" }
4 extern "rust-intrinsic" {
5 #[rustc_const_stable(feature = "const_transmute", since = "1.46.0")]
6 fn transmute<T, U>(_: T) -> U;
11 fn printf(s: *const i8, ...);
26 pub const fn len(&self) -> usize {
27 unsafe { Repr { rust: self }.raw.len }
32 pub const fn len(&self) -> usize {
36 pub const fn as_bytes(&self) -> &[u8] {
37 unsafe { mem::transmute(self) }
42 let t1: &str = "TEST1";
43 let t2: &str = &"TEST_12345";
49 let a = "t1sz=%i t2sz=%i\n";
50 let b = a as *const str;
51 let c = b as *const i8;
53 printf(c, t1sz as i32, t2sz as i32);