diff --git a/derive/src/pyclass.rs b/derive/src/pyclass.rs index a3651fa510..9d02a4509f 100644 --- a/derive/src/pyclass.rs +++ b/derive/src/pyclass.rs @@ -893,17 +893,17 @@ fn extract_impl_attrs(attr: AttributeArgs) -> std::result::Result PyRef::::impl_extend_class(ctx, class); }); - with_slots.push(quote! { + with_slots.push(quote_spanned! { path.span() => PyRef::::extend_slots(slots); }); } else { - withs.push(quote! { + withs.push(quote_spanned! { path.span() => ::__extend_py_class(ctx, class); }); - with_slots.push(quote! { + with_slots.push(quote_spanned! { path.span() => ::__extend_slots(slots); }); } @@ -913,7 +913,7 @@ fn extract_impl_attrs(attr: AttributeArgs) -> std::result::Result { if let Some(ident) = path.get_ident() { - flags.push(quote! { + flags.push(quote_spanned! { ident.span() => | ::rustpython_vm::slots::PyTpFlags::#ident.bits() }); } else {