You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
struct S {
x : uint,
func : fn(uint)
}
impl S {
fn no_func(val : uint) { println!("{}", val); }
fn new() -> S {
S { x : 0, func : S::no_func }
}
}
fn main() {
let s : S = S::new();
s.func(7);
}
And I got the error: error: typeSdoes not implement any method in scope named "func"
It seems to try to look for a member function and ignore the member variable. One person(alexchandel) in the rust irc channel said this was a bug and should work, another(p1start) said the error message should be improved.