]> git.lizzy.rs Git - rust.git/blob - tests/ui/never_type/never-associated-type.rs
Rollup merge of #107615 - notriddle:notriddle/nbsp, r=GuillaumeGomez
[rust.git] / tests / 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 }