Skip to content

1.36 borrow checker warns about possible undefined behavior #616

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

Open
nicodemus26 opened this issue Jul 5, 2019 · 1 comment
Open

1.36 borrow checker warns about possible undefined behavior #616

nicodemus26 opened this issue Jul 5, 2019 · 1 comment

Comments

@nicodemus26
Copy link

nicodemus26 commented Jul 5, 2019

Rust 1.36 (stable) raises a warning from the new borrow checker that will be come an error in the future, and represents potentially undefined behavior. Maybe related to this issue: #561

See also: https://blog.rust-lang.org/2019/07/04/Rust-1.36.0.html#nll-for-rust-2015

warning[E0502]: cannot borrow `*self` as immutable because it is also borrowed as mutable
   --> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/nalgebra-0.16.13/src/base/cg.rs:291:44
    |
291 |                 self[(j, i)] += shift[j] * self[(D::dim() - 1, i)];
    |                 ---------------------------^^^^-------------------
    |                 |                          |
    |                 |                          immutable borrow occurs here
    |                 mutable borrow occurs here
    |                 mutable borrow later used here
    |
    = warning: this error has been downgraded to a warning for backwards compatibility with previous releases
    = warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future
@nicodemus26 nicodemus26 changed the title 1.36 borrow checker 1.36 borrow checker warns about possible undefined behavior Jul 5, 2019
@est31
Copy link
Contributor

est31 commented Aug 9, 2019

Yes, this is a dupe of #561 .

You are using nalgebra 0.16.13 which is ancient. This bug is fixed since the 0.18.0 release in March 31, 2019.

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