summaryrefslogtreecommitdiffstats
path: root/tests/ui/never_type/never-type-arg.rs
blob: 13cd59e6aa9f138e6982af760e32cfe9ecf51eb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Test that we can use ! as an argument to a trait impl.

// check-pass

#![feature(never_type)]

struct Wub;

impl PartialEq<!> for Wub {
    fn eq(&self, other: &!) -> bool {
        *other
    }
}

fn main() {
    let _ = Wub == panic!("oh no!");
}