Merge pull request #1907 from aganders3/fix_tests

Fix additional tests after trybuild update
This commit is contained in:
David Hewitt 2021-10-13 21:35:59 +01:00 committed by GitHub
commit 41bd03790a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 108 additions and 96 deletions

View File

@ -101,6 +101,9 @@ jobs:
}, },
] ]
exclude: exclude:
# PyPy 3.6 is EOL and not working on macos-latest (now macos-11)
- python-version: pypy-3.6
platform: { os: "macos-latest", python-architecture: "x64" }
# There is no 64-bit pypy on windows for pypy-3.6 # There is no 64-bit pypy on windows for pypy-3.6
- python-version: pypy-3.6 - python-version: pypy-3.6
platform: { os: "windows-latest", python-architecture: "x64" } platform: { os: "windows-latest", python-architecture: "x64" }
@ -108,6 +111,15 @@ jobs:
- python-version: pypy-3.7 - python-version: pypy-3.7
platform: { os: "windows-latest", python-architecture: "x86" } platform: { os: "windows-latest", python-architecture: "x86" }
include: include:
# PyPy3.6 still runs on macos-10.15
- rust: stable
python-version: pypy-3.6
platform:
{
os: "macos-10.15",
python-architecture: "x64",
rust-target: "x86_64-apple-darwin",
}
# Test minimal supported Rust version # Test minimal supported Rust version
- rust: 1.41.1 - rust: 1.41.1
python-version: 3.9 python-version: 3.9

View File

@ -1,71 +1,71 @@
error: use of deprecated constant `pyo3::impl_::deprecations::NAME_ATTRIBUTE`: use `#[pyo3(name = "...")]` instead of `#[name = "..."]` error: use of deprecated constant `pyo3::impl_::deprecations::NAME_ATTRIBUTE`: use `#[pyo3(name = "...")]` instead of `#[name = "..."]`
--> $DIR/deprecations.rs:14:5 --> tests/ui/deprecations.rs:14:5
| |
14 | #[name = "num"] 14 | #[name = "num"]
| ^ | ^
| |
note: the lint level is defined here note: the lint level is defined here
--> $DIR/deprecations.rs:1:9 --> tests/ui/deprecations.rs:1:9
| |
1 | #![deny(deprecated)] 1 | #![deny(deprecated)]
| ^^^^^^^^^^ | ^^^^^^^^^^
error: use of deprecated constant `pyo3::impl_::deprecations::NAME_ATTRIBUTE`: use `#[pyo3(name = "...")]` instead of `#[name = "..."]` error: use of deprecated constant `pyo3::impl_::deprecations::NAME_ATTRIBUTE`: use `#[pyo3(name = "...")]` instead of `#[name = "..."]`
--> $DIR/deprecations.rs:17:5 --> tests/ui/deprecations.rs:17:5
| |
17 | #[name = "num"] 17 | #[name = "num"]
| ^ | ^
error: use of deprecated constant `pyo3::impl_::deprecations::TEXT_SIGNATURE_ATTRIBUTE`: use `#[pyo3(text_signature = "...")]` instead of `#[text_signature = "..."]` error: use of deprecated constant `pyo3::impl_::deprecations::TEXT_SIGNATURE_ATTRIBUTE`: use `#[pyo3(text_signature = "...")]` instead of `#[text_signature = "..."]`
--> $DIR/deprecations.rs:18:5 --> tests/ui/deprecations.rs:18:5
| |
18 | #[text_signature = "()"] 18 | #[text_signature = "()"]
| ^ | ^
error: use of deprecated constant `pyo3::impl_::deprecations::NAME_ATTRIBUTE`: use `#[pyo3(name = "...")]` instead of `#[name = "..."]` error: use of deprecated constant `pyo3::impl_::deprecations::NAME_ATTRIBUTE`: use `#[pyo3(name = "...")]` instead of `#[name = "..."]`
--> $DIR/deprecations.rs:22:5 --> tests/ui/deprecations.rs:22:5
| |
22 | #[name = "custom_static"] 22 | #[name = "custom_static"]
| ^ | ^
error: use of deprecated constant `pyo3::impl_::deprecations::TEXT_SIGNATURE_ATTRIBUTE`: use `#[pyo3(text_signature = "...")]` instead of `#[text_signature = "..."]` error: use of deprecated constant `pyo3::impl_::deprecations::TEXT_SIGNATURE_ATTRIBUTE`: use `#[pyo3(text_signature = "...")]` instead of `#[text_signature = "..."]`
--> $DIR/deprecations.rs:23:5 --> tests/ui/deprecations.rs:23:5
| |
23 | #[text_signature = "()"] 23 | #[text_signature = "()"]
| ^ | ^
error: use of deprecated constant `pyo3::impl_::deprecations::NAME_ATTRIBUTE`: use `#[pyo3(name = "...")]` instead of `#[name = "..."]` error: use of deprecated constant `pyo3::impl_::deprecations::NAME_ATTRIBUTE`: use `#[pyo3(name = "...")]` instead of `#[name = "..."]`
--> $DIR/deprecations.rs:28:1 --> tests/ui/deprecations.rs:28:1
| |
28 | #[name = "foo"] 28 | #[name = "foo"]
| ^ | ^
error: use of deprecated constant `pyo3::impl_::deprecations::TEXT_SIGNATURE_ATTRIBUTE`: use `#[pyo3(text_signature = "...")]` instead of `#[text_signature = "..."]` error: use of deprecated constant `pyo3::impl_::deprecations::TEXT_SIGNATURE_ATTRIBUTE`: use `#[pyo3(text_signature = "...")]` instead of `#[text_signature = "..."]`
--> $DIR/deprecations.rs:29:1 --> tests/ui/deprecations.rs:29:1
| |
29 | #[text_signature = "()"] 29 | #[text_signature = "()"]
| ^ | ^
error: use of deprecated constant `pyo3::impl_::deprecations::PYFN_NAME_ARGUMENT`: use `#[pyfn(m)] #[pyo3(name = "...")]` instead of `#[pyfn(m, "...")]` error: use of deprecated constant `pyo3::impl_::deprecations::PYFN_NAME_ARGUMENT`: use `#[pyfn(m)] #[pyo3(name = "...")]` instead of `#[pyfn(m, "...")]`
--> $DIR/deprecations.rs:34:15 --> tests/ui/deprecations.rs:34:15
| |
34 | #[pyfn(m, "some_name")] 34 | #[pyfn(m, "some_name")]
| ^^^^^^^^^^^ | ^^^^^^^^^^^
error: use of deprecated constant `pyo3::impl_::deprecations::TEXT_SIGNATURE_ATTRIBUTE`: use `#[pyo3(text_signature = "...")]` instead of `#[text_signature = "..."]` error: use of deprecated constant `pyo3::impl_::deprecations::TEXT_SIGNATURE_ATTRIBUTE`: use `#[pyo3(text_signature = "...")]` instead of `#[text_signature = "..."]`
--> $DIR/deprecations.rs:35:5 --> tests/ui/deprecations.rs:35:5
| |
35 | #[text_signature = "()"] 35 | #[text_signature = "()"]
| ^ | ^
error: use of deprecated constant `pyo3::impl_::deprecations::PYMODULE_NAME_ARGUMENT`: use `#[pymodule] #[pyo3(name = "...")]` instead of `#[pymodule(...)]` error: use of deprecated constant `pyo3::impl_::deprecations::PYMODULE_NAME_ARGUMENT`: use `#[pymodule] #[pyo3(name = "...")]` instead of `#[pymodule(...)]`
--> $DIR/deprecations.rs:32:12 --> tests/ui/deprecations.rs:32:12
| |
32 | #[pymodule(deprecated_module_name)] 32 | #[pymodule(deprecated_module_name)]
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
error: use of deprecated constant `pyo3::impl_::deprecations::TEXT_SIGNATURE_ATTRIBUTE`: use `#[pyo3(text_signature = "...")]` instead of `#[text_signature = "..."]` error: use of deprecated constant `pyo3::impl_::deprecations::TEXT_SIGNATURE_ATTRIBUTE`: use `#[pyo3(text_signature = "...")]` instead of `#[text_signature = "..."]`
--> $DIR/deprecations.rs:6:1 --> tests/ui/deprecations.rs:6:1
| |
6 | #[text_signature = "()"] 6 | #[text_signature = "()"]
| ^ | ^

View File

@ -1,23 +1,23 @@
error: expected `from_py_with` error: expected `from_py_with`
--> $DIR/invalid_argument_attributes.rs:4:29 --> tests/ui/invalid_argument_attributes.rs:4:29
| |
4 | fn invalid_attribute(#[pyo3(get)] param: String) {} 4 | fn invalid_attribute(#[pyo3(get)] param: String) {}
| ^^^ | ^^^
error: expected `=` error: expected `=`
--> $DIR/invalid_argument_attributes.rs:7:32 --> tests/ui/invalid_argument_attributes.rs:7:32
| |
7 | fn from_py_with_no_value(#[pyo3(from_py_with)] param: String) {} 7 | fn from_py_with_no_value(#[pyo3(from_py_with)] param: String) {}
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
error: expected `from_py_with` error: expected `from_py_with`
--> $DIR/invalid_argument_attributes.rs:10:31 --> tests/ui/invalid_argument_attributes.rs:10:31
| |
10 | fn from_py_with_string(#[pyo3("from_py_with")] param: String) {} 10 | fn from_py_with_string(#[pyo3("from_py_with")] param: String) {}
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
error: expected string literal error: expected string literal
--> $DIR/invalid_argument_attributes.rs:13:58 --> tests/ui/invalid_argument_attributes.rs:13:58
| |
13 | fn from_py_with_value_not_a_string(#[pyo3(from_py_with = func)] param: String) {} 13 | fn from_py_with_value_not_a_string(#[pyo3(from_py_with = func)] param: String) {}
| ^^^^ | ^^^^

View File

@ -1,65 +1,65 @@
error: cannot derive FromPyObject for empty structs and variants error: cannot derive FromPyObject for empty structs and variants
--> $DIR/invalid_frompy_derive.rs:4:11 --> tests/ui/invalid_frompy_derive.rs:4:11
| |
4 | struct Foo(); 4 | struct Foo();
| ^^ | ^^
error: cannot derive FromPyObject for empty structs and variants error: cannot derive FromPyObject for empty structs and variants
--> $DIR/invalid_frompy_derive.rs:7:13 --> tests/ui/invalid_frompy_derive.rs:7:13
| |
7 | struct Foo2 {} 7 | struct Foo2 {}
| ^^ | ^^
error: cannot derive FromPyObject for empty enum error: cannot derive FromPyObject for empty enum
--> $DIR/invalid_frompy_derive.rs:10:6 --> tests/ui/invalid_frompy_derive.rs:10:6
| |
10 | enum EmptyEnum {} 10 | enum EmptyEnum {}
| ^^^^^^^^^ | ^^^^^^^^^
error: cannot derive FromPyObject for empty structs and variants error: cannot derive FromPyObject for empty structs and variants
--> $DIR/invalid_frompy_derive.rs:14:15 --> tests/ui/invalid_frompy_derive.rs:14:15
| |
14 | EmptyTuple(), 14 | EmptyTuple(),
| ^^ | ^^
error: cannot derive FromPyObject for empty structs and variants error: cannot derive FromPyObject for empty structs and variants
--> $DIR/invalid_frompy_derive.rs:20:17 --> tests/ui/invalid_frompy_derive.rs:20:17
| |
20 | EmptyStruct {}, 20 | EmptyStruct {},
| ^^ | ^^
error: cannot derive FromPyObject for empty structs and variants error: cannot derive FromPyObject for empty structs and variants
--> $DIR/invalid_frompy_derive.rs:26:27 --> tests/ui/invalid_frompy_derive.rs:26:27
| |
26 | struct EmptyTransparentTup(); 26 | struct EmptyTransparentTup();
| ^^ | ^^
error: cannot derive FromPyObject for empty structs and variants error: cannot derive FromPyObject for empty structs and variants
--> $DIR/invalid_frompy_derive.rs:30:31 --> tests/ui/invalid_frompy_derive.rs:30:31
| |
30 | struct EmptyTransparentStruct {} 30 | struct EmptyTransparentStruct {}
| ^^ | ^^
error: cannot derive FromPyObject for empty structs and variants error: cannot derive FromPyObject for empty structs and variants
--> $DIR/invalid_frompy_derive.rs:35:15 --> tests/ui/invalid_frompy_derive.rs:35:15
| |
35 | EmptyTuple(), 35 | EmptyTuple(),
| ^^ | ^^
error: cannot derive FromPyObject for empty structs and variants error: cannot derive FromPyObject for empty structs and variants
--> $DIR/invalid_frompy_derive.rs:42:17 --> tests/ui/invalid_frompy_derive.rs:42:17
| |
42 | EmptyStruct {}, 42 | EmptyStruct {},
| ^^ | ^^
error: transparent structs and variants can only have 1 field error: transparent structs and variants can only have 1 field
--> $DIR/invalid_frompy_derive.rs:48:35 --> tests/ui/invalid_frompy_derive.rs:48:35
| |
48 | struct TransparentTupTooManyFields(String, String); 48 | struct TransparentTupTooManyFields(String, String);
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
error: transparent structs and variants can only have 1 field error: transparent structs and variants can only have 1 field
--> $DIR/invalid_frompy_derive.rs:52:39 --> tests/ui/invalid_frompy_derive.rs:52:39
| |
52 | struct TransparentStructTooManyFields { 52 | struct TransparentStructTooManyFields {
| _______________________________________^ | _______________________________________^
@ -69,13 +69,13 @@ error: transparent structs and variants can only have 1 field
| |_^ | |_^
error: transparent structs and variants can only have 1 field error: transparent structs and variants can only have 1 field
--> $DIR/invalid_frompy_derive.rs:60:15 --> tests/ui/invalid_frompy_derive.rs:60:15
| |
60 | EmptyTuple(String, String), 60 | EmptyTuple(String, String),
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
error: transparent structs and variants can only have 1 field error: transparent structs and variants can only have 1 field
--> $DIR/invalid_frompy_derive.rs:67:17 --> tests/ui/invalid_frompy_derive.rs:67:17
| |
67 | EmptyStruct { 67 | EmptyStruct {
| _________________^ | _________________^
@ -85,85 +85,85 @@ error: transparent structs and variants can only have 1 field
| |_____^ | |_____^
error: expected one of: `attribute`, `item`, `from_py_with` error: expected one of: `attribute`, `item`, `from_py_with`
--> $DIR/invalid_frompy_derive.rs:76:12 --> tests/ui/invalid_frompy_derive.rs:76:12
| |
76 | #[pyo3(attr)] 76 | #[pyo3(attr)]
| ^^^^ | ^^^^
error: expected string literal error: expected string literal
--> $DIR/invalid_frompy_derive.rs:82:22 --> tests/ui/invalid_frompy_derive.rs:82:22
| |
82 | #[pyo3(attribute(1))] 82 | #[pyo3(attribute(1))]
| ^ | ^
error: expected at most one argument: `attribute` or `attribute("name")` error: expected at most one argument: `attribute` or `attribute("name")`
--> $DIR/invalid_frompy_derive.rs:88:25 --> tests/ui/invalid_frompy_derive.rs:88:25
| |
88 | #[pyo3(attribute("a", "b"))] 88 | #[pyo3(attribute("a", "b"))]
| ^ | ^
error: attribute name cannot be empty error: attribute name cannot be empty
--> $DIR/invalid_frompy_derive.rs:94:22 --> tests/ui/invalid_frompy_derive.rs:94:22
| |
94 | #[pyo3(attribute(""))] 94 | #[pyo3(attribute(""))]
| ^^ | ^^
error: unexpected end of input, expected string literal error: unexpected end of input, expected string literal
--> $DIR/invalid_frompy_derive.rs:100:21 --> tests/ui/invalid_frompy_derive.rs:100:21
| |
100 | #[pyo3(attribute())] 100 | #[pyo3(attribute())]
| ^^ | ^^
error: expected at most one argument: `item` or `item(key)` error: expected at most one argument: `item` or `item(key)`
--> $DIR/invalid_frompy_derive.rs:106:20 --> tests/ui/invalid_frompy_derive.rs:106:20
| |
106 | #[pyo3(item("a", "b"))] 106 | #[pyo3(item("a", "b"))]
| ^ | ^
error: unexpected end of input, expected literal error: unexpected end of input, expected literal
--> $DIR/invalid_frompy_derive.rs:112:16 --> tests/ui/invalid_frompy_derive.rs:112:16
| |
112 | #[pyo3(item())] 112 | #[pyo3(item())]
| ^^ | ^^
error: only one of `attribute` or `item` can be provided error: only one of `attribute` or `item` can be provided
--> $DIR/invalid_frompy_derive.rs:118:5 --> tests/ui/invalid_frompy_derive.rs:118:5
| |
118 | #[pyo3(item, attribute)] 118 | #[pyo3(item, attribute)]
| ^ | ^
error: expected `transparent` or `annotation` error: expected `transparent` or `annotation`
--> $DIR/invalid_frompy_derive.rs:123:8 --> tests/ui/invalid_frompy_derive.rs:123:8
| |
123 | #[pyo3(unknown = "should not work")] 123 | #[pyo3(unknown = "should not work")]
| ^^^^^^^ | ^^^^^^^
error: `annotation` is unsupported for structs error: `annotation` is unsupported for structs
--> $DIR/invalid_frompy_derive.rs:129:21 --> tests/ui/invalid_frompy_derive.rs:129:21
| |
129 | #[pyo3(annotation = "should not work")] 129 | #[pyo3(annotation = "should not work")]
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
error: expected string literal error: expected string literal
--> $DIR/invalid_frompy_derive.rs:136:25 --> tests/ui/invalid_frompy_derive.rs:136:25
| |
136 | #[pyo3(annotation = 1)] 136 | #[pyo3(annotation = 1)]
| ^ | ^
error: FromPyObject can be derived with at most one lifetime parameter error: FromPyObject can be derived with at most one lifetime parameter
--> $DIR/invalid_frompy_derive.rs:141:22 --> tests/ui/invalid_frompy_derive.rs:141:22
| |
141 | enum TooManyLifetimes<'a, 'b> { 141 | enum TooManyLifetimes<'a, 'b> {
| ^ | ^
error: #[derive(FromPyObject)] is not supported for unions error: #[derive(FromPyObject)] is not supported for unions
--> $DIR/invalid_frompy_derive.rs:147:1 --> tests/ui/invalid_frompy_derive.rs:147:1
| |
147 | union Union { 147 | union Union {
| ^^^^^ | ^^^^^
error: cannot derive FromPyObject for empty structs and variants error: cannot derive FromPyObject for empty structs and variants
--> $DIR/invalid_frompy_derive.rs:151:10 --> tests/ui/invalid_frompy_derive.rs:151:10
| |
151 | #[derive(FromPyObject)] 151 | #[derive(FromPyObject)]
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^
@ -171,13 +171,13 @@ error: cannot derive FromPyObject for empty structs and variants
= note: this error originates in the derive macro `FromPyObject` (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in the derive macro `FromPyObject` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected `=` error: expected `=`
--> $DIR/invalid_frompy_derive.rs:158:11 --> tests/ui/invalid_frompy_derive.rs:158:11
| |
158 | #[pyo3(from_py_with)] 158 | #[pyo3(from_py_with)]
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
error: expected string literal error: expected string literal
--> $DIR/invalid_frompy_derive.rs:164:27 --> tests/ui/invalid_frompy_derive.rs:164:27
| |
164 | #[pyo3(from_py_with = func)] 164 | #[pyo3(from_py_with = func)]
| ^^^^ | ^^^^

View File

@ -1,11 +1,11 @@
error: positional argument or varargs(*) not allowed after keyword arguments error: positional argument or varargs(*) not allowed after keyword arguments
--> $DIR/invalid_macro_args.rs:3:21 --> tests/ui/invalid_macro_args.rs:3:21
| |
3 | #[pyfunction(a = 5, b)] 3 | #[pyfunction(a = 5, b)]
| ^ | ^
error: keyword argument or kwargs(**) is not allowed after kwargs(**) error: keyword argument or kwargs(**) is not allowed after kwargs(**)
--> $DIR/invalid_macro_args.rs:8:29 --> tests/ui/invalid_macro_args.rs:8:29
| |
8 | #[pyfunction(kwargs = "**", a = 5)] 8 | #[pyfunction(kwargs = "**", a = 5)]
| ^ | ^

View File

@ -1,5 +1,5 @@
error: expected &PyModule as first argument with `pass_module` error: expected &PyModule as first argument with `pass_module`
--> $DIR/invalid_need_module_arg_position.rs:6:21 --> tests/ui/invalid_need_module_arg_position.rs:6:21
| |
6 | fn fail(string: &str, module: &PyModule) -> PyResult<&str> { 6 | fn fail(string: &str, module: &PyModule) -> PyResult<&str> {
| ^ | ^

View File

@ -1,47 +1,47 @@
error: getter function can only have one argument (of type pyo3::Python) error: getter function can only have one argument (of type pyo3::Python)
--> $DIR/invalid_property_args.rs:9:50 --> tests/ui/invalid_property_args.rs:9:50
| |
9 | fn getter_with_arg(&self, py: Python, index: u32) {} 9 | fn getter_with_arg(&self, py: Python, index: u32) {}
| ^^^ | ^^^
error: setter function expected to have one argument error: setter function expected to have one argument
--> $DIR/invalid_property_args.rs:18:8 --> tests/ui/invalid_property_args.rs:18:8
| |
18 | fn setter_with_no_arg(&mut self, py: Python) {} 18 | fn setter_with_no_arg(&mut self, py: Python) {}
| ^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^
error: setter function can have at most two arguments ([pyo3::Python,] and value) error: setter function can have at most two arguments ([pyo3::Python,] and value)
--> $DIR/invalid_property_args.rs:24:72 --> tests/ui/invalid_property_args.rs:24:72
| |
24 | fn setter_with_too_many_args(&mut self, py: Python, foo: u32, bar: u32) {} 24 | fn setter_with_too_many_args(&mut self, py: Python, foo: u32, bar: u32) {}
| ^^^ | ^^^
error: `get` and `set` with tuple struct fields require `name` error: `get` and `set` with tuple struct fields require `name`
--> $DIR/invalid_property_args.rs:28:50 --> tests/ui/invalid_property_args.rs:28:50
| |
28 | struct TupleGetterSetterNoName(#[pyo3(get, set)] i32); 28 | struct TupleGetterSetterNoName(#[pyo3(get, set)] i32);
| ^^^ | ^^^
error: `get` may only be specified once error: `get` may only be specified once
--> $DIR/invalid_property_args.rs:31:32 --> tests/ui/invalid_property_args.rs:31:32
| |
31 | struct MultipleGet(#[pyo3(get, get)] i32); 31 | struct MultipleGet(#[pyo3(get, get)] i32);
| ^^^ | ^^^
error: `set` may only be specified once error: `set` may only be specified once
--> $DIR/invalid_property_args.rs:34:32 --> tests/ui/invalid_property_args.rs:34:32
| |
34 | struct MultipleSet(#[pyo3(set, set)] i32); 34 | struct MultipleSet(#[pyo3(set, set)] i32);
| ^^^ | ^^^
error: `name` may only be specified once error: `name` may only be specified once
--> $DIR/invalid_property_args.rs:37:49 --> tests/ui/invalid_property_args.rs:37:49
| |
37 | struct MultipleName(#[pyo3(name = "foo", name = "bar")] i32); 37 | struct MultipleName(#[pyo3(name = "foo", name = "bar")] i32);
| ^^^^^ | ^^^^^
error: `name` is useless without `get` or `set` error: `name` is useless without `get` or `set`
--> $DIR/invalid_property_args.rs:40:40 --> tests/ui/invalid_property_args.rs:40:40
| |
40 | struct NameWithoutGetSet(#[pyo3(name = "value")] i32); 40 | struct NameWithoutGetSet(#[pyo3(name = "value")] i32);
| ^^^^^^^ | ^^^^^^^

View File

@ -1,41 +1,41 @@
error: expected one of freelist/name/extends/module error: expected one of freelist/name/extends/module
--> $DIR/invalid_pyclass_args.rs:3:11 --> tests/ui/invalid_pyclass_args.rs:3:11
| |
3 | #[pyclass(extend=pyo3::types::PyDict)] 3 | #[pyclass(extend=pyo3::types::PyDict)]
| ^^^^^^ | ^^^^^^
error: expected type path (e.g., my_mod::BaseClass) error: expected type path (e.g., my_mod::BaseClass)
--> $DIR/invalid_pyclass_args.rs:6:21 --> tests/ui/invalid_pyclass_args.rs:6:21
| |
6 | #[pyclass(extends = "PyDict")] 6 | #[pyclass(extends = "PyDict")]
| ^^^^^^^^ | ^^^^^^^^
error: expected type name (e.g. "Name") error: expected type name (e.g. "Name")
--> $DIR/invalid_pyclass_args.rs:9:18 --> tests/ui/invalid_pyclass_args.rs:9:18
| |
9 | #[pyclass(name = m::MyClass)] 9 | #[pyclass(name = m::MyClass)]
| ^ | ^
error: expected a single identifier in double-quotes error: expected a single identifier in double-quotes
--> $DIR/invalid_pyclass_args.rs:12:18 --> tests/ui/invalid_pyclass_args.rs:12:18
| |
12 | #[pyclass(name = "Custom Name")] 12 | #[pyclass(name = "Custom Name")]
| ^^^^^^^^^^^^^ | ^^^^^^^^^^^^^
error: since PyO3 0.13 a pyclass name should be in double-quotes, e.g. "CustomName" error: since PyO3 0.13 a pyclass name should be in double-quotes, e.g. "CustomName"
--> $DIR/invalid_pyclass_args.rs:15:18 --> tests/ui/invalid_pyclass_args.rs:15:18
| |
15 | #[pyclass(name = CustomName)] 15 | #[pyclass(name = CustomName)]
| ^^^^^^^^^^ | ^^^^^^^^^^
error: expected string literal (e.g., "my_mod") error: expected string literal (e.g., "my_mod")
--> $DIR/invalid_pyclass_args.rs:18:20 --> tests/ui/invalid_pyclass_args.rs:18:20
| |
18 | #[pyclass(module = my_module)] 18 | #[pyclass(module = my_module)]
| ^^^^^^^^^ | ^^^^^^^^^
error: expected one of gc/weakref/subclass/dict/unsendable error: expected one of gc/weakref/subclass/dict/unsendable
--> $DIR/invalid_pyclass_args.rs:21:11 --> tests/ui/invalid_pyclass_args.rs:21:11
| |
21 | #[pyclass(weakrev)] 21 | #[pyclass(weakrev)]
| ^^^^^^^ | ^^^^^^^

View File

@ -1,11 +1,11 @@
error: Python functions cannot have generic type parameters error: Python functions cannot have generic type parameters
--> $DIR/invalid_pyfunctions.rs:4:21 --> tests/ui/invalid_pyfunctions.rs:4:21
| |
4 | fn generic_function<T>(value: T) {} 4 | fn generic_function<T>(value: T) {}
| ^ | ^
error: Python functions cannot have `impl Trait` arguments error: Python functions cannot have `impl Trait` arguments
--> $DIR/invalid_pyfunctions.rs:7:36 --> tests/ui/invalid_pyfunctions.rs:7:36
| |
7 | fn impl_trait_function(impl_trait: impl AsRef<PyAny>) {} 7 | fn impl_trait_function(impl_trait: impl AsRef<PyAny>) {}
| ^^^^ | ^^^^
@ -13,7 +13,7 @@ error: Python functions cannot have `impl Trait` arguments
error: `async fn` is not yet supported for Python functions. error: `async fn` is not yet supported for Python functions.
Additional crates such as `pyo3-asyncio` can be used to integrate async Rust and Python. For more information, see https://github.com/PyO3/pyo3/issues/1632 Additional crates such as `pyo3-asyncio` can be used to integrate async Rust and Python. For more information, see https://github.com/PyO3/pyo3/issues/1632
--> $DIR/invalid_pyfunctions.rs:10:1 --> tests/ui/invalid_pyfunctions.rs:10:1
| |
10 | async fn async_function() {} 10 | async fn async_function() {}
| ^^^^^ | ^^^^^

View File

@ -1,17 +1,17 @@
error: `name` may only be specified once error: `name` may only be specified once
--> $DIR/invalid_pymethod_names.rs:10:19 --> tests/ui/invalid_pymethod_names.rs:10:19
| |
10 | #[pyo3(name = "num")] 10 | #[pyo3(name = "num")]
| ^^^^^ | ^^^^^
error: `name` may only be specified once error: `name` may only be specified once
--> $DIR/invalid_pymethod_names.rs:18:19 --> tests/ui/invalid_pymethod_names.rs:18:19
| |
18 | #[pyo3(name = "bar")] 18 | #[pyo3(name = "bar")]
| ^^^^^ | ^^^^^
error: `name` not allowed with `#[new]` error: `name` not allowed with `#[new]`
--> $DIR/invalid_pymethod_names.rs:24:19 --> tests/ui/invalid_pymethod_names.rs:24:19
| |
24 | #[pyo3(name = "makenew")] 24 | #[pyo3(name = "makenew")]
| ^^^^^^^^^ | ^^^^^^^^^