Skip to content

Commit

Permalink
Let's make rust happy
Browse files Browse the repository at this point in the history
  • Loading branch information
mejrs committed Jul 1, 2022
1 parent d27681b commit f66f929
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/impl_/frompyobject.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ pub fn failed_to_extract_enum(
);
for ((variant_name, error_name), error) in variant_names.iter().zip(error_names).zip(errors) {
use std::fmt::Write;

err_msg.push('\n');
write!(
&mut err_msg,
"- variant {variant_name} ({error_name}): {error_msg}",
"\n- variant {variant_name} ({error_name}): {error_msg}",
variant_name = variant_name,
error_name = error_name,
error_msg = extract_traceback(py, error.clone_ref(py)),
Expand Down
3 changes: 3 additions & 0 deletions tests/test_compile_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ fn _test_compile_errors() {
t.compile_fail("tests/ui/invalid_pymethod_receiver.rs");
t.compile_fail("tests/ui/invalid_result_conversion.rs");
t.compile_fail("tests/ui/missing_intopy.rs");

// Only run this with these features to avoid different outputs
#[cfg(all(feature = "full", not(feature = "abi3")))]
t.compile_fail("tests/ui/missing_clone.rs");
}

Expand Down
3 changes: 3 additions & 0 deletions tests/ui/abi3_nativetype_inheritance.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ error[E0277]: the trait bound `PyDict: PyClass` is not satisfied
5 | #[pyclass(extends=PyDict)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `PyClass` is not implemented for `PyDict`
|
= help: the trait `PyClass` is implemented for `TestClass`
= note: required because of the requirements on the impl of `PyClassBaseType` for `PyDict`
= note: this error originates in the attribute macro `pyclass` (in Nightly builds, run with -Z macro-backtrace for more info)

Expand All @@ -13,6 +14,7 @@ error[E0277]: the trait bound `PyDict: PyClass` is not satisfied
5 | #[pyclass(extends=PyDict)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `PyClass` is not implemented for `PyDict`
|
= help: the trait `PyClass` is implemented for `TestClass`
= note: required because of the requirements on the impl of `PyClassBaseType` for `PyDict`
note: required by a bound in `PyRefMut`
--> src/pycell.rs
Expand All @@ -27,6 +29,7 @@ error[E0277]: the trait bound `PyDict: PyClass` is not satisfied
5 | #[pyclass(extends=PyDict)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `PyClass` is not implemented for `PyDict`
|
= help: the trait `PyClass` is implemented for `TestClass`
= note: required because of the requirements on the impl of `PyClassBaseType` for `PyDict`
note: required by a bound in `ThreadCheckerInherited`
--> src/impl_/pyclass.rs
Expand Down

0 comments on commit f66f929

Please sign in to comment.