summaryrefslogtreecommitdiffstats
path: root/src/test/ui/issues/issue-40085.rs
blob: 132044cfd6dce3e36f2acc205a34bed00eaa0815 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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];
}