Skip to content

Commit 9151c50

Browse files
committed
Fix mutability of pointers when sending a message to &mut T
The pointer was coerced via. `&mut T -> &T` before converting to `*const T` and to `*mut T`, which in the end gives the wrong provenance.
1 parent 99d0aa7 commit 9151c50

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

objc2/src/message/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ unsafe impl<'a, T: Message + ?Sized> MessageReceiver for &'a T {
250250
unsafe impl<'a, T: Message + ?Sized> MessageReceiver for &'a mut T {
251251
#[inline]
252252
fn __as_raw_receiver(self) -> *mut Object {
253-
self as *const T as *mut T as *mut Object
253+
self as *mut T as *mut Object
254254
}
255255
}
256256

0 commit comments

Comments
 (0)