mirror of
https://github.com/rust-lang/rust
synced 2024-10-14 20:46:49 +00:00
Add a test for never type fallback edition change
This commit is contained in:
parent
31a88794a0
commit
3b3e504235
1
tests/ui/editions/never-type-fallback.e2021.run.stdout
Normal file
1
tests/ui/editions/never-type-fallback.e2021.run.stdout
Normal file
|
@ -0,0 +1 @@
|
|||
return type = ()
|
1
tests/ui/editions/never-type-fallback.e2024.run.stdout
Normal file
1
tests/ui/editions/never-type-fallback.e2024.run.stdout
Normal file
|
@ -0,0 +1 @@
|
|||
return type = !
|
16
tests/ui/editions/never-type-fallback.rs
Normal file
16
tests/ui/editions/never-type-fallback.rs
Normal 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>());
|
||||
}
|
Loading…
Reference in a new issue