summaryrefslogtreecommitdiffstats
path: root/src/test/ui/async-await/return-ty-raw-ptr-coercion.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/async-await/return-ty-raw-ptr-coercion.rs')
-rw-r--r--src/test/ui/async-await/return-ty-raw-ptr-coercion.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/test/ui/async-await/return-ty-raw-ptr-coercion.rs b/src/test/ui/async-await/return-ty-raw-ptr-coercion.rs
new file mode 100644
index 000000000..9fe0869ca
--- /dev/null
+++ b/src/test/ui/async-await/return-ty-raw-ptr-coercion.rs
@@ -0,0 +1,25 @@
+// Check that we apply unsizing coercions based on the return type.
+//
+// Also serves as a regression test for #60424.
+//
+// edition:2018
+// check-pass
+
+#![allow(warnings)]
+
+use std::fmt::Debug;
+
+const TMP: u32 = 22;
+
+// Coerce from `&u32` to `*const u32`
+fn raw_pointer_coercion() {
+ fn sync_example() -> *const u32 {
+ &TMP
+ }
+
+ async fn async_example() -> *const u32 {
+ &TMP
+ }
+}
+
+fn main() {}