You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, as I'm seeing Rust developers getting serious about enabling the new borrow checker on the 2015 edition (rust-lang/rust#57804 / rust-lang/rust#59114), I compiled my local project with RUSTFLAGS="-Zborrowck=migrate -Ztwo-phase-borrows" cargo +nightly check to test for any possible future problems.
When it compiled nalgebra 0.16.13 for me, I got multiple newly introduced compiler warnings. Even on nalgebra master, I'm getting one compiler warning:
warning[E0502]: cannot borrow `*self` as immutable because it is also borrowed as mutable
--> 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
|
= 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
I'd love a fix of the issue and a new crates.io release soon after that. Thanks!
Hi! Thank you for reporting this and for the fix. I find this warning strange, so I prefer to wait for what @matthewjasper has to say about it before merging anything.
Also keep in mind we don't intend to support rust 2015 indefinitely so at some point in the future rust 2018 will likely be necessary for using nalgebra (e.g. whenever specialization and const-generics land).
Activity
Fix two compiler warnings
est31 commentedon Mar 12, 2019
@matthewjasper is this behaviour intended? Is it a legitimate error of the nalgebra crate?
sebcrozet commentedon Mar 12, 2019
Hi! Thank you for reporting this and for the fix. I find this warning strange, so I prefer to wait for what @matthewjasper has to say about it before merging anything.
Also keep in mind we don't intend to support rust 2015 indefinitely so at some point in the future rust 2018 will likely be necessary for using nalgebra (e.g. whenever specialization and const-generics land).
matthewjasper commentedon Mar 12, 2019
Yes, this is intended. It's the result of fixing rust-lang/rust#27868 .
est31 commentedon Mar 13, 2019
Yeah, so I guess I'd ask my PR to get merged then.
est31 commentedon Mar 13, 2019
This might already arrive in nightlies in next week. The sooner a fixed version is available on crates.io, the better.
Update nalgebra