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
Hello. I am not quite sure, if this is a bug, or I misunderstood something, but to me it looks wrong that I get the following error:
~/work/rusty/traits/src/main.rs:7:36: 7:43 error: type `traits::Point` does not implement any method in scope named `sub`
~/work/rusty/traits/src/main.rs:7 println!("p1-p2= x:{}, y:{}", p1.sub(p2).x, p1.sub(p2).y);
^~~~~~~
~/work/rusty/traits/src/main.rs:7:50: 7:57 error: type `traits::Point` does not implement any method in scope named `sub`
~/work/rusty/traits/src/main.rs:7 println!("p1-p2= x:{}, y:{}", p1.sub(p2).x, p1.sub(p2).y);
Hello. I am not quite sure, if this is a bug, or I misunderstood something, but to me it looks wrong that I get the following error:
Within this code:
While this code (same, but without the module definition) compiles and works perfectly:
Is it a bug, or what am I doing wrong?
The text was updated successfully, but these errors were encountered: