gcc/testsuite/rust/compile/issue-1173.rs
raw| 1 | // { dg-additional-options "-w" } |
| 2 | |
| 3 | #![feature(intrinsics)] |
| 4 | |
| 5 | #[lang = "sized"] |
| 6 | pub trait Sized {} |
| 7 | |
| 8 | mod mem { |
| 9 | extern "rust-intrinsic" { |
| 10 | pub fn transmute<U, V>(_: U) -> V; |
| 11 | } |
| 12 | } |
| 13 | |
| 14 | pub trait Hasher { |
| 15 | fn write(&mut self, bytes: &[u8]); |
| 16 | fn write_u16(&mut self, i: u16) { |
| 17 | self.write(unsafe { &mem::transmute::<_, [u8; 2]>(i) }) |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | pub struct SipHasher; |
| 22 | |
| 23 | impl Hasher for SipHasher { |
| 24 | #[inline] |
| 25 | fn write(&mut self, msg: &[u8]) {} |
| 26 | } |