8000 style: drop(Box::from_raw) · RustPython/RustPython@6cf841b · GitHub
[go: up one dir, main page]

Skip to content

Commit 6cf841b

Browse files
committed
style: drop(Box::from_raw)
1 parent 7b57c2b commit 6cf841b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

vm/src/builtins/iter.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use super::{PyInt, PyTupleRef, PyType};
66
use crate::{
77
class::PyClassImpl,
88
function::ArgCallable,
9-
109
protocol::{PyIterReturn, PySequence, PySequenceMethods},
1110
types::{IterNext, IterNextIterable},
1211
Context, Py, PyObject, PyObjectRef, PyPayload, PyResult, VirtualMachine,

vm/src/object/core.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ use super::{
1515
ext::{AsObject, PyResult},
1616
payload::PyObjectPayload,
1717
};
18+
#[cfg(not(feature = "gc"))]
19+
use crate::common::refcount::RefCount;
1820
use crate::common::{
1921
atomic::{OncePtr, PyAtomic, Radium},
2022
linked_list::{Link, LinkedList, Pointers},
2123
lock::{PyMutex, PyMutexGuard, PyRwLock},
22-
refcount::RefCount,
2324
};
2425
#[cfg(feature = "gc")]
2526
use crate::object::gc::{GcHeader, GcObjPtr, GcStatus, GcTrace, TracerFn};
@@ -524,7 +525,7 @@ pub struct PyWeak {
524525

525526
#[cfg(feature = "gc")]
526527
impl crate::object::gc::GcTrace for PyWeak {
527-
fn trace(&self, tracer_fn: &mut crate::object::gc::TracerFn) {
528+
fn trace(&self, _tracer_fn: &mut crate::object::gc::TracerFn) {
528529
// PyWeak doesn't own the object by define
529530
// FIXME(discord9): confirm this and test
530531
}

vm/src/object/gc/collector_sync.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ impl CcSync {
193193
unsafe {
194194
// can drop directly because no one is refering it
195195
// (unlike in collect_white where drop_in_place first and deallocate later)
196-
Box::from_raw(ptr.0.as_ptr());
196+
drop(Box::from_raw(ptr.0.as_ptr()));
197197
/*
198198
drop_value(ptr.0);
199199
free(ptr.0);

0 commit comments

Comments
 (0)
0