]> git.lizzy.rs Git - rust.git/blob - src/test/ui/never_type/never-associated-type.rs
Merge commit '1411a98352ba6bee8ba3b0131c9243e5db1e6a2e' into sync_cg_clif-2021-12-31
[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 }