Skip to content

Commit 3b3e504

Browse files
committed
Add a test for never type fallback edition change
1 parent 31a8879 commit 3b3e504

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
return type = ()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
return type = !
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//@ revisions: e2021 e2024
2+
//
3+
//@[e2021] edition: 2021
4+
//@[e2024] edition: 2024
5+
//@[e2024] compile-flags: -Zunstable-options
6+
//
7+
//@ run-pass
8+
//@ check-run-results
9+
10+
fn main() {
11+
print_return_type_of(|| panic!());
12+
}
13+
14+
fn print_return_type_of<R>(_: impl FnOnce() -> R) {
15+
println!("return type = {}", std::any::type_name::<R>());
16+
}

0 commit comments

Comments
 (0)