Files
macports-ports/lang/rune/files/patch-dangerous-implicit-autorefs.diff
Herby Gillot 975314d997 rune: update to 0.14.0
Patch implicit autorefs on raw pointer dereferences in rune-alloc, which
are now denied by the dangerous_implicit_autorefs lint in newer Rust.
2026-04-09 00:43:18 -04:00

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) };