From ee995a9ca8d3d53163fa192c2df91c33d025bd17 Mon Sep 17 00:00:00 2001 From: Jeong YunWon Date: Sun, 5 Sep 2021 17:43:08 +0900 Subject: [PATCH] better error for pyimpl(with) --- derive/src/pyclass.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 {