aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/impl_fnptr.rs
blob: 20c9d88dc1ad8bda4332ff7afa95d258f714f288 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#[lang = "sized"]
pub trait Sized {}

#[lang = "eq"]
pub trait PartialEq<Rhs: ?Sized = Self> {
    fn eq(&self, other: &Rhs) -> bool;

    fn ne(&self, other: &Rhs) -> bool {
        !self.eq(other)
    }
}

impl<Ret> PartialEq for extern "C" fn() -> Ret {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        *self as usize == *other as usize
    }
}