summaryrefslogtreecommitdiffstats
path: root/src/test/ui/unsized/issue-75899-but-gats.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/unsized/issue-75899-but-gats.rs')
-rw-r--r--src/test/ui/unsized/issue-75899-but-gats.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/test/ui/unsized/issue-75899-but-gats.rs b/src/test/ui/unsized/issue-75899-but-gats.rs
new file mode 100644
index 000000000..5716817f4
--- /dev/null
+++ b/src/test/ui/unsized/issue-75899-but-gats.rs
@@ -0,0 +1,21 @@
+// check-pass
+
+use std::fmt::Debug;
+use std::marker::PhantomData;
+
+trait Foo {
+ type Gat<'a>: ?Sized where Self: 'a;
+}
+
+struct Bar<'a, T: Foo + 'a>(T::Gat<'a>);
+
+struct Baz<T: ?Sized>(PhantomData<T>);
+
+impl<T: ?Sized> Foo for Baz<T> {
+ type Gat<'a> = T where Self: 'a;
+}
+
+fn main() {
+ let x = Bar::<'_, Baz<()>>(());
+ let y: &Bar<'_, Baz<dyn Debug>> = &x;
+}