diff --git a/pyo3-macros-backend/src/pyclass.rs b/pyo3-macros-backend/src/pyclass.rs index 30aa3ffe894..72042598d00 100644 --- a/pyo3-macros-backend/src/pyclass.rs +++ b/pyo3-macros-backend/src/pyclass.rs @@ -1672,7 +1672,7 @@ fn pyclass_hash( ctx: &Ctx, ) -> Result<(Option, Option)> { if options.hash.is_some() && options.frozen.is_none() { - bail_spanned!(options.hash.span() => "The `hash` option can only be using in conjunction with `frozen`."); + bail_spanned!(options.hash.span() => "The `hash` option requires the `frozen` option."); } // FIXME: Use hash.map(...).unzip() on MSRV >= 1.66 match options.hash { diff --git a/tests/ui/invalid_pyclass_args.stderr b/tests/ui/invalid_pyclass_args.stderr index 732cdb583a7..4f7914dc262 100644 --- a/tests/ui/invalid_pyclass_args.stderr +++ b/tests/ui/invalid_pyclass_args.stderr @@ -58,7 +58,7 @@ error: a `#[pyclass]` cannot be both a `mapping` and a `sequence` 31 | struct CannotBeMappingAndSequence {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: The `hash` option can only be using in conjunction with `frozen`. +error: The `hash` option requires the `frozen` option. --> tests/ui/invalid_pyclass_args.rs:36:11 | 36 | #[pyclass(hash)] diff --git a/tests/ui/invalid_pyclass_enum.stderr b/tests/ui/invalid_pyclass_enum.stderr index c777e0fab93..fc2bd93876d 100644 --- a/tests/ui/invalid_pyclass_enum.stderr +++ b/tests/ui/invalid_pyclass_enum.stderr @@ -30,7 +30,7 @@ error: `constructor` can't be used on a simple enum variant 26 | #[pyo3(constructor = (a, b))] | ^^^^^^^^^^^ -error: The `hash` option can only be using in conjunction with `frozen`. +error: The `hash` option requires the `frozen` option. --> tests/ui/invalid_pyclass_enum.rs:37:11 | 37 | #[pyclass(hash)]