2021-01-09 17:33:28 +00:00
|
|
|
error: cannot derive FromPyObject for empty structs and variants
|
2021-10-12 00:52:24 +00:00
|
|
|
--> tests/ui/invalid_frompy_derive.rs:4:11
|
2020-08-30 10:54:13 +00:00
|
|
|
|
|
|
|
|
4 | struct Foo();
|
|
|
|
| ^^
|
|
|
|
|
2021-01-09 17:33:28 +00:00
|
|
|
error: cannot derive FromPyObject for empty structs and variants
|
2021-10-12 00:52:24 +00:00
|
|
|
--> tests/ui/invalid_frompy_derive.rs:7:13
|
2020-08-30 10:54:13 +00:00
|
|
|
|
|
|
|
|
7 | struct Foo2 {}
|
|
|
|
| ^^
|
|
|
|
|
2021-01-09 17:33:28 +00:00
|
|
|
error: cannot derive FromPyObject for empty enum
|
2021-10-12 00:52:24 +00:00
|
|
|
--> tests/ui/invalid_frompy_derive.rs:10:6
|
2020-08-30 10:54:13 +00:00
|
|
|
|
|
|
|
|
10 | enum EmptyEnum {}
|
|
|
|
| ^^^^^^^^^
|
|
|
|
|
2021-01-09 17:33:28 +00:00
|
|
|
error: cannot derive FromPyObject for empty structs and variants
|
2021-10-12 00:52:24 +00:00
|
|
|
--> tests/ui/invalid_frompy_derive.rs:14:15
|
2020-08-30 10:54:13 +00:00
|
|
|
|
|
|
|
|
14 | EmptyTuple(),
|
|
|
|
| ^^
|
|
|
|
|
2021-01-09 17:33:28 +00:00
|
|
|
error: cannot derive FromPyObject for empty structs and variants
|
2021-10-12 00:52:24 +00:00
|
|
|
--> tests/ui/invalid_frompy_derive.rs:20:17
|
2020-08-30 10:54:13 +00:00
|
|
|
|
|
|
|
|
20 | EmptyStruct {},
|
|
|
|
| ^^
|
|
|
|
|
2021-01-09 17:33:28 +00:00
|
|
|
error: cannot derive FromPyObject for empty structs and variants
|
2021-10-12 00:52:24 +00:00
|
|
|
--> tests/ui/invalid_frompy_derive.rs:26:27
|
2020-08-30 10:54:13 +00:00
|
|
|
|
|
|
|
|
26 | struct EmptyTransparentTup();
|
|
|
|
| ^^
|
|
|
|
|
2021-01-09 17:33:28 +00:00
|
|
|
error: cannot derive FromPyObject for empty structs and variants
|
2021-10-12 00:52:24 +00:00
|
|
|
--> tests/ui/invalid_frompy_derive.rs:30:31
|
2020-08-30 10:54:13 +00:00
|
|
|
|
|
|
|
|
30 | struct EmptyTransparentStruct {}
|
|
|
|
| ^^
|
|
|
|
|
2021-01-09 17:33:28 +00:00
|
|
|
error: cannot derive FromPyObject for empty structs and variants
|
2021-10-12 00:52:24 +00:00
|
|
|
--> tests/ui/invalid_frompy_derive.rs:35:15
|
2020-08-30 10:54:13 +00:00
|
|
|
|
|
|
|
|
35 | EmptyTuple(),
|
|
|
|
| ^^
|
|
|
|
|
2021-01-09 17:33:28 +00:00
|
|
|
error: cannot derive FromPyObject for empty structs and variants
|
2021-10-12 00:52:24 +00:00
|
|
|
--> tests/ui/invalid_frompy_derive.rs:42:17
|
2020-08-30 10:54:13 +00:00
|
|
|
|
|
|
|
|
42 | EmptyStruct {},
|
|
|
|
| ^^
|
|
|
|
|
2021-01-09 17:33:28 +00:00
|
|
|
error: transparent structs and variants can only have 1 field
|
2021-10-12 00:52:24 +00:00
|
|
|
--> tests/ui/invalid_frompy_derive.rs:48:35
|
2020-08-30 10:54:13 +00:00
|
|
|
|
|
|
|
|
48 | struct TransparentTupTooManyFields(String, String);
|
|
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
2021-01-09 17:33:28 +00:00
|
|
|
error: transparent structs and variants can only have 1 field
|
2021-10-12 00:52:24 +00:00
|
|
|
--> tests/ui/invalid_frompy_derive.rs:52:39
|
2020-08-30 10:54:13 +00:00
|
|
|
|
|
|
|
|
52 | struct TransparentStructTooManyFields {
|
|
|
|
| _______________________________________^
|
|
|
|
53 | | foo: String,
|
|
|
|
54 | | bar: String,
|
|
|
|
55 | | }
|
|
|
|
| |_^
|
|
|
|
|
2021-01-09 17:33:28 +00:00
|
|
|
error: transparent structs and variants can only have 1 field
|
2021-10-12 00:52:24 +00:00
|
|
|
--> tests/ui/invalid_frompy_derive.rs:60:15
|
2020-08-30 10:54:13 +00:00
|
|
|
|
|
|
|
|
60 | EmptyTuple(String, String),
|
|
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
2021-01-09 17:33:28 +00:00
|
|
|
error: transparent structs and variants can only have 1 field
|
2021-10-12 00:52:24 +00:00
|
|
|
--> tests/ui/invalid_frompy_derive.rs:67:17
|
2020-08-30 10:54:13 +00:00
|
|
|
|
|
|
|
|
67 | EmptyStruct {
|
|
|
|
| _________________^
|
|
|
|
68 | | foo: String,
|
|
|
|
69 | | bar: String,
|
|
|
|
70 | | },
|
|
|
|
| |_____^
|
|
|
|
|
2021-04-17 21:22:06 +00:00
|
|
|
error: expected one of: `attribute`, `item`, `from_py_with`
|
2021-10-12 00:52:24 +00:00
|
|
|
--> tests/ui/invalid_frompy_derive.rs:76:12
|
2020-08-30 10:54:13 +00:00
|
|
|
|
|
|
|
|
76 | #[pyo3(attr)]
|
|
|
|
| ^^^^
|
|
|
|
|
2021-04-17 21:22:06 +00:00
|
|
|
error: expected string literal
|
2021-10-12 00:52:24 +00:00
|
|
|
--> tests/ui/invalid_frompy_derive.rs:82:22
|
2020-08-30 10:54:13 +00:00
|
|
|
|
|
|
|
|
82 | #[pyo3(attribute(1))]
|
2021-04-17 21:22:06 +00:00
|
|
|
| ^
|
2020-08-30 10:54:13 +00:00
|
|
|
|
2021-04-17 21:22:06 +00:00
|
|
|
error: expected at most one argument: `attribute` or `attribute("name")`
|
2021-10-12 00:52:24 +00:00
|
|
|
--> tests/ui/invalid_frompy_derive.rs:88:25
|
2020-08-30 10:54:13 +00:00
|
|
|
|
|
|
|
|
88 | #[pyo3(attribute("a", "b"))]
|
2021-04-17 21:22:06 +00:00
|
|
|
| ^
|
2020-08-30 10:54:13 +00:00
|
|
|
|
2021-01-09 17:33:28 +00:00
|
|
|
error: attribute name cannot be empty
|
2021-10-12 00:52:24 +00:00
|
|
|
--> tests/ui/invalid_frompy_derive.rs:94:22
|
2020-08-30 10:54:13 +00:00
|
|
|
|
|
|
|
|
94 | #[pyo3(attribute(""))]
|
|
|
|
| ^^
|
|
|
|
|
2021-04-17 21:22:06 +00:00
|
|
|
error: unexpected end of input, expected string literal
|
2021-12-03 23:29:02 +00:00
|
|
|
--> tests/ui/invalid_frompy_derive.rs:100:22
|
2020-08-30 10:54:13 +00:00
|
|
|
|
|
|
|
|
100 | #[pyo3(attribute())]
|
2021-12-03 23:29:02 +00:00
|
|
|
| ^
|
2020-08-30 10:54:13 +00:00
|
|
|
|
2021-04-17 21:22:06 +00:00
|
|
|
error: expected at most one argument: `item` or `item(key)`
|
2021-10-12 00:52:24 +00:00
|
|
|
--> tests/ui/invalid_frompy_derive.rs:106:20
|
2020-08-30 10:54:13 +00:00
|
|
|
|
|
|
|
|
106 | #[pyo3(item("a", "b"))]
|
2021-04-17 21:22:06 +00:00
|
|
|
| ^
|
2020-08-30 10:54:13 +00:00
|
|
|
|
2021-04-17 21:22:06 +00:00
|
|
|
error: unexpected end of input, expected literal
|
2021-12-03 23:29:02 +00:00
|
|
|
--> tests/ui/invalid_frompy_derive.rs:112:17
|
2020-08-30 10:54:13 +00:00
|
|
|
|
|
|
|
|
112 | #[pyo3(item())]
|
2021-12-03 23:29:02 +00:00
|
|
|
| ^
|
2020-08-30 10:54:13 +00:00
|
|
|
|
2021-01-09 17:33:28 +00:00
|
|
|
error: only one of `attribute` or `item` can be provided
|
2021-10-12 00:52:24 +00:00
|
|
|
--> tests/ui/invalid_frompy_derive.rs:118:5
|
2020-08-30 10:54:13 +00:00
|
|
|
|
|
|
|
|
118 | #[pyo3(item, attribute)]
|
2023-04-26 11:47:07 +00:00
|
|
|
| ^
|
2020-08-30 10:54:13 +00:00
|
|
|
|
2023-04-26 11:47:07 +00:00
|
|
|
error: expected one of: `transparent`, `from_item_all`, `annotation`, `crate`
|
2021-10-12 00:52:24 +00:00
|
|
|
--> tests/ui/invalid_frompy_derive.rs:123:8
|
2020-08-30 10:54:13 +00:00
|
|
|
|
|
|
|
|
123 | #[pyo3(unknown = "should not work")]
|
2021-01-09 17:33:28 +00:00
|
|
|
| ^^^^^^^
|
2020-08-30 10:54:13 +00:00
|
|
|
|
2021-04-17 21:22:06 +00:00
|
|
|
error: `annotation` is unsupported for structs
|
2021-10-12 00:52:24 +00:00
|
|
|
--> tests/ui/invalid_frompy_derive.rs:129:21
|
2020-08-30 10:54:13 +00:00
|
|
|
|
|
|
|
|
129 | #[pyo3(annotation = "should not work")]
|
2021-01-09 17:33:28 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^
|
2020-08-30 10:54:13 +00:00
|
|
|
|
2021-04-17 21:22:06 +00:00
|
|
|
error: expected string literal
|
2021-10-12 00:52:24 +00:00
|
|
|
--> tests/ui/invalid_frompy_derive.rs:136:25
|
2020-08-30 10:54:13 +00:00
|
|
|
|
|
|
|
|
136 | #[pyo3(annotation = 1)]
|
|
|
|
| ^
|
|
|
|
|
2021-01-09 17:33:28 +00:00
|
|
|
error: FromPyObject can be derived with at most one lifetime parameter
|
2021-10-12 00:52:24 +00:00
|
|
|
--> tests/ui/invalid_frompy_derive.rs:141:22
|
2020-08-30 10:54:13 +00:00
|
|
|
|
|
|
|
|
141 | enum TooManyLifetimes<'a, 'b> {
|
2023-04-26 11:47:07 +00:00
|
|
|
| ^
|
2020-08-30 10:54:13 +00:00
|
|
|
|
2021-01-09 17:33:28 +00:00
|
|
|
error: #[derive(FromPyObject)] is not supported for unions
|
2021-10-12 00:52:24 +00:00
|
|
|
--> tests/ui/invalid_frompy_derive.rs:147:1
|
2020-08-30 10:54:13 +00:00
|
|
|
|
|
2023-04-26 11:47:07 +00:00
|
|
|
147 | union Union {
|
|
|
|
| ^^^^^
|
2020-08-30 10:54:13 +00:00
|
|
|
|
2021-01-09 17:33:28 +00:00
|
|
|
error: cannot derive FromPyObject for empty structs and variants
|
2021-10-12 00:52:24 +00:00
|
|
|
--> tests/ui/invalid_frompy_derive.rs:151:10
|
2020-08-30 10:54:13 +00:00
|
|
|
|
|
|
|
|
151 | #[derive(FromPyObject)]
|
|
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
|
2021-07-30 22:30:56 +00:00
|
|
|
= note: this error originates in the derive macro `FromPyObject` (in Nightly builds, run with -Z macro-backtrace for more info)
|
2021-02-20 15:15:20 +00:00
|
|
|
|
2021-04-17 21:22:06 +00:00
|
|
|
error: expected `=`
|
2021-12-03 23:29:02 +00:00
|
|
|
--> tests/ui/invalid_frompy_derive.rs:158:24
|
2021-02-20 15:15:20 +00:00
|
|
|
|
|
|
|
|
158 | #[pyo3(from_py_with)]
|
2021-12-03 23:29:02 +00:00
|
|
|
| ^
|
2021-02-20 15:15:20 +00:00
|
|
|
|
2021-04-17 21:22:06 +00:00
|
|
|
error: expected string literal
|
2021-10-12 00:52:24 +00:00
|
|
|
--> tests/ui/invalid_frompy_derive.rs:164:27
|
2021-02-20 15:15:20 +00:00
|
|
|
|
|
|
|
|
164 | #[pyo3(from_py_with = func)]
|
|
|
|
| ^^^^
|
2022-06-08 05:41:31 +00:00
|
|
|
|
|
|
|
error: `getter` is not permitted on tuple struct elements.
|
|
|
|
--> tests/ui/invalid_frompy_derive.rs:169:27
|
|
|
|
|
|
|
|
|
169 | struct InvalidTupleGetter(#[pyo3(item("foo"))] String);
|
2023-04-26 11:47:07 +00:00
|
|
|
| ^
|
2022-06-08 05:41:31 +00:00
|
|
|
|
|
|
|
error: `transparent` structs may not have a `getter` for the inner field
|
|
|
|
--> tests/ui/invalid_frompy_derive.rs:175:5
|
|
|
|
|
|
|
|
|
175 | field: String,
|
|
|
|
| ^^^^^
|
2023-04-26 04:48:12 +00:00
|
|
|
|
|
|
|
error: `transparent` structs may not have a `getter` for the inner field
|
|
|
|
--> tests/ui/invalid_frompy_derive.rs:186:5
|
|
|
|
|
|
|
|
|
186 | field: String,
|
|
|
|
| ^^^^^
|
|
|
|
|
2023-04-27 04:44:38 +00:00
|
|
|
error: `from_item_all` may only be provided once
|
|
|
|
--> tests/ui/invalid_frompy_derive.rs:190:23
|
|
|
|
|
|
|
|
|
190 | #[pyo3(from_item_all, from_item_all)]
|
|
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
2023-04-26 11:47:07 +00:00
|
|
|
error: Useless `item` - the struct is already annotated with `from_item_all`
|
2023-04-27 04:44:38 +00:00
|
|
|
--> tests/ui/invalid_frompy_derive.rs:196:8
|
2023-04-26 04:48:12 +00:00
|
|
|
|
|
2023-04-27 04:44:38 +00:00
|
|
|
196 | #[pyo3(from_item_all)]
|
2023-04-26 11:47:07 +00:00
|
|
|
| ^^^^^^^^^^^^^
|
2023-04-26 04:48:12 +00:00
|
|
|
|
2023-04-27 04:44:38 +00:00
|
|
|
error: The struct is already annotated with `from_item_all`, `attribute` is not allowed
|
|
|
|
--> tests/ui/invalid_frompy_derive.rs:203:8
|
2023-04-26 04:48:12 +00:00
|
|
|
|
|
2023-04-27 04:44:38 +00:00
|
|
|
203 | #[pyo3(from_item_all)]
|
|
|
|
| ^^^^^^^^^^^^^
|
2023-04-26 04:48:12 +00:00
|
|
|
|
2023-04-27 04:44:38 +00:00
|
|
|
error: The struct is already annotated with `from_item_all`, `attribute` is not allowed
|
|
|
|
--> tests/ui/invalid_frompy_derive.rs:210:8
|
2023-04-26 04:48:12 +00:00
|
|
|
|
|
2023-04-27 04:44:38 +00:00
|
|
|
210 | #[pyo3(from_item_all)]
|
|
|
|
| ^^^^^^^^^^^^^
|