use std::ops::Index;
fn bar() {}
static UNIT: () = ();
struct S;
impl Index<fn()> for S {
type Output = ();
fn index(&self, f: fn()) -> &() { f(); &UNIT }
}
fn main() {
*S.index(bar);
// S[bar];
// ^^^^^^ expected fn pointer, found fn item
}
but the error above indicates that this isn't true.