1
Fork 0

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 // run-pass
#![feature(generators)] #![feature(generators)]
#![feature(destructuring_assignment)]
#![feature(unboxed_closures, fn_traits)]
#![allow(non_camel_case_types)] #![allow(non_camel_case_types)]
#![allow(dead_code)] #![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() { fn bathroom_stall() {
let mut i = 1; let mut i = 1;
matches!(2, _|_|_|_|_|_ if (i+=1) != (i+=1)); matches!(2, _|_|_|_|_|_ if (i+=1) != (i+=1));
@ -198,5 +211,6 @@ pub fn main() {
match_nested_if(); match_nested_if();
monkey_barrel(); monkey_barrel();
unicode(); unicode();
function();
bathroom_stall(); bathroom_stall();
} }