]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfc-2632-const-trait-impl/call-generic-method-dup-bound.rs
Auto merge of #84589 - In-line:zircon-thread-name, r=JohnTitor
[rust.git] / src / test / ui / rfc-2632-const-trait-impl / call-generic-method-dup-bound.rs
1 // check-pass
2
3 #![feature(const_trait_impl)]
4 #![feature(const_trait_bound_opt_out)]
5 #![feature(const_fn_trait_bound)]
6 #![allow(incomplete_features)]
7
8 struct S;
9
10 impl const PartialEq for S {
11     fn eq(&self, _: &S) -> bool {
12         true
13     }
14     fn ne(&self, other: &S) -> bool {
15         !self.eq(other)
16     }
17 }
18
19 // This duplicate bound should not result in ambiguities. It should be equivalent to a single const
20 // bound.
21 const fn equals_self<T: PartialEq + ?const PartialEq>(t: &T) -> bool {
22     *t == *t
23 }
24
25 pub const EQ: bool = equals_self(&S);
26
27 fn main() {}