1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
// check-pass #![feature(const_fn_trait_bound)] struct S; impl PartialEq for S { fn eq(&self, _: &S) -> bool { true } } const fn equals_self<T: PartialEq>(t: &T) -> bool { true } pub const EQ: bool = equals_self(&S); fn main() {}