8000 style: cargo fmt · RustPython/RustPython@4bc2d5f · GitHub
[go: up one dir, main page]

Skip to content

Commit 4bc2d5f

Browse files
committed
style: cargo fmt
1 parent 8c0ba39 commit 4bc2d5f

File tree

3 files changed

+37
-11
lines changed

3 files changed

+37
-11
lines changed

vm/src/object/core.rs

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,11 +1173,12 @@ impl PyObject {
11731173
pub(in crate::object) unsafe fn dealloc_only(ptr: NonNull<PyObject>) {
11741174
// sanity check
11751175
#[cfg(feature = "gc")]
1176+
#[allow(unused)]
11761177
{
11771178
debug_assert!(ptr.as_ref().header().is_drop());
11781179
if ptr.as_ref().header().is_dealloc() {
11791180
macro_rules! show_typeid {
1180-
($ID: tt, $($TY: ty),*$(,)?) => {
1181+
($ID: tt: $($TY: ty),*$(,)?) => {
11811182
$(
11821183
if TypeId::of::<$TY>()==$ID{
11831184
String::from(std::stringify!($TY))
@@ -1199,9 +1200,14 @@ impl PyObject {
11991200
tuple::PyTupleIterator,
12001201
};
12011202
use crate::builtins::{
1202-
PyBoundMethod, PyDict, PyEnumerate, PyFilter, PyFunction, PyList,
1203-
PyMappingProxy, PyProperty, PySet, PySlice, PyStaticMethod, PySuper,
1204-
PyTraceback, PyTuple, PyType, PyWeakProxy, PyZip,
1203+
PyArithmeticError, PyAssertionError, PyAsyncGen, PyAttributeError,
1204+
PyBaseException, PyBaseExceptionRef, PyBaseObject, PyBlockingIOError, PyBool,
1205+
PyBoundMethod, PyBrokenPipeError, PyBufferError, PyByteArray, PyBytes,
1206+
PyBytesRef, PyBytesWarning, PyChildProcessError, PyClassMethod, PyCode,
1207+
PyComplex, PyConnectionAbortedError, PyConnectionError,
1208+
PyConnectionRefusedError, PyDict, PyEnumerate, PyFilter, PyFunction, PyList,
1209+
PyMappingProxy, PyProperty, PyRange, PySet, PySlice, PyStaticMethod, PyStr,
1210+
PySuper, PyTraceback, PyTuple, PyType, PyWeakProxy, PyZip,
12051211
};
12061212
use crate::function::{ArgCallable, ArgIterable, ArgMapping, ArgSequence};
12071213
use crate::protocol::{
@@ -1210,19 +1216,42 @@ impl PyObject {
12101216
error!(
12111217
"typeid={:?}",
12121218
show_typeid!(
1213-
tid, // builtin types
1214-
// PyRange, PyStr is acyclic, therefore no trace needed for them
1219+
tid: // builtin types
1220+
PyArithmeticError,
1221+
PyAssertionError,
1222+
PyAsyncGen,
1223+
PyAttributeError,
1224+
PyBaseException,
1225+
PyBaseExceptionRef,
1226+
PyBaseObject,
1227+
PyBlockingIOError,
1228+
PyBool,
12151229
PyBoundMethod,
1230+
PyBrokenPipeError,
1231+
PyBufferError,
1232+
PyByteArray,
1233+
PyBytes,
1234+
PyBytesRef,
1235+
PyBytesWarning,
1236+
PyChildProcessError,
1237+
PyClassMethod,
1238+
PyCode,
1239+
PyComplex,
1240+
PyConnectionAbortedError,
1241+
PyConnectionError,
1242+
PyConnectionRefusedError,
12161243
PyDict,
12171244
PyEnumerate,
12181245
PyFilter,
12191246
PyFunction,
12201247
PyList,
12211248
PyMappingProxy,
12221249
PyProperty,
1250+
PyRange,
12231251
PySet,
12241252
PySlice,
12251253
PyStaticMethod,
1254+
PyStr,
12261255
PySuper,
12271256
PyTraceback,
12281257
PyTuple,

vm/src/object/gc/collector_sync.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ impl CcSync {
217217
}
218218
} else {
219219
// FIXME(discord9): confirm if rc==0 then should drop
220+
// This is for Rust's RAII caused ref cycle's drop
220221
GcStatus::ShouldDrop
221222
}
222223
}

vm/src/object/gc/header.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@ use crate::object::gc::{deadlock_handler, CcSync, GLOBAL_COLLECTOR};
44

55
#[cfg(not(feature = "threading"))]
66
use rustpython_common::atomic::Radium;
7-
use rustpython_common::{
8-
atomic::PyAtomic,
9-
lock::{PyMutex, PyRwLockReadGuard},
10-
rc::PyRc,
11-
};
7+
use rustpython_common::{atomic::PyAtomic, lock::PyMutex, rc::PyRc};
128

139
/// Garbage collect header, containing ref count and other info, using repr(C) to stay consistent with PyInner 's repr
1410
#[repr(C)]

0 commit comments

Comments
 (0)
0