a few unreachable->unimplemented, clippy (#6405) · RustPython/RustPython@bfd873a · GitHub
Skip to content

Commit bfd873a

Browse files
authored
a few unreachable->unimplemented, clippy (#6405)
* unreachable -> unimplemented * Fix clippy on 1.92
1 parent f379ea8 commit bfd873a

27 files changed

Lines changed: 31 additions & 34 deletions

crates/codegen/src/unparse.rs

Lines changed: 5 additions & 1 deletion

crates/stdlib/src/contextvars.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ mod _contextvars {
508508
}
509509

510510
fn py_new(_cls: &Py<PyType>, _args: Self::Args, _vm: &VirtualMachine) -> PyResult<Self> {
511-
unreachable!("use slot_new")
511+
unimplemented!("use slot_new")
512512
}
513513
}
514514

@@ -585,7 +585,7 @@ mod _contextvars {
585585
Err(vm.new_runtime_error("Tokens can only be created by ContextVars"))
586586
}
587587
fn py_new(_cls: &Py<PyType>, _args: Self::Args, _vm: &VirtualMachine) -> PyResult<Self> {
588-
unreachable!("use slot_new")
588+
unimplemented!("use slot_new")
589589
}
590590
}
591591

crates/stdlib/src/ssl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4116,7 +4116,7 @@ mod _ssl {
41164116
}
41174117

41184118
fn py_new(_cls: &Py<PyType>, _args: Self::Args, _vm: &VirtualMachine) -> PyResult<Self> {
4119-
unreachable!("use slot_new")
4119+
unimplemented!("use slot_new")
41204120
}
41214121
}
41224122

crates/vm/src/builtins/bool.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use crate::{
66
class::PyClassImpl,
77
convert::{IntoPyException, ToPyObject, ToPyResult},
88
function::{FuncArgs, OptionalArg},
9-
identifier,
109
protocol::PyNumberMethods,
1110
types::{AsNumber, Constructor, Representable},
1211
};
@@ -115,7 +114,7 @@ impl Constructor for PyBool {
115114
}
116115

117116
fn py_new(_cls: &Py<PyType>, _args: Self::Args, _vm: &VirtualMachine) -> PyResult<Self> {
118-
unreachable!("use slot_new")
117+
unimplemented!("use slot_new")
119118
}
120119
}
121120

crates/vm/src/builtins/classmethod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ impl Constructor for PyClassMethod {
103103
}
104104

105105
fn py_new(_cls: &Py<PyType>, _args: Self::Args, _vm: &VirtualMachine) -> PyResult<Self> {
106-
unreachable!("use slot_new")
106+
unimplemented!("use slot_new")
107107
}
108108
}
109109

crates/vm/src/builtins/complex.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use crate::{
1010
PyArithmeticValue::{self, *},
1111
PyComparisonValue,
1212
},
13-
identifier,
1413
protocol::PyNumberMethods,
1514
stdlib::warnings,
1615
types::{AsNumber, Comparable, Constructor, Hashable, PyComparisonOp, Representable},

crates/vm/src/builtins/int.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ impl Constructor for PyInt {
244244
}
245245

246246
fn py_new(_cls: &Py<PyType>, _args: Self::Args, _vm: &VirtualMachine) -> PyResult<Self> {
247-
unreachable!("use slot_new")
247+
unimplemented!("use slot_new")
248248
}
249249
}
250250

crates/vm/src/builtins/object.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ impl Constructor for PyBaseObject {
111111
}
112112

113113
fn py_new(_cls: &Py<PyType>, _args: Self::Args, _vm: &VirtualMachine) -> PyResult<Self> {
114-
unreachable!("use slot_new")
114+
unimplemented!("use slot_new")
115115
}
116116
}
117117

crates/vm/src/builtins/staticmethod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ impl Constructor for PyStaticMethod {
6161
}
6262

6363
fn py_new(_cls: &Py<PyType>, _args: Self::Args, _vm: &VirtualMachine) -> PyResult<Self> {
64-
unreachable!("use slot_new")
64+
unimplemented!("use slot_new")
6565
}
6666
}
6767

crates/vm/src/builtins/type.rs

Lines changed: 1 addition & 2 deletions

0 commit comments

Comments
 (0)