Merge pull request #931 from CAD97/patch-2

Rotation::matrix_mut_unchecked may not cause UB
This commit is contained in:
Sébastien Crozet 2021-07-06 01:08:34 -07:00 committed by GitHub
commit e417ec86d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -199,9 +199,9 @@ impl<T: Scalar, const D: usize> Rotation<T, D> {
/// A mutable reference to the underlying matrix representation of this rotation.
///
/// This is suffixed by "_unchecked" because this allows the user to replace the matrix by another one that is
/// non-square, non-inversible, or non-orthonormal. If one of those properties is broken,
/// subsequent method calls may be UB.
/// This is suffixed by "_unchecked" because this allows the user to replace the
/// matrix by another one that is non-inversible or non-orthonormal. If one of
/// those properties is broken, subsequent method calls may return bogus results.
#[inline]
pub fn matrix_mut_unchecked(&mut self) -> &mut SMatrix<T, D, D> {
&mut self.matrix