From 5fe400c006d9d143aa7b977cb13f95e7380754a5 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Sat, 16 May 2026 21:55:55 +0800 Subject: Validate single-segment types in attribute macros --- mingling_macros/src/help.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mingling_macros/src/help.rs') diff --git a/mingling_macros/src/help.rs b/mingling_macros/src/help.rs index 315483d..c89aad2 100644 --- a/mingling_macros/src/help.rs +++ b/mingling_macros/src/help.rs @@ -69,6 +69,11 @@ pub fn help_attr(item: TokenStream) -> TokenStream { Err(e) => return e.to_compile_error().into(), }; + // Check that the entry type is a single-segment type (no `::`) + if let Some(err_tokens) = crate::check_single_segment_type(&entry_type, "#[help]") { + return err_tokens.into(); + } + // Validate return type if let Err(e) = validate_return_type(&input_fn.sig) { return e.to_compile_error().into(); -- cgit