From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/never_type/never-type-arg.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/ui/never_type/never-type-arg.rs (limited to 'tests/ui/never_type/never-type-arg.rs') diff --git a/tests/ui/never_type/never-type-arg.rs b/tests/ui/never_type/never-type-arg.rs new file mode 100644 index 000000000..13cd59e6a --- /dev/null +++ b/tests/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!"); +} -- cgit v1.2.3