Skip to content

Commit bb9959b

Browse files
committed
auto_new: unrestrict set_all and restrict extends
1 parent c9b8178 commit bb9959b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pyo3-macros-backend/src/pyclass.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2257,9 +2257,10 @@ fn pyclass_auto_new<'a>(
22572257
) -> Result<Option<syn::ItemImpl>> {
22582258
if options.auto_new.is_some() {
22592259
ensure_spanned!(
2260-
options.set_all.is_some(), options.hash.span() => "The `auto_new` option requires the `set_all` option.";
2261-
);
2260+
options.extends.is_none(), options.hash.span() => "The `auto_new` option cannot be used with `extends`.";
2261+
);
22622262
}
2263+
22632264
match options.auto_new {
22642265
Some(opt) => {
22652266
if matches!(methods_type, PyClassMethodsType::Specialization) {

0 commit comments

Comments
 (0)