554cffd60d
* allow from_py_with inside #[derive(FromPyObject)] * split up FnSpec::parse
184 lines
4.9 KiB
Plaintext
184 lines
4.9 KiB
Plaintext
error: cannot derive FromPyObject for empty structs and variants
|
|
--> $DIR/invalid_frompy_derive.rs:4:11
|
|
|
|
|
4 | struct Foo();
|
|
| ^^
|
|
|
|
error: cannot derive FromPyObject for empty structs and variants
|
|
--> $DIR/invalid_frompy_derive.rs:7:13
|
|
|
|
|
7 | struct Foo2 {}
|
|
| ^^
|
|
|
|
error: cannot derive FromPyObject for empty enum
|
|
--> $DIR/invalid_frompy_derive.rs:10:6
|
|
|
|
|
10 | enum EmptyEnum {}
|
|
| ^^^^^^^^^
|
|
|
|
error: cannot derive FromPyObject for empty structs and variants
|
|
--> $DIR/invalid_frompy_derive.rs:14:15
|
|
|
|
|
14 | EmptyTuple(),
|
|
| ^^
|
|
|
|
error: cannot derive FromPyObject for empty structs and variants
|
|
--> $DIR/invalid_frompy_derive.rs:20:17
|
|
|
|
|
20 | EmptyStruct {},
|
|
| ^^
|
|
|
|
error: cannot derive FromPyObject for empty structs and variants
|
|
--> $DIR/invalid_frompy_derive.rs:26:27
|
|
|
|
|
26 | struct EmptyTransparentTup();
|
|
| ^^
|
|
|
|
error: cannot derive FromPyObject for empty structs and variants
|
|
--> $DIR/invalid_frompy_derive.rs:30:31
|
|
|
|
|
30 | struct EmptyTransparentStruct {}
|
|
| ^^
|
|
|
|
error: cannot derive FromPyObject for empty structs and variants
|
|
--> $DIR/invalid_frompy_derive.rs:35:15
|
|
|
|
|
35 | EmptyTuple(),
|
|
| ^^
|
|
|
|
error: cannot derive FromPyObject for empty structs and variants
|
|
--> $DIR/invalid_frompy_derive.rs:42:17
|
|
|
|
|
42 | EmptyStruct {},
|
|
| ^^
|
|
|
|
error: transparent structs and variants can only have 1 field
|
|
--> $DIR/invalid_frompy_derive.rs:48:35
|
|
|
|
|
48 | struct TransparentTupTooManyFields(String, String);
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
error: transparent structs and variants can only have 1 field
|
|
--> $DIR/invalid_frompy_derive.rs:52:39
|
|
|
|
|
52 | struct TransparentStructTooManyFields {
|
|
| _______________________________________^
|
|
53 | | foo: String,
|
|
54 | | bar: String,
|
|
55 | | }
|
|
| |_^
|
|
|
|
error: transparent structs and variants can only have 1 field
|
|
--> $DIR/invalid_frompy_derive.rs:60:15
|
|
|
|
|
60 | EmptyTuple(String, String),
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
error: transparent structs and variants can only have 1 field
|
|
--> $DIR/invalid_frompy_derive.rs:67:17
|
|
|
|
|
67 | EmptyStruct {
|
|
| _________________^
|
|
68 | | foo: String,
|
|
69 | | bar: String,
|
|
70 | | },
|
|
| |_____^
|
|
|
|
error: expected `attribute`, `item` or `from_py_with`
|
|
--> $DIR/invalid_frompy_derive.rs:76:12
|
|
|
|
|
76 | #[pyo3(attr)]
|
|
| ^^^^
|
|
|
|
error: expected a single string literal argument
|
|
--> $DIR/invalid_frompy_derive.rs:82:12
|
|
|
|
|
82 | #[pyo3(attribute(1))]
|
|
| ^^^^^^^^^
|
|
|
|
error: expected a single string literal argument
|
|
--> $DIR/invalid_frompy_derive.rs:88:12
|
|
|
|
|
88 | #[pyo3(attribute("a", "b"))]
|
|
| ^^^^^^^^^
|
|
|
|
error: attribute name cannot be empty
|
|
--> $DIR/invalid_frompy_derive.rs:94:22
|
|
|
|
|
94 | #[pyo3(attribute(""))]
|
|
| ^^
|
|
|
|
error: expected a single string literal argument
|
|
--> $DIR/invalid_frompy_derive.rs:100:12
|
|
|
|
|
100 | #[pyo3(attribute())]
|
|
| ^^^^^^^^^
|
|
|
|
error: expected a single literal argument
|
|
--> $DIR/invalid_frompy_derive.rs:106:12
|
|
|
|
|
106 | #[pyo3(item("a", "b"))]
|
|
| ^^^^
|
|
|
|
error: expected a single literal argument
|
|
--> $DIR/invalid_frompy_derive.rs:112:12
|
|
|
|
|
112 | #[pyo3(item())]
|
|
| ^^^^
|
|
|
|
error: only one of `attribute` or `item` can be provided
|
|
--> $DIR/invalid_frompy_derive.rs:118:18
|
|
|
|
|
118 | #[pyo3(item, attribute)]
|
|
| ^^^^^^^^^
|
|
|
|
error: unknown `pyo3` container attribute
|
|
--> $DIR/invalid_frompy_derive.rs:123:8
|
|
|
|
|
123 | #[pyo3(unknown = "should not work")]
|
|
| ^^^^^^^
|
|
|
|
error: annotation is not supported for structs
|
|
--> $DIR/invalid_frompy_derive.rs:129:21
|
|
|
|
|
129 | #[pyo3(annotation = "should not work")]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
error: expected string literal for annotation
|
|
--> $DIR/invalid_frompy_derive.rs:136:25
|
|
|
|
|
136 | #[pyo3(annotation = 1)]
|
|
| ^
|
|
|
|
error: FromPyObject can be derived with at most one lifetime parameter
|
|
--> $DIR/invalid_frompy_derive.rs:141:22
|
|
|
|
|
141 | enum TooManyLifetimes<'a, 'b> {
|
|
| ^
|
|
|
|
error: #[derive(FromPyObject)] is not supported for unions
|
|
--> $DIR/invalid_frompy_derive.rs:147:1
|
|
|
|
|
147 | union Union {
|
|
| ^^^^^
|
|
|
|
error: cannot derive FromPyObject for empty structs and variants
|
|
--> $DIR/invalid_frompy_derive.rs:151:10
|
|
|
|
|
151 | #[derive(FromPyObject)]
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
|
|
error: expected a name-value: `pyo3(from_py_with = "func")`
|
|
--> $DIR/invalid_frompy_derive.rs:158:12
|
|
|
|
|
158 | #[pyo3(from_py_with)]
|
|
| ^^^^^^^^^^^^
|
|
|
|
error: expected literal
|
|
--> $DIR/invalid_frompy_derive.rs:164:27
|
|
|
|
|
164 | #[pyo3(from_py_with = func)]
|
|
| ^^^^
|