2021-01-09 17:33:28 +00:00
|
|
|
error: class attribute methods cannot take arguments
|
|
|
|
--> $DIR/invalid_pymethods.rs:9:29
|
|
|
|
|
|
|
|
|
9 | fn class_attr_with_args(foo: i32) {}
|
|
|
|
| ^^^
|
|
|
|
|
|
|
|
error: static method needs #[staticmethod] attribute
|
|
|
|
--> $DIR/invalid_pymethods.rs:14:5
|
|
|
|
|
|
|
|
|
14 | fn staticmethod_without_attribute() {}
|
|
|
|
| ^^
|
|
|
|
|
2021-03-09 23:37:01 +00:00
|
|
|
error: unexpected receiver
|
2021-01-09 17:33:28 +00:00
|
|
|
--> $DIR/invalid_pymethods.rs:20:35
|
|
|
|
|
|
|
|
|
20 | fn staticmethod_with_receiver(&self) {}
|
|
|
|
| ^
|
|
|
|
|
|
|
|
error: expected receiver for #[getter]
|
|
|
|
--> $DIR/invalid_pymethods.rs:33:5
|
|
|
|
|
|
|
|
|
33 | fn getter_without_receiver() {}
|
|
|
|
| ^^
|
|
|
|
|
|
|
|
error: expected receiver for #[setter]
|
|
|
|
--> $DIR/invalid_pymethods.rs:39:5
|
|
|
|
|
|
|
|
|
39 | fn setter_without_receiver() {}
|
|
|
|
| ^^
|
|
|
|
|
|
|
|
error: text_signature not allowed on __new__; if you want to add a signature on __new__, put it on the struct definition instead
|
|
|
|
--> $DIR/invalid_pymethods.rs:45:24
|
|
|
|
|
|
|
|
|
45 | #[text_signature = "()"]
|
|
|
|
| ^^^^
|
|
|
|
|
|
|
|
error: text_signature not allowed with this method type
|
|
|
|
--> $DIR/invalid_pymethods.rs:52:24
|
|
|
|
|
|
|
|
|
52 | #[text_signature = "()"]
|
|
|
|
| ^^^^
|
|
|
|
|
|
|
|
error: text_signature not allowed with this method type
|
|
|
|
--> $DIR/invalid_pymethods.rs:59:24
|
|
|
|
|
|
|
|
|
59 | #[text_signature = "()"]
|
|
|
|
| ^^^^
|
|
|
|
|
|
|
|
error: text_signature not allowed with this method type
|
|
|
|
--> $DIR/invalid_pymethods.rs:66:24
|
|
|
|
|
|
|
|
|
66 | #[text_signature = "()"]
|
|
|
|
| ^^^^
|
|
|
|
|
|
|
|
error: text_signature not allowed with this method type
|
|
|
|
--> $DIR/invalid_pymethods.rs:73:24
|
|
|
|
|
|
|
|
|
73 | #[text_signature = "()"]
|
|
|
|
| ^^^^
|
|
|
|
|
|
|
|
error: cannot specify a second method type
|
|
|
|
--> $DIR/invalid_pymethods.rs:80:7
|
|
|
|
|
|
|
|
|
80 | #[staticmethod]
|
|
|
|
| ^^^^^^^^^^^^
|
2021-03-09 23:37:01 +00:00
|
|
|
|
|
|
|
error: Python functions cannot have generic type parameters
|
|
|
|
--> $DIR/invalid_pymethods.rs:86:23
|
|
|
|
|
|
|
|
|
86 | fn generic_method<T>(value: T) {}
|
|
|
|
| ^
|
|
|
|
|
|
|
|
error: Python functions cannot have `impl Trait` arguments
|
|
|
|
--> $DIR/invalid_pymethods.rs:92:48
|
|
|
|
|
|
|
|
|
92 | fn impl_trait_method_first_arg(impl_trait: impl AsRef<PyAny>) {}
|
|
|
|
| ^^^^
|
|
|
|
|
|
|
|
error: Python functions cannot have `impl Trait` arguments
|
|
|
|
--> $DIR/invalid_pymethods.rs:97:56
|
|
|
|
|
|
|
|
|
97 | fn impl_trait_method_second_arg(&self, impl_trait: impl AsRef<PyAny>) {}
|
|
|
|
| ^^^^
|