-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug with new operators traits #20592
Comments
Probably a duplicate of #20553 / #20347 From the error message, it looks like you need to add the associated impl <T: Add<T> + Copy> Add for DenseMatrix<T> {
type Output = DenseMatrix<T>; // <-- Add this
fn add(self, rhs: DenseMatrix<T>) -> DenseMatrix<T> {
self.__add(rhs)
}
} |
Why do we need to define such a type now ? It does not seem usefull from a user point of view. Is it to help the compiler in some sort? Plus: what is this syntax ? |
It is to help you. It defines what the result of the operation is, e.g. one might implement
It is how one writes the path to one of these associated types. https://github.com/rust-lang/rfcs/blob/master/text/0195-associated-items.md contains (a lot) more details. Closing as a dupe of #20347; thanks for filing! |
Thx. |
The text was updated successfully, but these errors were encountered: