diff options
| author | Jaro Fietz <jaro.fietz@gmx.de> | 2021-06-29 20:28:44 +0200 |
|---|---|---|
| committer | oberien <jaro.fietz@gmx.de> | 2022-05-21 00:19:53 +0200 |
| commit | d85ba01ecb41873f47c2e6acb8cc397a6ae5f1bd (patch) | |
| tree | b97775ed2e25204f22f2ce68c4a57b4752acc67f /src/test | |
| parent | df0b0d4ae381a863d84c1f1debc83c6adab65763 (diff) | |
| download | rust-d85ba01ecb41873f47c2e6acb8cc397a6ae5f1bd.tar.gz rust-d85ba01ecb41873f47c2e6acb8cc397a6ae5f1bd.zip | |
Add a function returning itself to weird-exprs
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/weird-exprs.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/ui/weird-exprs.rs b/src/test/ui/weird-exprs.rs index fb8b32e2803..c7ee9c7334a 100644 --- a/src/test/ui/weird-exprs.rs +++ b/src/test/ui/weird-exprs.rs @@ -1,6 +1,8 @@ // run-pass #![feature(generators)] +#![feature(destructuring_assignment)] +#![feature(unboxed_closures, fn_traits)] #![allow(non_camel_case_types)] #![allow(dead_code)] @@ -172,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 () ()() ()()() ()()()() ()()()()(); +} + fn bathroom_stall() { let mut i = 1; matches!(2, _|_|_|_|_|_ if (i+=1) != (i+=1)); @@ -198,5 +211,6 @@ pub fn main() { match_nested_if(); monkey_barrel(); unicode(); + function(); bathroom_stall(); } |
