Skip to content

Commit e0e2926

Browse files
authored
Remove Copy from PyPayload
1 parent 0cc8f63 commit e0e2926

File tree

20 files changed

+24
-31
lines changed

20 files changed

+24
-31
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@ wasm-bindgen = "0.2.106"
222222
unsafe_code = "allow"
223223
unsafe_op_in_unsafe_fn = "deny"
224224
elided_lifetimes_in_paths = "warn"
225-
missing_copy_implementations = "warn"
226225

227226
[workspace.lints.clippy]
228227
# alloc_instead_of_core = "warn"

crates/vm/src/anystr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ pub struct SplitArgs<T: TryFromObject> {
1616
maxsplit: isize,
1717
}
1818

19-
#[derive(Clone, Copy, FromArgs)]
19+
#[derive(FromArgs)]
2020
pub struct SplitLinesArgs {
2121
#[pyarg(any, default = false)]
2222
pub keepends: bool,
2323
}
2424

25-
#[derive(Clone, Copy, FromArgs)]
25+
#[derive(FromArgs)]
2626
pub struct ExpandTabsArgs {
2727
#[pyarg(any, default = 8)]
2828
tabsize: isize,

crates/vm/src/builtins/descriptor.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,21 +168,19 @@ impl Representable for PyMethodDescriptor {
168168
}
169169
}
170170

171-
#[derive(Clone, Copy, Debug)]
171+
#[derive(Debug)]
172172
pub enum MemberKind {
173173
Bool = 14,
174174
ObjectEx = 16,
175175
}
176176

177177
pub type MemberSetterFunc = Option<fn(&VirtualMachine, PyObjectRef, PySetterValue) -> PyResult<()>>;
178178

179-
#[derive(Clone, Copy)]
180179
pub enum MemberGetter {
181180
Getter(fn(&VirtualMachine, PyObjectRef) -> PyResult),
182181
Offset(usize),
183182
}
184183

185-
#[derive(Clone, Copy)]
186184
pub enum MemberSetter {
187185
Setter(MemberSetterFunc),
188186
Offset(usize),

crates/vm/src/builtins/module.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use crate::{
99
};
1010

1111
#[pyclass(module = false, name = "module")]
12-
#[derive(Clone, Copy, Debug)]
12+
#[derive(Debug)]
1313
pub struct PyModuleDef {
1414
// pub index: usize,
1515
pub name: &'static PyStrInterned,
@@ -26,7 +26,7 @@ pub type ModuleCreate =
2626
fn(&VirtualMachine, &PyObject, &'static PyModuleDef) -> PyResult<PyRef<PyModule>>;
2727
pub type ModuleExec = fn(&VirtualMachine, &Py<PyModule>) -> PyResult<()>;
2828

29-
#[derive(Clone, Copy, Default)]
29+
#[derive(Default)]
3030
pub struct PyModuleSlots {
3131
pub create: Option<ModuleCreate>,
3232
pub exec: Option<ModuleExec>,
@@ -83,7 +83,7 @@ impl PyModuleDef {
8383

8484
#[allow(clippy::new_without_default)] // avoid Default implementation
8585
#[pyclass(module = false, name = "module")]
86-
#[derive(Clone, Copy, Debug)]
86+
#[derive(Debug)]
8787
pub struct PyModule {
8888
// PyObject *md_dict;
8989
pub def: Option<&'static PyModuleDef>,

crates/vm/src/builtins/namespace.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ use crate::{
1414
///
1515
/// SimpleNamespace(**kwargs)
1616
#[pyclass(module = "types", name = "SimpleNamespace")]
17-
#[derive(Copy, Clone, Debug, Default)]
18-
pub struct PyNamespace;
17+
#[derive(Debug, Default)]
18+
pub struct PyNamespace {}
1919

2020
impl PyPayload for PyNamespace {
2121
#[inline]

crates/vm/src/builtins/object.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use itertools::Itertools;
1818
/// When called, it accepts no arguments and returns a new featureless
1919
/// instance that has no instance attributes and cannot be given any.
2020
#[pyclass(module = false, name = "object")]
21-
#[derive(Clone, Copy, Debug)]
21+
#[derive(Debug)]
2222
pub struct PyBaseObject;
2323

2424
impl PyPayload for PyBaseObject {

crates/vm/src/builtins/singletons.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use crate::{
99
};
1010

1111
#[pyclass(module = false, name = "NoneType")]
12-
#[derive(Clone, Copy, Debug)]
12+
#[derive(Debug)]
1313
pub struct PyNone;
1414

1515
impl PyPayload for PyNone {
@@ -75,7 +75,7 @@ impl AsNumber for PyNone {
7575
}
7676

7777
#[pyclass(module = false, name = "NotImplementedType")]
78-
#[derive(Clone, Copy, Debug)]
78+
#[derive(Debug)]
7979
pub struct PyNotImplemented;
8080

8181
impl PyPayload for PyNotImplemented {

crates/vm/src/builtins/slice.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ impl Representable for PySlice {
301301
}
302302

303303
#[pyclass(module = false, name = "EllipsisType")]
304-
#[derive(Copy, Clone, Debug)]
304+
#[derive(Debug)]
305305
pub struct PyEllipsis;
306306

307307
impl PyPayload for PyEllipsis {

crates/vm/src/builtins/zip.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ impl PyPayload for PyZip {
2424
}
2525
}
2626

27-
#[derive(Clone, Copy, FromArgs)]
27+
#[derive(FromArgs)]
2828
pub struct PyZipNewArgs {
2929
#[pyarg(named, optional)]
3030
strict: OptionalArg<bool>,

crates/vm/src/dict_inner.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ struct DictEntry<T> {
124124
}
125125
static_assertions::assert_eq_size!(DictEntry<PyObjectRef>, Option<DictEntry<PyObjectRef>>);
126126

127-
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
127+
#[derive(Debug, PartialEq, Eq)]
128128
pub struct DictSize {
129129
indices_size: usize,
130130
pub entries_size: usize,

0 commit comments

Comments
 (0)