diff options
Diffstat (limited to 'tests/ui/pattern/usefulness/issue-30240-rpass.rs')
-rw-r--r-- | tests/ui/pattern/usefulness/issue-30240-rpass.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/pattern/usefulness/issue-30240-rpass.rs b/tests/ui/pattern/usefulness/issue-30240-rpass.rs new file mode 100644 index 000000000..ab16614fd --- /dev/null +++ b/tests/ui/pattern/usefulness/issue-30240-rpass.rs @@ -0,0 +1,14 @@ +// run-pass +fn main() { + let &ref a = &[0i32] as &[_]; + assert_eq!(a, &[0i32] as &[_]); + + let &ref a = "hello"; + assert_eq!(a, "hello"); + + match "foo" { + "fool" => unreachable!(), + "foo" => {}, + ref _x => unreachable!() + } +} |