Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .cspell.dict/cpython.txt
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ venvwlauncher
venvwlaunchert
wbits
weakreflist
weakrefobject
webpki
withitem
withs
Expand Down
1 change: 0 additions & 1 deletion Lib/test/test_weakref.py
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,6 @@ def __call__(self):
self.assertIsNone(mr())
self.assertTrue(mr.called)

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_subclass_refs_dont_replace_standard_refs(self):
class MyRef(weakref.ref):
pass
Expand Down
8 changes: 4 additions & 4 deletions crates/common/src/linked_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,15 +333,15 @@ impl<T> Pointers<T> {
}
}

const fn get_prev(&self) -> Option<NonNull<T>> {
pub const fn get_prev(&self) -> Option<NonNull<T>> {
// SAFETY: prev is the first field in PointersInner, which is #[repr(C)].
unsafe {
let inner = self.inner.get();
let prev = inner as *const Option<NonNull<T>>;
ptr::read(prev)
}
}
const fn get_next(&self) -> Option<NonNull<T>> {
pub const fn get_next(&self) -> Option<NonNull<T>> {
// SAFETY: next is the second field in PointersInner, which is #[repr(C)].
unsafe {
let inner = self.inner.get();
Expand All @@ -351,15 +351,15 @@ impl<T> Pointers<T> {
}
}

const fn set_prev(&mut self, value: Option<NonNull<T>>) {
pub const fn set_prev(&mut self, value: Option<NonNull<T>>) {
// SAFETY: prev is the first field in PointersInner, which is #[repr(C)].
unsafe {
let inner = self.inner.get();
let prev = inner as *mut Option<NonNull<T>>;
ptr::write(prev, value);
}
}
const fn set_next(&mut self, value: Option<NonNull<T>>) {
pub const fn set_next(&mut self, value: Option<NonNull<T>>) {
// SAFETY: next is the second field in PointersInner, which is #[repr(C)].
unsafe {
let inner = self.inner.get();
Expand Down
Loading
Loading