]> git.lizzy.rs Git - rust.git/blob - src/test/ui/never_type/never-associated-type.rs
Auto merge of #65838 - estebank:resilient-recovery, r=Centril
[rust.git] / src / test / ui / never_type / never-associated-type.rs
1 // Test that we can use ! as an associated type.
2
3 // check-pass
4
5 #![feature(never_type)]
6
7 trait Foo {
8     type Wow;
9
10     fn smeg(&self) -> Self::Wow;
11 }
12
13 struct Blah;
14 impl Foo for Blah {
15     type Wow = !;
16     fn smeg(&self) -> ! {
17         panic!("kapow!");
18     }
19 }
20
21 fn main() {
22     Blah.smeg();
23 }