summaryrefslogtreecommitdiffstats
path: root/src/test/ui/issues/issue-40085.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/issues/issue-40085.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-40085.rs b/src/test/ui/issues/issue-40085.rs
new file mode 100644
index 000000000..132044cfd
--- /dev/null
+++ b/src/test/ui/issues/issue-40085.rs
@@ -0,0 +1,13 @@
+// run-pass
+use std::ops::Index;
+fn bar() {}
+static UNIT: () = ();
+struct S;
+impl Index<fn()> for S {
+ type Output = ();
+ fn index(&self, _: fn()) -> &() { &UNIT }
+}
+fn main() {
+ S.index(bar);
+ S[bar];
+}