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) {}
|
|
|
|
| ^^^
|
|
|
|
|
2021-04-17 21:22:06 +00:00
|
|
|
error: `#[classattr]` does not take any arguments
|
2021-01-09 17:33:28 +00:00
|
|
|
--> $DIR/invalid_pymethods.rs:14:5
|
|
|
|
|
|
2021-04-17 21:22:06 +00:00
|
|
|
14 | #[classattr(foobar)]
|
|
|
|
| ^
|
|
|
|
|
|
|
|
error: static method needs #[staticmethod] attribute
|
|
|
|
--> $DIR/invalid_pymethods.rs:20:5
|
|
|
|
|
|
|
|
|
20 | fn staticmethod_without_attribute() {}
|
2021-01-09 17:33:28 +00:00
|
|
|
| ^^
|
|
|
|
|
2021-03-09 23:37:01 +00:00
|
|
|
error: unexpected receiver
|
2021-04-17 21:22:06 +00:00
|
|
|
--> $DIR/invalid_pymethods.rs:26:35
|
2021-01-09 17:33:28 +00:00
|
|
|
|
|
2021-04-17 21:22:06 +00:00
|
|
|
26 | fn staticmethod_with_receiver(&self) {}
|
2021-01-09 17:33:28 +00:00
|
|
|
| ^
|
|
|
|
|
|
|
|
error: expected receiver for #[getter]
|
2021-04-17 21:22:06 +00:00
|
|
|
--> $DIR/invalid_pymethods.rs:39:5
|
2021-01-09 17:33:28 +00:00
|
|
|
|
|
2021-04-17 21:22:06 +00:00
|
|
|
39 | fn getter_without_receiver() {}
|
2021-01-09 17:33:28 +00:00
|
|
|
| ^^
|
|
|
|
|
|
|
|
error: expected receiver for #[setter]
|
2021-04-17 21:22:06 +00:00
|
|
|
--> $DIR/invalid_pymethods.rs:45:5
|
2021-01-09 17:33:28 +00:00
|
|
|
|
|
2021-04-17 21:22:06 +00:00
|
|
|
45 | fn setter_without_receiver() {}
|
2021-01-09 17:33:28 +00:00
|
|
|
| ^^
|
|
|
|
|
|
|
|
error: text_signature not allowed on __new__; if you want to add a signature on __new__, put it on the struct definition instead
|
2021-04-17 21:22:06 +00:00
|
|
|
--> $DIR/invalid_pymethods.rs:51:24
|
2021-01-09 17:33:28 +00:00
|
|
|
|
|
2021-04-17 21:22:06 +00:00
|
|
|
51 | #[text_signature = "()"]
|
2021-01-09 17:33:28 +00:00
|
|
|
| ^^^^
|
|
|
|
|
|
|
|
error: text_signature not allowed with this method type
|
2021-04-17 21:22:06 +00:00
|
|
|
--> $DIR/invalid_pymethods.rs:58:24
|
2021-01-09 17:33:28 +00:00
|
|
|
|
|
2021-04-17 21:22:06 +00:00
|
|
|
58 | #[text_signature = "()"]
|
2021-01-09 17:33:28 +00:00
|
|
|
| ^^^^
|
|
|
|
|
|
|
|
error: text_signature not allowed with this method type
|
2021-04-17 21:22:06 +00:00
|
|
|
--> $DIR/invalid_pymethods.rs:65:24
|
2021-01-09 17:33:28 +00:00
|
|
|
|
|
2021-04-17 21:22:06 +00:00
|
|
|
65 | #[text_signature = "()"]
|
2021-01-09 17:33:28 +00:00
|
|
|
| ^^^^
|
|
|
|
|
|
|
|
error: text_signature not allowed with this method type
|
2021-04-17 21:22:06 +00:00
|
|
|
--> $DIR/invalid_pymethods.rs:72:24
|
2021-01-09 17:33:28 +00:00
|
|
|
|
|
2021-04-17 21:22:06 +00:00
|
|
|
72 | #[text_signature = "()"]
|
2021-01-09 17:33:28 +00:00
|
|
|
| ^^^^
|
|
|
|
|
|
|
|
error: text_signature not allowed with this method type
|
2021-04-17 21:22:06 +00:00
|
|
|
--> $DIR/invalid_pymethods.rs:79:24
|
2021-01-09 17:33:28 +00:00
|
|
|
|
|
2021-04-17 21:22:06 +00:00
|
|
|
79 | #[text_signature = "()"]
|
2021-01-09 17:33:28 +00:00
|
|
|
| ^^^^
|
|
|
|
|
|
|
|
error: cannot specify a second method type
|
2021-04-17 21:22:06 +00:00
|
|
|
--> $DIR/invalid_pymethods.rs:86:7
|
2021-01-09 17:33:28 +00:00
|
|
|
|
|
2021-04-17 21:22:06 +00:00
|
|
|
86 | #[staticmethod]
|
2021-01-09 17:33:28 +00:00
|
|
|
| ^^^^^^^^^^^^
|
2021-03-09 23:37:01 +00:00
|
|
|
|
|
|
|
error: Python functions cannot have generic type parameters
|
2021-04-17 21:22:06 +00:00
|
|
|
--> $DIR/invalid_pymethods.rs:92:23
|
2021-03-09 23:37:01 +00:00
|
|
|
|
|
2021-04-17 21:22:06 +00:00
|
|
|
92 | fn generic_method<T>(value: T) {}
|
2021-03-09 23:37:01 +00:00
|
|
|
| ^
|
|
|
|
|
|
|
|
error: Python functions cannot have `impl Trait` arguments
|
2021-04-17 21:22:06 +00:00
|
|
|
--> $DIR/invalid_pymethods.rs:98:48
|
2021-03-09 23:37:01 +00:00
|
|
|
|
|
2021-04-17 21:22:06 +00:00
|
|
|
98 | fn impl_trait_method_first_arg(impl_trait: impl AsRef<PyAny>) {}
|
2021-03-09 23:37:01 +00:00
|
|
|
| ^^^^
|
|
|
|
|
|
|
|
error: Python functions cannot have `impl Trait` arguments
|
2021-04-17 21:22:06 +00:00
|
|
|
--> $DIR/invalid_pymethods.rs:103:56
|
|
|
|
|
|
|
|
|
103 | fn impl_trait_method_second_arg(&self, impl_trait: impl AsRef<PyAny>) {}
|
|
|
|
| ^^^^
|