about summary refs log tree commit diff
path: root/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-pass.rs
blob: e968e6ec7bb80ef33114e1845fd68e46ef1509ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//! Basic test for calling methods on generic type parameters in `const fn`.

// check-pass

#![feature(const_fn)]
#![feature(const_trait_impl)]
#![allow(incomplete_features)]

struct S;

impl const PartialEq for S {
    fn eq(&self, _: &S) -> bool {
        true
    }
}

const fn equals_self<T: PartialEq>(t: &T) -> bool {
    *t == *t
}

pub const EQ: bool = equals_self(&S);

fn main() {}