aboutsummaryrefslogtreecommitdiff
path: root/mingling_macros/src/help.rs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-05-16 21:55:55 +0800
committer魏曹先生 <1992414357@qq.com>2026-05-16 21:55:55 +0800
commit5fe400c006d9d143aa7b977cb13f95e7380754a5 (patch)
tree96eca77fa2c47a1b1e6b4713bfefba41555ee9d2 /mingling_macros/src/help.rs
parent29cdd6fdbe9dd658bbc6b6694b563b046c0d9f41 (diff)
Validate single-segment types in attribute macros
Diffstat (limited to 'mingling_macros/src/help.rs')
-rw-r--r--mingling_macros/src/help.rs5
1 files changed, 5 insertions, 0 deletions
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();