Skip to content

Commit d85ba01

Browse files
committed
Add a function returning itself to weird-exprs
1 parent df0b0d4 commit d85ba01

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/test/ui/weird-exprs.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// run-pass
22

33
#![feature(generators)]
4+
#![feature(destructuring_assignment)]
5+
#![feature(unboxed_closures, fn_traits)]
46

57
#![allow(non_camel_case_types)]
68
#![allow(dead_code)]
@@ -172,6 +174,17 @@ fn unicode() {
172174
}, '🤔');
173175
}
174176

177+
fn function() {
178+
struct foo;
179+
impl FnOnce<()> for foo {
180+
type Output = foo;
181+
extern "rust-call" fn call_once(self, _args: ()) -> Self::Output {
182+
foo
183+
}
184+
}
185+
let foo = foo () ()() ()()() ()()()() ()()()()();
186+
}
187+
175188
fn bathroom_stall() {
176189
let mut i = 1;
177190
matches!(2, _|_|_|_|_|_ if (i+=1) != (i+=1));
@@ -198,5 +211,6 @@ pub fn main() {
198211
match_nested_if();
199212
monkey_barrel();
200213
unicode();
214+
function();
201215
bathroom_stall();
202216
}

0 commit comments

Comments
 (0)