Add a function returning itself to weird-exprs

This commit is contained in:
Jaro Fietz 2021-06-29 20:28:44 +02:00 committed by oberien
parent df0b0d4ae3
commit d85ba01ecb

View File

@ -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();
}