]> git.lizzy.rs Git - rust.git/blob - tests/ui/async-await/return-ty-raw-ptr-coercion.rs
Rollup merge of #107076 - megakorre:106419_add_test_case, r=compiler-errors
[rust.git] / tests / ui / async-await / return-ty-raw-ptr-coercion.rs
1 // Check that we apply unsizing coercions based on the return type.
2 //
3 // Also serves as a regression test for #60424.
4 //
5 // edition:2018
6 // check-pass
7
8 #![allow(warnings)]
9
10 use std::fmt::Debug;
11
12 const TMP: u32 = 22;
13
14 // Coerce from `&u32` to `*const u32`
15 fn raw_pointer_coercion() {
16     fn sync_example() -> *const u32 {
17         &TMP
18     }
19
20     async fn async_example() -> *const u32 {
21         &TMP
22     }
23 }
24
25 fn main() {}