]> git.lizzy.rs Git - rust.git/blob - src/test/ui/structs-enums/empty-tag.rs
Auto merge of #106025 - matthiaskrgr:rollup-vz5rqah, r=matthiaskrgr
[rust.git] / src / test / ui / structs-enums / empty-tag.rs
1 // run-pass
2 #![allow(unused_braces)]
3 #![allow(non_camel_case_types)]
4
5 #[derive(Copy, Clone, Debug)]
6 enum chan { chan_t, }
7
8 impl PartialEq for chan {
9     fn eq(&self, other: &chan) -> bool {
10         ((*self) as usize) == ((*other) as usize)
11     }
12     fn ne(&self, other: &chan) -> bool { !(*self).eq(other) }
13 }
14
15 fn wrapper3(i: chan) {
16     assert_eq!(i, chan::chan_t);
17 }
18
19 pub fn main() {
20     let wrapped = {||wrapper3(chan::chan_t)};
21     wrapped();
22 }