aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/issue-1129-2.rs
blob: cfe01b5b4db57ce73b1f148931421e65aab76481 (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
// { dg-additional-options "-w" }
#[lang = "sized"]
pub trait Sized {}

pub trait Hasher {
    fn finish(&self) -> u64;
    fn write(&mut self, bytes: &[u8]);
    fn write_u8(&mut self, i: u8) {
        self.write(&[i])
    }
}

struct SipHasher;

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

    #[inline]
    fn finish(&self) -> u64 {
        0
    }
}