mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
py* macro raises better error for duplicated item
This commit is contained in:
1 parent
efa809bd17
commit
1f8213082c
1 file changed
+2
-2
+2
-2
@@ -27,10 +27,10 @@ impl ItemNursery {
|
||||
cfgs: Vec<Attribute>,
|
||||
tokens: TokenStream,
|
||||
) -> Result<()> {
|
||||
if let Some(existing) = self.0.insert((name, cfgs), tokens) {
|
||||
if let Some(existing) = self.0.insert((name.clone(), cfgs), tokens) {
|
||||
Err(syn::Error::new_spanned(
|
||||
existing,
|
||||
"Duplicated #[py*] attribute found",
|
||||
format!("Duplicated #[py*] attribute found for '{}'", name),
|
||||
))
|
||||
} else {
|
||||
Ok(())
|
||||
|
||||
Reference in new issue
Block a user