]> git.lizzy.rs Git - rust.git/blob - tests/ui/coherence/coherence-impl-in-fn.rs
Auto merge of #107843 - bjorn3:sync_cg_clif-2023-02-09, r=bjorn3
[rust.git] / tests / ui / coherence / coherence-impl-in-fn.rs
1 // run-pass
2 #![allow(dead_code)]
3 #![allow(non_camel_case_types)]
4
5 pub fn main() {
6     #[derive(Copy, Clone)]
7     enum x { foo }
8     impl ::std::cmp::PartialEq for x {
9         fn eq(&self, other: &x) -> bool {
10             (*self) as isize == (*other) as isize
11         }
12         fn ne(&self, other: &x) -> bool { !(*self).eq(other) }
13     }
14 }