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

Update nalgebra to fix compilation error on Rust 1.40 #17

Merged
merged 1 commit into from
Jul 18, 2020

Conversation

Julian-Wollersberger
Copy link
Contributor

In Rust 1.40 a future-compatibility-warning will become a hard error, which will cause the dependency nalgebra v0.17.2 to no longer compile.
Reason: Rust 2015: No longer downgrade NLL errors

rust-sloth$ cargo +nightly check
    Checking nalgebra v0.17.2
error[E0502]: cannot borrow `*self` as immutable because it is also borrowed as mutable
   --> /home/myname/.cargo/registry/src/github.com-1ecc6299db9ec823/nalgebra-0.17.2/src/base/cg.rs:297:44
    |
297 |                 self[(j, i)] += shift[j] * self[(D::dim() - 1, i)];
    |                 ---------------------------^^^^-------------------
    |                 |                          |
    |                 |                          immutable borrow occurs here
    |                 mutable borrow occurs here
    |                 mutable borrow later used here

error: aborting due to previous error

For more information about this error, try `rustc --explain E0502`.
error: could not compile `nalgebra`.

To learn more, run the command again with --verbose.

To fix this, I ran cargo update --package nalgebra to update it to v0.17.3.
(Just cargo update causes the terminal renderer to mess up...)

Btw, this project is amazing ^^
I've made a bash alias pikachu and I show it to basically every IT person I meet :)

In Rust 1.40 a future-compatibility-warning will become a hard error, which will cause the dependency `nalgebra v0.17.2` to no longer compile.

```
rust-sloth$ cargo +nightly check
    Checking nalgebra v0.17.2
error[E0502]: cannot borrow `*self` as immutable because it is also borrowed as mutable
   --> /home/myname/.cargo/registry/src/github.com-1ecc6299db9ec823/nalgebra-0.17.2/src/base/cg.rs:297:44
    |
297 |                 self[(j, i)] += shift[j] * self[(D::dim() - 1, i)];
    |                 ---------------------------^^^^-------------------
    |                 |                          |
    |                 |                          immutable borrow occurs here
    |                 mutable borrow occurs here
    |                 mutable borrow later used here

error: aborting due to previous error

For more information about this error, try `rustc --explain E0502`.
error: could not compile `nalgebra`.

To learn more, run the command again with --verbose.
```

To fix this, I ran `cargo update --package nalgebra` to update it to `v0.17.3`.

(Btw, just `cargo update` causes the terminal renderer to mess up...)
@ecumene
Copy link
Owner

ecumene commented Jul 18, 2020

WOW This PR is OLD, and I'm sorry.

Looks good to me, there's another PR that does the exact same thing. They ran cargo fmt on the code (which I didn't) but I don't really like how it mangles my meticulously written linear algebra!!!

Well done!

@ecumene ecumene merged commit 7f165eb into ecumene:master Jul 18, 2020
@ecumene ecumene mentioned this pull request Jul 18, 2020
@Julian-Wollersberger
Copy link
Contributor Author

WOW This PR is OLD

Time flys by, doesn't it! :)

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

Successfully merging this pull request may close these issues.

2 participants