From d030905c339ed22146e19a8fc08df606cd13c31b Mon Sep 17 00:00:00 2001 From: Jaro Fietz Date: Tue, 29 Jun 2021 15:13:43 +0200 Subject: [PATCH 1/3] Make the most special expression even more special Add or-pattern syntax in argument position --- src/test/ui/weird-exprs.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/ui/weird-exprs.rs b/src/test/ui/weird-exprs.rs index 2d7ebbf1d5b04..747ec6e5ac03f 100644 --- a/src/test/ui/weird-exprs.rs +++ b/src/test/ui/weird-exprs.rs @@ -116,7 +116,7 @@ fn union() { } fn special_characters() { - let val = !((|(..):(_,_),__@_|__)((&*"\\",'🤔')/**/,{})=={&[..=..][..];})// + let val = !((|(..):(_,_),(|__@_|__)|__)((&*"\\",'#')/**/,{})=={&[..=..][..];})// ; assert!(!val); } From f7aea1c28ac4889999a266e3bf44ca22727ce448 Mon Sep 17 00:00:00 2001 From: Jaro Fietz Date: Tue, 29 Jun 2021 20:22:44 +0200 Subject: [PATCH 2/3] Add unicode identifier to weird-exprs Use unicode identifiers and a unicode emoji in weird-exprs.rs --- src/test/ui/weird-exprs.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/test/ui/weird-exprs.rs b/src/test/ui/weird-exprs.rs index 747ec6e5ac03f..ff1188668e13b 100644 --- a/src/test/ui/weird-exprs.rs +++ b/src/test/ui/weird-exprs.rs @@ -7,6 +7,7 @@ #![allow(dead_code)] #![allow(unreachable_code)] #![allow(unused_braces, unused_must_use, unused_parens)] +#![allow(uncommon_codepoints, confusable_idents)] #![recursion_limit = "256"] @@ -165,6 +166,13 @@ fn monkey_barrel() { assert_eq!(val, ()); } +fn unicode() { + fn 𝚋𝚛𝚎𝚊𝚔() -> char { '🤔' } + assert_eq!(loop { + break 𝚋𝚛𝚎𝚊𝚔 (); + }, '🤔'); +} + pub fn main() { strange(); funny(); @@ -184,4 +192,5 @@ pub fn main() { i_yield(); match_nested_if(); monkey_barrel(); + unicode(); } From f1aea95e46180dfc3a52dfc482e617a779299078 Mon Sep 17 00:00:00 2001 From: Jaro Fietz Date: Tue, 29 Jun 2021 20:28:44 +0200 Subject: [PATCH 3/3] Add a function returning itself to weird-exprs --- src/test/ui/weird-exprs.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/test/ui/weird-exprs.rs b/src/test/ui/weird-exprs.rs index ff1188668e13b..0fd8ba314daef 100644 --- a/src/test/ui/weird-exprs.rs +++ b/src/test/ui/weird-exprs.rs @@ -2,6 +2,7 @@ #![feature(generators)] #![feature(destructuring_assignment)] +#![feature(unboxed_closures, fn_traits)] #![allow(non_camel_case_types)] #![allow(dead_code)] @@ -173,6 +174,17 @@ fn unicode() { }, '🤔'); } +fn function() { + struct foo; + impl FnOnce<()> for foo { + type Output = foo; + extern "rust-call" fn call_once(self, _args: ()) -> Self::Output { + foo + } + } + let foo = foo () ()() ()()() ()()()() ()()()()(); +} + pub fn main() { strange(); funny(); @@ -193,4 +205,5 @@ pub fn main() { match_nested_if(); monkey_barrel(); unicode(); + function(); }