Skip to content
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

mismatched types in nalgebra 0.14.4 #345

Closed
Rafagd opened this issue May 26, 2018 · 4 comments
Closed

mismatched types in nalgebra 0.14.4 #345

Rafagd opened this issue May 26, 2018 · 4 comments

Comments

@Rafagd
Copy link

Rafagd commented May 26, 2018

I'm using ubuntu on windows (the one you install via M$'s App Store), but I don't think it should give different results than a normal linux build.

rafael@Artorias:~/Projetos/demos/demo01$ cargo build
   Compiling nalgebra v0.14.4
error[E0308]: mismatched types
   --> /home/rafael/.cargo/registry/src/github.com-1ecc6299db9ec823/nalgebra-0.14.4/src/geometry/point_ops.rs:81:5
    |
81  |     &self.coords - &right.coords; 'a, 'b);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `core::dimension::U1`, found associated type
    |
   ::: /home/rafael/.cargo/registry/src/github.com-1ecc6299db9ec823/nalgebra-0.14.4/src/geometry/op_macros.rs:160:41
    |
160 |             fn $op($lhs, $rhs: $Rhs) -> Self::Output {
    |                                         ------------ expected `core::matrix::Matrix<N, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfRows<D, D>>::Representative, core::dimension::U1, <core::default_allocator::DefaultAllocator as core::allocator::Allocator<N, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfRows<D, D>>::Representative, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfColumns<core::dimension::U1, core::dimension::U1>>::Representative>>::Buffer>` because of return type
    |
    = note: expected type `core::matrix::Matrix<_, _, core::dimension::U1, _>`
               found type `core::matrix::Matrix<_, _, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfColumns<core::dimension::U1, core::dimension::U1>>::Representative, _>`

error[E0308]: mismatched types
   --> /home/rafael/.cargo/registry/src/github.com-1ecc6299db9ec823/nalgebra-0.14.4/src/geometry/point_ops.rs:86:5
    |
86  |     &self.coords - right.coords; 'a);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `core::dimension::U1`, found associated type
    |
   ::: /home/rafael/.cargo/registry/src/github.com-1ecc6299db9ec823/nalgebra-0.14.4/src/geometry/op_macros.rs:160:41
    |
160 |             fn $op($lhs, $rhs: $Rhs) -> Self::Output {
    |                                         ------------ expected `core::matrix::Matrix<N, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfRows<D, D>>::Representative, core::dimension::U1, <core::default_allocator::DefaultAllocator as core::allocator::Allocator<N, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfRows<D, D>>::Representative, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfColumns<core::dimension::U1, core::dimension::U1>>::Representative>>::Buffer>` because of return type
    |
    = note: expected type `core::matrix::Matrix<_, _, core::dimension::U1, _>`
               found type `core::matrix::Matrix<_, _, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfColumns<core::dimension::U1, core::dimension::U1>>::Representative, _>`

error[E0308]: mismatched types
   --> /home/rafael/.cargo/registry/src/github.com-1ecc6299db9ec823/nalgebra-0.14.4/src/geometry/point_ops.rs:91:5
    |
91  |     self.coords - &right.coords; 'b);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `core::dimension::U1`, found associated type
    |
   ::: /home/rafael/.cargo/registry/src/github.com-1ecc6299db9ec823/nalgebra-0.14.4/src/geometry/op_macros.rs:160:41
    |
160 |             fn $op($lhs, $rhs: $Rhs) -> Self::Output {
    |                                         ------------ expected `core::matrix::Matrix<N, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfRows<D, D>>::Representative, core::dimension::U1, <core::default_allocator::DefaultAllocator as core::allocator::Allocator<N, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfRows<D, D>>::Representative, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfColumns<core::dimension::U1, core::dimension::U1>>::Representative>>::Buffer>` because of return type
    |
    = note: expected type `core::matrix::Matrix<_, _, core::dimension::U1, _>`
               found type `core::matrix::Matrix<_, _, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfColumns<core::dimension::U1, core::dimension::U1>>::Representative, _>`

error[E0308]: mismatched types
   --> /home/rafael/.cargo/registry/src/github.com-1ecc6299db9ec823/nalgebra-0.14.4/src/geometry/point_ops.rs:96:5
    |
96  |     self.coords - right.coords; );
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `core::dimension::U1`, found associated type
    |
   ::: /home/rafael/.cargo/registry/src/github.com-1ecc6299db9ec823/nalgebra-0.14.4/src/geometry/op_macros.rs:160:41
    |
160 |             fn $op($lhs, $rhs: $Rhs) -> Self::Output {
    |                                         ------------ expected `core::matrix::Matrix<N, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfRows<D, D>>::Representative, core::dimension::U1, <core::default_allocator::DefaultAllocator as core::allocator::Allocator<N, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfRows<D, D>>::Representative, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfColumns<core::dimension::U1, core::dimension::U1>>::Representative>>::Buffer>` because of return type
    |
    = note: expected type `core::matrix::Matrix<_, _, core::dimension::U1, _>`
               found type `core::matrix::Matrix<_, _, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfColumns<core::dimension::U1, core::dimension::U1>>::Representative, _>`

error[E0308]: mismatched types
   --> /home/rafael/.cargo/registry/src/github.com-1ecc6299db9ec823/nalgebra-0.14.4/src/geometry/point_ops.rs:102:36
    |
102 |     Self::Output::from_coordinates(&self.coords - right); 'a, 'b);
    |                                    ^^^^^^^^^^^^^^^^^^^^ expected struct `core::dimension::U1`, found associated type
    |
    = note: expected type `core::matrix::Matrix<_, _, core::dimension::U1, <core::default_allocator::DefaultAllocator as core::allocator::Allocator<N, D1>>::Buffer>`
               found type `core::matrix::Matrix<_, _, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfColumns<core::dimension::U1, core::dimension::U1>>::Representative, <core::default_allocator::DefaultAllocator as core::allocator::Allocator<N, D1, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfColumns<core::dimension::U1, core::dimension::U1>>::Representative>>::Buffer>`

error[E0308]: mismatched types
   --> /home/rafael/.cargo/registry/src/github.com-1ecc6299db9ec823/nalgebra-0.14.4/src/geometry/point_ops.rs:107:36
    |
107 |     Self::Output::from_coordinates(&self.coords - &right); 'a); // FIXME: should not be a ref to `right`.
    |                                    ^^^^^^^^^^^^^^^^^^^^^ expected struct `core::dimension::U1`, found associated type
    |
    = note: expected type `core::matrix::Matrix<_, _, core::dimension::U1, <core::default_allocator::DefaultAllocator as core::allocator::Allocator<N, D1>>::Buffer>`
               found type `core::matrix::Matrix<_, _, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfColumns<core::dimension::U1, core::dimension::U1>>::Representative, <core::default_allocator::DefaultAllocator as core::allocator::Allocator<N, D1, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfColumns<core::dimension::U1, core::dimension::U1>>::Representative>>::Buffer>`

error[E0308]: mismatched types
   --> /home/rafael/.cargo/registry/src/github.com-1ecc6299db9ec823/nalgebra-0.14.4/src/geometry/point_ops.rs:112:36
    |
112 |     Self::Output::from_coordinates(self.coords - right); 'b);
    |                                    ^^^^^^^^^^^^^^^^^^^ expected struct `core::dimension::U1`, found associated type
    |
    = note: expected type `core::matrix::Matrix<_, _, core::dimension::U1, <core::default_allocator::DefaultAllocator as core::allocator::Allocator<N, D1>>::Buffer>`
               found type `core::matrix::Matrix<_, _, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfColumns<core::dimension::U1, core::dimension::U1>>::Representative, <core::default_allocator::DefaultAllocator as core::allocator::Allocator<N, D1, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfColumns<core::dimension::U1, core::dimension::U1>>::Representative>>::Buffer>`

error[E0308]: mismatched types
   --> /home/rafael/.cargo/registry/src/github.com-1ecc6299db9ec823/nalgebra-0.14.4/src/geometry/point_ops.rs:117:36
    |
117 |     Self::Output::from_coordinates(self.coords - right); );
    |                                    ^^^^^^^^^^^^^^^^^^^ expected struct `core::dimension::U1`, found associated type
    |
    = note: expected type `core::matrix::Matrix<_, _, core::dimension::U1, <core::default_allocator::DefaultAllocator as core::allocator::Allocator<N, D1>>::Buffer>`
               found type `core::matrix::Matrix<_, _, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfColumns<core::dimension::U1, core::dimension::U1>>::Representative, <core::default_allocator::DefaultAllocator as core::allocator::Allocator<N, D1, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfColumns<core::dimension::U1, core::dimension::U1>>::Representative>>::Buffer>`

error[E0308]: mismatched types
   --> /home/rafael/.cargo/registry/src/github.com-1ecc6299db9ec823/nalgebra-0.14.4/src/geometry/point_ops.rs:123:36
    |
123 |     Self::Output::from_coordinates(&self.coords + right); 'a, 'b);
    |                                    ^^^^^^^^^^^^^^^^^^^^ expected struct `core::dimension::U1`, found associated type
    |
    = note: expected type `core::matrix::Matrix<_, _, core::dimension::U1, <core::default_allocator::DefaultAllocator as core::allocator::Allocator<N, D1>>::Buffer>`
               found type `core::matrix::Matrix<_, _, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfColumns<core::dimension::U1, core::dimension::U1>>::Representative, <core::default_allocator::DefaultAllocator as core::allocator::Allocator<N, D1, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfColumns<core::dimension::U1, core::dimension::U1>>::Representative>>::Buffer>`

error[E0308]: mismatched types
   --> /home/rafael/.cargo/registry/src/github.com-1ecc6299db9ec823/nalgebra-0.14.4/src/geometry/point_ops.rs:128:36
    |
128 |     Self::Output::from_coordinates(&self.coords + &right); 'a); // FIXME: should not be a ref to `right`.
    |                                    ^^^^^^^^^^^^^^^^^^^^^ expected struct `core::dimension::U1`, found associated type
    |
    = note: expected type `core::matrix::Matrix<_, _, core::dimension::U1, <core::default_allocator::DefaultAllocator as core::allocator::Allocator<N, D1>>::Buffer>`
               found type `core::matrix::Matrix<_, _, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfColumns<core::dimension::U1, core::dimension::U1>>::Representative, <core::default_allocator::DefaultAllocator as core::allocator::Allocator<N, D1, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfColumns<core::dimension::U1, core::dimension::U1>>::Representative>>::Buffer>`

error[E0308]: mismatched types
   --> /home/rafael/.cargo/registry/src/github.com-1ecc6299db9ec823/nalgebra-0.14.4/src/geometry/point_ops.rs:133:36
    |
133 |     Self::Output::from_coordinates(self.coords + right); 'b);
    |                                    ^^^^^^^^^^^^^^^^^^^ expected struct `core::dimension::U1`, found associated type
    |
    = note: expected type `core::matrix::Matrix<_, _, core::dimension::U1, <core::default_allocator::DefaultAllocator as core::allocator::Allocator<N, D1>>::Buffer>`
               found type `core::matrix::Matrix<_, _, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfColumns<core::dimension::U1, core::dimension::U1>>::Representative, <core::default_allocator::DefaultAllocator as core::allocator::Allocator<N, D1, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfColumns<core::dimension::U1, core::dimension::U1>>::Representative>>::Buffer>`

error[E0308]: mismatched types
   --> /home/rafael/.cargo/registry/src/github.com-1ecc6299db9ec823/nalgebra-0.14.4/src/geometry/point_ops.rs:138:36
    |
138 |     Self::Output::from_coordinates(self.coords + right); );
    |                                    ^^^^^^^^^^^^^^^^^^^ expected struct `core::dimension::U1`, found associated type
    |
    = note: expected type `core::matrix::Matrix<_, _, core::dimension::U1, <core::default_allocator::DefaultAllocator as core::allocator::Allocator<N, D1>>::Buffer>`
               found type `core::matrix::Matrix<_, _, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfColumns<core::dimension::U1, core::dimension::U1>>::Representative, <core::default_allocator::DefaultAllocator as core::allocator::Allocator<N, D1, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfColumns<core::dimension::U1, core::dimension::U1>>::Representative>>::Buffer>`

error[E0308]: mismatched types
  --> /home/rafael/.cargo/registry/src/github.com-1ecc6299db9ec823/nalgebra-0.14.4/src/geometry/translation_ops.rs:16:30
   |
16 |     Translation::from_vector(&self.vector + &right.vector); 'a, 'b);
   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `core::dimension::U1`, found associated type
   |
   = note: expected type `core::matrix::Matrix<_, _, core::dimension::U1, <core::default_allocator::DefaultAllocator as core::allocator::Allocator<N, D>>::Buffer>`
              found type `core::matrix::Matrix<_, _, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfColumns<core::dimension::U1, core::dimension::U1>>::Representative, <core::default_allocator::DefaultAllocator as core::allocator::Allocator<N, D, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfColumns<core::dimension::U1, core::dimension::U1>>::Representative>>::Buffer>`

error[E0308]: mismatched types
  --> /home/rafael/.cargo/registry/src/github.com-1ecc6299db9ec823/nalgebra-0.14.4/src/geometry/translation_ops.rs:21:30
   |
21 |     Translation::from_vector(&self.vector + right.vector); 'a);
   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `core::dimension::U1`, found associated type
   |
   = note: expected type `core::matrix::Matrix<_, _, core::dimension::U1, <core::default_allocator::DefaultAllocator as core::allocator::Allocator<N, D>>::Buffer>`
              found type `core::matrix::Matrix<_, _, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfColumns<core::dimension::U1, core::dimension::U1>>::Representative, <core::default_allocator::DefaultAllocator as core::allocator::Allocator<N, D, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfColumns<core::dimension::U1, core::dimension::U1>>::Representative>>::Buffer>`

error[E0308]: mismatched types
  --> /home/rafael/.cargo/registry/src/github.com-1ecc6299db9ec823/nalgebra-0.14.4/src/geometry/translation_ops.rs:26:30
   |
26 |     Translation::from_vector(self.vector + &right.vector); 'b);
   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `core::dimension::U1`, found associated type
   |
   = note: expected type `core::matrix::Matrix<_, _, core::dimension::U1, <core::default_allocator::DefaultAllocator as core::allocator::Allocator<N, D>>::Buffer>`
              found type `core::matrix::Matrix<_, _, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfColumns<core::dimension::U1, core::dimension::U1>>::Representative, <core::default_allocator::DefaultAllocator as core::allocator::Allocator<N, D, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfColumns<core::dimension::U1, core::dimension::U1>>::Representative>>::Buffer>`

error[E0308]: mismatched types
  --> /home/rafael/.cargo/registry/src/github.com-1ecc6299db9ec823/nalgebra-0.14.4/src/geometry/translation_ops.rs:31:30
   |
31 |     Translation::from_vector(self.vector + right.vector); );
   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `core::dimension::U1`, found associated type
   |
   = note: expected type `core::matrix::Matrix<_, _, core::dimension::U1, <core::default_allocator::DefaultAllocator as core::allocator::Allocator<N, D>>::Buffer>`
              found type `core::matrix::Matrix<_, _, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfColumns<core::dimension::U1, core::dimension::U1>>::Representative, <core::default_allocator::DefaultAllocator as core::allocator::Allocator<N, D, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfColumns<core::dimension::U1, core::dimension::U1>>::Representative>>::Buffer>`

error[E0308]: mismatched types
  --> /home/rafael/.cargo/registry/src/github.com-1ecc6299db9ec823/nalgebra-0.14.4/src/geometry/translation_ops.rs:38:30
   |
38 |     Translation::from_vector(&self.vector - &right.vector); 'a, 'b);
   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `core::dimension::U1`, found associated type
   |
   = note: expected type `core::matrix::Matrix<_, _, core::dimension::U1, <core::default_allocator::DefaultAllocator as core::allocator::Allocator<N, D>>::Buffer>`
              found type `core::matrix::Matrix<_, _, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfColumns<core::dimension::U1, core::dimension::U1>>::Representative, <core::default_allocator::DefaultAllocator as core::allocator::Allocator<N, D, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfColumns<core::dimension::U1, core::dimension::U1>>::Representative>>::Buffer>`

error[E0308]: mismatched types
  --> /home/rafael/.cargo/registry/src/github.com-1ecc6299db9ec823/nalgebra-0.14.4/src/geometry/translation_ops.rs:43:30
   |
43 |     Translation::from_vector(&self.vector - right.vector); 'a);
   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `core::dimension::U1`, found associated type
   |
   = note: expected type `core::matrix::Matrix<_, _, core::dimension::U1, <core::default_allocator::DefaultAllocator as core::allocator::Allocator<N, D>>::Buffer>`
              found type `core::matrix::Matrix<_, _, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfColumns<core::dimension::U1, core::dimension::U1>>::Representative, <core::default_allocator::DefaultAllocator as core::allocator::Allocator<N, D, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfColumns<core::dimension::U1, core::dimension::U1>>::Representative>>::Buffer>`

error[E0308]: mismatched types
  --> /home/rafael/.cargo/registry/src/github.com-1ecc6299db9ec823/nalgebra-0.14.4/src/geometry/translation_ops.rs:48:30
   |
48 |     Translation::from_vector(self.vector - &right.vector); 'b);
   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `core::dimension::U1`, found associated type
   |
   = note: expected type `core::matrix::Matrix<_, _, core::dimension::U1, <core::default_allocator::DefaultAllocator as core::allocator::Allocator<N, D>>::Buffer>`
              found type `core::matrix::Matrix<_, _, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfColumns<core::dimension::U1, core::dimension::U1>>::Representative, <core::default_allocator::DefaultAllocator as core::allocator::Allocator<N, D, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfColumns<core::dimension::U1, core::dimension::U1>>::Representative>>::Buffer>`

error[E0308]: mismatched types
  --> /home/rafael/.cargo/registry/src/github.com-1ecc6299db9ec823/nalgebra-0.14.4/src/geometry/translation_ops.rs:53:30
   |
53 |     Translation::from_vector(self.vector - right.vector); );
   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `core::dimension::U1`, found associated type
   |
   = note: expected type `core::matrix::Matrix<_, _, core::dimension::U1, <core::default_allocator::DefaultAllocator as core::allocator::Allocator<N, D>>::Buffer>`
              found type `core::matrix::Matrix<_, _, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfColumns<core::dimension::U1, core::dimension::U1>>::Representative, <core::default_allocator::DefaultAllocator as core::allocator::Allocator<N, D, <core::constraint::ShapeConstraint as core::constraint::SameNumberOfColumns<core::dimension::U1, core::dimension::U1>>::Representative>>::Buffer>`

error: aborting due to 20 previous errors

For more information about this error, try `rustc --explain E0308`.
error: Could not compile `nalgebra`.
@sebcrozet
Copy link
Member

What version of the rust compiler do you use? This looks very similar to #338 which was due to a regression on the nightly build of the compiler. Updating the compiler should get rid of the issue.

@Rafagd
Copy link
Author

Rafagd commented May 26, 2018

rafael@Artorias:~/Projetos/nalgebra$ rustc --version
rustc 1.28.0-nightly (cb20f68d0 2018-05-21)

@sebcrozet
Copy link
Member

Thanks! So this is definitely the same as #338. The only way to fix this is to update the compiler to the latest nigthly.

@Rafagd
Copy link
Author

Rafagd commented May 27, 2018

Yeah, it's working now. Thanks!

@Rafagd Rafagd closed this as completed May 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants