Merge pull request #1907 from aganders3/fix_tests
Fix additional tests after trybuild update
This commit is contained in:
commit
41bd03790a
|
@ -101,6 +101,9 @@ jobs:
|
|||
},
|
||||
]
|
||||
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
|
||||
- python-version: pypy-3.6
|
||||
platform: { os: "windows-latest", python-architecture: "x64" }
|
||||
|
@ -108,6 +111,15 @@ jobs:
|
|||
- python-version: pypy-3.7
|
||||
platform: { os: "windows-latest", python-architecture: "x86" }
|
||||
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
|
||||
- rust: 1.41.1
|
||||
python-version: 3.9
|
||||
|
|
|
@ -1,71 +1,71 @@
|
|||
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"]
|
||||
| ^
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/deprecations.rs:1:9
|
||||
--> tests/ui/deprecations.rs:1:9
|
||||
|
|
||||
1 | #![deny(deprecated)]
|
||||
| ^^^^^^^^^^
|
||||
|
||||
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"]
|
||||
| ^
|
||||
|
||||
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 = "()"]
|
||||
| ^
|
||||
|
||||
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"]
|
||||
| ^
|
||||
|
||||
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 = "()"]
|
||||
| ^
|
||||
|
||||
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"]
|
||||
| ^
|
||||
|
||||
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 = "()"]
|
||||
| ^
|
||||
|
||||
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")]
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
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 = "()"]
|
||||
| ^
|
||||
|
||||
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)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
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 = "()"]
|
||||
| ^
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
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) {}
|
||||
| ^^^
|
||||
|
||||
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) {}
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
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) {}
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
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) {}
|
||||
| ^^^^
|
||||
|
|
|
@ -1,65 +1,65 @@
|
|||
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();
|
||||
| ^^
|
||||
|
||||
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 {}
|
||||
| ^^
|
||||
|
||||
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 {}
|
||||
| ^^^^^^^^^
|
||||
|
||||
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(),
|
||||
| ^^
|
||||
|
||||
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 {},
|
||||
| ^^
|
||||
|
||||
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();
|
||||
| ^^
|
||||
|
||||
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 {}
|
||||
| ^^
|
||||
|
||||
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(),
|
||||
| ^^
|
||||
|
||||
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 {},
|
||||
| ^^
|
||||
|
||||
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);
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
||||
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 {
|
||||
| _______________________________________^
|
||||
|
@ -69,13 +69,13 @@ 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),
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
||||
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 {
|
||||
| _________________^
|
||||
|
@ -85,85 +85,85 @@ error: transparent structs and variants can only have 1 field
|
|||
| |_____^
|
||||
|
||||
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)]
|
||||
| ^^^^
|
||||
|
||||
error: expected string literal
|
||||
--> $DIR/invalid_frompy_derive.rs:82:22
|
||||
--> tests/ui/invalid_frompy_derive.rs:82:22
|
||||
|
|
||||
82 | #[pyo3(attribute(1))]
|
||||
| ^
|
||||
|
||||
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"))]
|
||||
| ^
|
||||
|
||||
error: attribute name cannot be empty
|
||||
--> $DIR/invalid_frompy_derive.rs:94:22
|
||||
--> tests/ui/invalid_frompy_derive.rs:94:22
|
||||
|
|
||||
94 | #[pyo3(attribute(""))]
|
||||
| ^^
|
||||
|
||||
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())]
|
||||
| ^^
|
||||
|
||||
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"))]
|
||||
| ^
|
||||
|
||||
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())]
|
||||
| ^^
|
||||
|
||||
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)]
|
||||
| ^
|
||||
|
||||
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")]
|
||||
| ^^^^^^^
|
||||
|
||||
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")]
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: expected string literal
|
||||
--> $DIR/invalid_frompy_derive.rs:136:25
|
||||
--> tests/ui/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
|
||||
--> tests/ui/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
|
||||
--> tests/ui/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
|
||||
--> tests/ui/invalid_frompy_derive.rs:151:10
|
||||
|
|
||||
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)
|
||||
|
||||
error: expected `=`
|
||||
--> $DIR/invalid_frompy_derive.rs:158:11
|
||||
--> tests/ui/invalid_frompy_derive.rs:158:11
|
||||
|
|
||||
158 | #[pyo3(from_py_with)]
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
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)]
|
||||
| ^^^^
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
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)]
|
||||
| ^
|
||||
|
||||
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)]
|
||||
| ^
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
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> {
|
||||
| ^
|
||||
|
|
|
@ -1,47 +1,47 @@
|
|||
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) {}
|
||||
| ^^^
|
||||
|
||||
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) {}
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
||||
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) {}
|
||||
| ^^^
|
||||
|
||||
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);
|
||||
| ^^^
|
||||
|
||||
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);
|
||||
| ^^^
|
||||
|
||||
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);
|
||||
| ^^^
|
||||
|
||||
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);
|
||||
| ^^^^^
|
||||
|
||||
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);
|
||||
| ^^^^^^^
|
||||
|
|
|
@ -1,41 +1,41 @@
|
|||
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)]
|
||||
| ^^^^^^
|
||||
|
||||
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")]
|
||||
| ^^^^^^^^
|
||||
|
||||
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)]
|
||||
| ^
|
||||
|
||||
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")]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
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)]
|
||||
| ^^^^^^^^^^
|
||||
|
||||
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)]
|
||||
| ^^^^^^^^^
|
||||
|
||||
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)]
|
||||
| ^^^^^^^
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
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) {}
|
||||
| ^
|
||||
|
||||
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>) {}
|
||||
| ^^^^
|
||||
|
@ -13,7 +13,7 @@ error: Python functions cannot have `impl Trait` arguments
|
|||
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
|
||||
--> $DIR/invalid_pyfunctions.rs:10:1
|
||||
--> tests/ui/invalid_pyfunctions.rs:10:1
|
||||
|
|
||||
10 | async fn async_function() {}
|
||||
| ^^^^^
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
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")]
|
||||
| ^^^^^
|
||||
|
||||
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")]
|
||||
| ^^^^^
|
||||
|
||||
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")]
|
||||
| ^^^^^^^^^
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error[E0277]: the trait bound `i32: From<&PyCell<MyClass>>` is not satisfied
|
||||
--> $DIR/invalid_pymethod_receiver.rs:8:43
|
||||
--> tests/ui/invalid_pymethod_receiver.rs:8:43
|
||||
|
|
||||
8 | fn method_with_invalid_self_type(slf: i32, py: Python, index: u32) {}
|
||||
| ^^^ the trait `From<&PyCell<MyClass>>` is not implemented for `i32`
|
||||
|
@ -13,7 +13,7 @@ error[E0277]: the trait bound `i32: From<&PyCell<MyClass>>` is not satisfied
|
|||
= note: required because of the requirements on the impl of `Into<i32>` for `&PyCell<MyClass>`
|
||||
= note: required because of the requirements on the impl of `TryFrom<&PyCell<MyClass>>` for `i32`
|
||||
note: required by `std::convert::TryFrom::try_from`
|
||||
--> $DIR/mod.rs:477:5
|
||||
--> $RUST/core/src/convert/mod.rs
|
||||
|
|
||||
477 | fn try_from(value: T) -> Result<Self, Self::Error>;
|
||||
| fn try_from(value: T) -> Result<Self, Self::Error>;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
|
@ -1,89 +1,89 @@
|
|||
error: class attribute methods cannot take arguments
|
||||
--> $DIR/invalid_pymethods.rs:9:29
|
||||
--> tests/ui/invalid_pymethods.rs:9:29
|
||||
|
|
||||
9 | fn class_attr_with_args(foo: i32) {}
|
||||
| ^^^
|
||||
|
||||
error: `#[classattr]` does not take any arguments
|
||||
--> $DIR/invalid_pymethods.rs:14:5
|
||||
--> tests/ui/invalid_pymethods.rs:14:5
|
||||
|
|
||||
14 | #[classattr(foobar)]
|
||||
| ^
|
||||
|
||||
error: static method needs #[staticmethod] attribute
|
||||
--> $DIR/invalid_pymethods.rs:20:5
|
||||
--> tests/ui/invalid_pymethods.rs:20:5
|
||||
|
|
||||
20 | fn staticmethod_without_attribute() {}
|
||||
| ^^
|
||||
|
||||
error: unexpected receiver
|
||||
--> $DIR/invalid_pymethods.rs:26:35
|
||||
--> tests/ui/invalid_pymethods.rs:26:35
|
||||
|
|
||||
26 | fn staticmethod_with_receiver(&self) {}
|
||||
| ^
|
||||
|
||||
error: expected receiver for #[getter]
|
||||
--> $DIR/invalid_pymethods.rs:39:5
|
||||
--> tests/ui/invalid_pymethods.rs:39:5
|
||||
|
|
||||
39 | fn getter_without_receiver() {}
|
||||
| ^^
|
||||
|
||||
error: expected receiver for #[setter]
|
||||
--> $DIR/invalid_pymethods.rs:45:5
|
||||
--> tests/ui/invalid_pymethods.rs:45:5
|
||||
|
|
||||
45 | 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:51:12
|
||||
--> tests/ui/invalid_pymethods.rs:51:12
|
||||
|
|
||||
51 | #[pyo3(text_signature = "()")]
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: text_signature not allowed with this method type
|
||||
--> $DIR/invalid_pymethods.rs:58:12
|
||||
--> tests/ui/invalid_pymethods.rs:58:12
|
||||
|
|
||||
58 | #[pyo3(text_signature = "()")]
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: text_signature not allowed with this method type
|
||||
--> $DIR/invalid_pymethods.rs:65:12
|
||||
--> tests/ui/invalid_pymethods.rs:65:12
|
||||
|
|
||||
65 | #[pyo3(text_signature = "()")]
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: text_signature not allowed with this method type
|
||||
--> $DIR/invalid_pymethods.rs:72:12
|
||||
--> tests/ui/invalid_pymethods.rs:72:12
|
||||
|
|
||||
72 | #[pyo3(text_signature = "()")]
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: text_signature not allowed with this method type
|
||||
--> $DIR/invalid_pymethods.rs:79:12
|
||||
--> tests/ui/invalid_pymethods.rs:79:12
|
||||
|
|
||||
79 | #[pyo3(text_signature = "()")]
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: cannot specify a second method type
|
||||
--> $DIR/invalid_pymethods.rs:86:7
|
||||
--> tests/ui/invalid_pymethods.rs:86:7
|
||||
|
|
||||
86 | #[staticmethod]
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: Python functions cannot have generic type parameters
|
||||
--> $DIR/invalid_pymethods.rs:92:23
|
||||
--> tests/ui/invalid_pymethods.rs:92:23
|
||||
|
|
||||
92 | fn generic_method<T>(value: T) {}
|
||||
| ^
|
||||
|
||||
error: Python functions cannot have `impl Trait` arguments
|
||||
--> $DIR/invalid_pymethods.rs:98:48
|
||||
--> tests/ui/invalid_pymethods.rs:98:48
|
||||
|
|
||||
98 | fn impl_trait_method_first_arg(impl_trait: impl AsRef<PyAny>) {}
|
||||
| ^^^^
|
||||
|
||||
error: Python functions cannot have `impl Trait` arguments
|
||||
--> $DIR/invalid_pymethods.rs:103:56
|
||||
--> tests/ui/invalid_pymethods.rs:103:56
|
||||
|
|
||||
103 | fn impl_trait_method_second_arg(&self, impl_trait: impl AsRef<PyAny>) {}
|
||||
| ^^^^
|
||||
|
@ -91,13 +91,13 @@ error: Python functions cannot have `impl Trait` arguments
|
|||
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
|
||||
--> $DIR/invalid_pymethods.rs:108:5
|
||||
--> tests/ui/invalid_pymethods.rs:108:5
|
||||
|
|
||||
108 | async fn async_method(&self) {}
|
||||
| ^^^^^
|
||||
|
||||
error: `pass_module` cannot be used on Python methods
|
||||
--> $DIR/invalid_pymethods.rs:113:12
|
||||
--> tests/ui/invalid_pymethods.rs:113:12
|
||||
|
|
||||
113 | #[pyo3(pass_module)]
|
||||
| ^^^^^^^^^^^
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error[E0277]: the trait bound `TestClass: Clone` is not satisfied
|
||||
--> $DIR/missing_clone.rs:15:32
|
||||
--> tests/ui/missing_clone.rs:15:32
|
||||
|
|
||||
15 | let t: TestClass = pyvalue.extract(py).unwrap();
|
||||
| ^^^^^^^ the trait `Clone` is not implemented for `TestClass`
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error: #[pyclass] cannot have generic parameters
|
||||
--> $DIR/reject_generics.rs:4:25
|
||||
--> tests/ui/reject_generics.rs:4:25
|
||||
|
|
||||
4 | struct ClassWithGenerics<A> {
|
||||
| ^
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'p` due to conflicting requirements
|
||||
--> $DIR/static_ref.rs:4:1
|
||||
--> tests/ui/static_ref.rs:4:1
|
||||
|
|
||||
4 | #[pyfunction]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
|
||||
note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the body at 4:1...
|
||||
--> $DIR/static_ref.rs:4:1
|
||||
--> tests/ui/static_ref.rs:4:1
|
||||
|
|
||||
4 | #[pyfunction]
|
||||
| ^^^^^^^^^^^^^
|
||||
note: ...so that the types are compatible
|
||||
--> $DIR/static_ref.rs:4:1
|
||||
--> tests/ui/static_ref.rs:4:1
|
||||
|
|
||||
4 | #[pyfunction]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
@ -18,7 +18,7 @@ note: ...so that the types are compatible
|
|||
found `pyo3::Python<'_>`
|
||||
= note: but, the lifetime must be valid for the static lifetime...
|
||||
note: ...so that reference does not outlive borrowed content
|
||||
--> $DIR/static_ref.rs:4:1
|
||||
--> tests/ui/static_ref.rs:4:1
|
||||
|
|
||||
4 | #[pyfunction]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error[E0505]: cannot move out of `gil` because it is borrowed
|
||||
--> $DIR/wrong_aspyref_lifetimes.rs:7:10
|
||||
--> tests/ui/wrong_aspyref_lifetimes.rs:7:10
|
||||
|
|
||||
6 | let dict: &PyDict = dict.as_ref(gil.python());
|
||||
| --- borrow of `gil` occurs here
|
||||
|
|
Loading…
Reference in New Issue