For the benefit of any future searchers, I also got this error when I tried to pass an owned parameter instead of a reference: mat1.dot(mat2) instead of mat1.dot(&mat2).
mat1.dot(mat2)
mat1.dot(&mat2)