Add a test for never type fallback edition change

This commit is contained in:
Maybe Waffle 2024-04-05 17:58:40 +00:00 committed by Waffle Lapkin
parent 31a88794a0
commit 3b3e504235
3 changed files with 18 additions and 0 deletions

View file

@ -0,0 +1 @@
return type = ()

View file

@ -0,0 +1 @@
return type = !

View file

@ -0,0 +1,16 @@
//@ revisions: e2021 e2024
//
//@[e2021] edition: 2021
//@[e2024] edition: 2024
//@[e2024] compile-flags: -Zunstable-options
//
//@ run-pass
//@ check-run-results
fn main() {
print_return_type_of(|| panic!());
}
fn print_return_type_of<R>(_: impl FnOnce() -> R) {
println!("return type = {}", std::any::type_name::<R>());
}