summaryrefslogtreecommitdiffstats
path: root/tests/ui/associated-inherent-types/issue-111879-1.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/associated-inherent-types/issue-111879-1.rs')
-rw-r--r--tests/ui/associated-inherent-types/issue-111879-1.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/associated-inherent-types/issue-111879-1.rs b/tests/ui/associated-inherent-types/issue-111879-1.rs
new file mode 100644
index 000000000..7acc4f945
--- /dev/null
+++ b/tests/ui/associated-inherent-types/issue-111879-1.rs
@@ -0,0 +1,12 @@
+#![feature(inherent_associated_types)]
+#![allow(incomplete_features)]
+
+// Check that we don't crash when printing inherent projections in diagnostics.
+
+struct Foo<T>(T);
+
+impl<'a> Foo<fn(&'a ())> {
+ type Assoc = &'a ();
+}
+
+fn main(_: for<'a> fn(Foo<fn(&'a ())>::Assoc)) {} //~ ERROR `main` function has wrong type