Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/tests/coercion.rs')
-rw-r--r--crates/hir-ty/src/tests/coercion.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/crates/hir-ty/src/tests/coercion.rs b/crates/hir-ty/src/tests/coercion.rs
index db06d55278..6d4ad93070 100644
--- a/crates/hir-ty/src/tests/coercion.rs
+++ b/crates/hir-ty/src/tests/coercion.rs
@@ -88,6 +88,24 @@ fn test(a: A<[u8; 2]>, b: B<[u8; 2]>, c: C<[u8; 2]>) {
}
#[test]
+fn coerce_pointee_derive() {
+ check_no_mismatches(
+ r#"
+//- minicore: coerce_pointee
+use core::marker::CoercePointee;
+
+#[derive(CoercePointee)]
+#[repr(transparent)]
+struct Pointer<T: ?Sized>(*const T);
+
+fn coerce(value: Pointer<[u8; 1]>) -> Pointer<[u8]> {
+ value
+}
+"#,
+ );
+}
+
+#[test]
fn unsized_from_keeps_type_info() {
check_types(
r#"