mirror of
https://github.com/macports/macports-ports.git
synced 2026-07-12 18:20:25 -07:00
Patch implicit autorefs on raw pointer dereferences in rune-alloc, which are now denied by the dangerous_implicit_autorefs lint in newer Rust.
23 lines
966 B
Diff
23 lines
966 B
Diff
--- crates/rune-alloc/src/ptr.rs
|
|
+++ crates/rune-alloc/src/ptr.rs
|
|
@@ -106,7 +106,7 @@ pub(crate) mod slice {
|
|
// SAFETY: This is *a bit* tricky, but the raw pointer contains the
|
|
// length and *should* be safe to dereference like this. However,
|
|
// walking through the dereferenced `[T]` is not necessarily
|
|
// correct.
|
|
- unsafe { (*from).len() }
|
|
+ unsafe { (&(*from)).len() }
|
|
}
|
|
}
|
|
}
|
|
--- crates/rune-alloc/src/vec/mod.rs
|
|
+++ crates/rune-alloc/src/vec/mod.rs
|
|
@@ -1850,7 +1850,7 @@ impl<T, A: Allocator> Vec<T, A> {
|
|
#[inline]
|
|
unsafe fn try_append_elements(&mut self, other: *const [T]) -> Result<(), Error> {
|
|
- let count = unsafe { (*other).len() };
|
|
+ let count = unsafe { (&(*other)).len() };
|
|
self.try_reserve(count)?;
|
|
let len = self.len();
|
|
unsafe { ptr::copy_nonoverlapping(other as *const T, self.as_mut_ptr().add(len), count) };
|