From 659aa778d3305b2f20d4e0d2bbead4071e7f02b7 Mon Sep 17 00:00:00 2001 From: Slanterns Date: Wed, 11 Nov 2020 23:40:11 +0800 Subject: [PATCH 1/2] test: add `()=()=()=...` to weird-exprs.rs --- src/test/ui/weird-exprs.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/test/ui/weird-exprs.rs b/src/test/ui/weird-exprs.rs index 916cabbfb8c94..9c69c834296e5 100644 --- a/src/test/ui/weird-exprs.rs +++ b/src/test/ui/weird-exprs.rs @@ -1,6 +1,7 @@ // run-pass #![feature(generators)] +#![feature(destructuring_assignment)] #![allow(non_camel_case_types)] #![allow(dead_code)] @@ -159,6 +160,11 @@ fn match_nested_if() { assert!(val); } +fn empty_tuple_assignment() { + let val = ()=()=()=()=()=()=()=()=()=()=()=()=()=()=()=()=()=()=()=()=()=()=()=()=(); + assert_eq!(val, ()); +} + pub fn main() { strange(); funny(); @@ -177,4 +183,5 @@ pub fn main() { r#match(); i_yield(); match_nested_if(); + empty_tuple_assignment(); } From 38fa66aac3cb1790bde8f76014db6ccd62f70244 Mon Sep 17 00:00:00 2001 From: Slanterns Date: Thu, 12 Nov 2020 10:38:03 +0800 Subject: [PATCH 2/2] Rename empty_tuple_assignment to monkey_barrel --- src/test/ui/weird-exprs.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/ui/weird-exprs.rs b/src/test/ui/weird-exprs.rs index 9c69c834296e5..2d7ebbf1d5b04 100644 --- a/src/test/ui/weird-exprs.rs +++ b/src/test/ui/weird-exprs.rs @@ -160,7 +160,7 @@ fn match_nested_if() { assert!(val); } -fn empty_tuple_assignment() { +fn monkey_barrel() { let val = ()=()=()=()=()=()=()=()=()=()=()=()=()=()=()=()=()=()=()=()=()=()=()=()=(); assert_eq!(val, ()); } @@ -183,5 +183,5 @@ pub fn main() { r#match(); i_yield(); match_nested_if(); - empty_tuple_assignment(); + monkey_barrel(); }