2017-11-15 00:57:09 +00:00
|
|
|
// NOTE commented out due to issue #45994
|
|
|
|
//pub fn fourway_add(a: i32) -> impl Fn(i32) -> impl Fn(i32) -> impl Fn(i32) -> i32 {
|
|
|
|
// move |b| move |c| move |d| a + b + c + d
|
|
|
|
//}
|
2017-08-14 10:04:52 +00:00
|
|
|
|
|
|
|
fn some_internal_fn() -> u32 {
|
|
|
|
1
|
|
|
|
}
|
|
|
|
|
2018-07-13 18:43:08 +00:00
|
|
|
fn other_internal_fn() -> u32 {
|
|
|
|
1
|
|
|
|
}
|
|
|
|
|
2017-08-14 10:04:52 +00:00
|
|
|
// See #40839
|
|
|
|
pub fn return_closure_accessing_internal_fn() -> impl Fn() -> u32 {
|
|
|
|
|| {
|
|
|
|
some_internal_fn() + 1
|
|
|
|
}
|
|
|
|
}
|
2018-05-22 12:31:56 +00:00
|
|
|
|
|
|
|
pub fn return_internal_fn() -> impl Fn() -> u32 {
|
2018-07-13 18:43:08 +00:00
|
|
|
other_internal_fn
|
2018-05-22 12:31:56 +00:00
|
|
|
}
|