Since Rust 1.73.0 there seems to be a new deny-by-default lint to catch invalid casting from references to mutable pointers.
As far as I understand the compiler is making assumptions that references are read only and passing those assumptions on to LLVM. The only way to tell the compiler to not make those assumptions is to use UnsafeCell.
So this PR is essentially wrapping those casts with UnsafeCell and getting the mutable pointer through it.
In addition to that I fixed some warnings from compiler lints and clippy lints.
Since Rust 1.73.0 there seems to be a new deny-by-default lint to catch invalid casting from references to mutable pointers.
As far as I understand the compiler is making assumptions that references are read only and passing those assumptions on to LLVM. The only way to tell the compiler to not make those assumptions is to use
UnsafeCell
.So this PR is essentially wrapping those casts with
UnsafeCell
and getting the mutable pointer through it.In addition to that I fixed some warnings from compiler lints and clippy lints.