aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/issue-1173.rs
blob: a8fd93eea1b125f7e48de8ee033abe7ff27f71fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// { dg-additional-options "-w" }

#![feature(intrinsics)]

#[lang = "sized"]
pub trait Sized {}

mod mem {
    extern "rust-intrinsic" {
        pub fn transmute<U, V>(_: U) -> V;
    }
}

pub trait Hasher {
    fn write(&mut self, bytes: &[u8]);
    fn write_u16(&mut self, i: u16) {
        self.write(unsafe { &mem::transmute::<_, [u8; 2]>(i) })
    }
}

pub struct SipHasher;

impl Hasher for SipHasher {
    #[inline]
    fn write(&mut self, msg: &[u8]) {}
}