]> git.proxmox.com Git - rustc.git/blame - src/test/run-pass/structs-enums/empty-tag.rs
New upstream version 1.37.0+dfsg1
[rustc.git] / src / test / run-pass / structs-enums / empty-tag.rs
CommitLineData
b7449926
XL
1// run-pass
2#![allow(non_camel_case_types)]
3
c34b1796 4#[derive(Copy, Clone, Debug)]
223e47cc
LB
5enum chan { chan_t, }
6
1a4d82fc 7impl PartialEq for chan {
223e47cc 8 fn eq(&self, other: &chan) -> bool {
c34b1796 9 ((*self) as usize) == ((*other) as usize)
223e47cc
LB
10 }
11 fn ne(&self, other: &chan) -> bool { !(*self).eq(other) }
12}
13
14fn wrapper3(i: chan) {
1a4d82fc 15 assert_eq!(i, chan::chan_t);
223e47cc
LB
16}
17
18pub fn main() {
85aaf69f 19 let wrapped = {||wrapper3(chan::chan_t)};
223e47cc
LB
20 wrapped();
21}