summaryrefslogtreecommitdiffstats
path: root/tests/ui/generic-associated-types/issue-74684-2.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/generic-associated-types/issue-74684-2.rs')
-rw-r--r--tests/ui/generic-associated-types/issue-74684-2.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/ui/generic-associated-types/issue-74684-2.rs b/tests/ui/generic-associated-types/issue-74684-2.rs
new file mode 100644
index 000000000..ff243af2c
--- /dev/null
+++ b/tests/ui/generic-associated-types/issue-74684-2.rs
@@ -0,0 +1,23 @@
+trait Fun {
+ type F<'a>: ?Sized;
+
+ fn identity<'a>(t: &'a Self::F<'a>) -> &'a Self::F<'a> { t }
+}
+
+impl <T> Fun for T {
+ type F<'a> = i32;
+}
+
+fn bug<'a, T: ?Sized + Fun<F<'a> = [u8]>>(t: Box<T>) -> &'static T::F<'a> {
+ let a = [0; 1];
+ let x = T::identity(&a);
+ todo!()
+}
+
+
+fn main() {
+ let x = 10;
+
+ bug(Box::new(x));
+ //~^ ERROR: type mismatch resolving `<{integer} as Fun>::F<'_> == [u8]`
+}