diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/never_type/never-type-arg.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/ui/never_type/never-type-arg.rs b/src/test/ui/never_type/never-type-arg.rs new file mode 100644 index 000000000..13cd59e6a --- /dev/null +++ b/src/test/ui/never_type/never-type-arg.rs @@ -0,0 +1,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!"); +} |