Skip to content

Commit 10f43dd

Browse files
Add a test demonstrating that RFC's note on diverging returns is subsumed by just inferring unit as ret type
1 parent bb33200 commit 10f43dd

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// compile-flags: --edition 2024 -Zunstable-options
2+
// check-pass
3+
4+
#![feature(gen_blocks)]
5+
6+
async gen fn async_gen_fn() -> i32 { return }
7+
8+
gen fn gen_fn() -> i32 { return }
9+
10+
fn async_gen_block() {
11+
async gen { yield (); return };
12+
}
13+
14+
fn gen_block() {
15+
gen { yield (); return };
16+
}
17+
18+
fn main() {}

0 commit comments

Comments
 (0)