Skip to content

Commit 6b530ee

Browse files
committed
auto_new: unrestrict set_all and restrict extends
1 parent 164fb7b commit 6b530ee

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
@@ -2227,9 +2227,10 @@ fn pyclass_auto_new<'a>(
22272227
) -> Result<Option<syn::ItemImpl>> {
22282228
if options.auto_new.is_some() {
22292229
ensure_spanned!(
2230-
options.set_all.is_some(), options.hash.span() => "The `auto_new` option requires the `set_all` option.";
2231-
);
2230+
options.extends.is_none(), options.hash.span() => "The `auto_new` option cannot be used with `extends`.";
2231+
);
22322232
}
2233+
22332234
match options.auto_new {
22342235
Some(opt) => {
22352236
if matches!(methods_type, PyClassMethodsType::Specialization) {

0 commit comments

Comments
 (0)