We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4ddb7d1 commit c7b7e29Copy full SHA for c7b7e29
gcc/rust/parse/rust-parse-impl.h
@@ -793,6 +793,21 @@ Parser<ManagedTokenSource>::parse_attr_input ()
793
794
t = lexer.peek_token ();
795
796
+ // attempt to parse macro
797
+ // TODO: macros may/may not be allowed in attributes
798
+ // this is needed for "#[doc = include_str!(...)]"
799
+ if (is_simple_path_segment (t->get_id ()))
800
+ {
801
+ std::unique_ptr<AST::MacroInvocation> invoke
802
+ = parse_macro_invocation ({});
803
+
804
+ if (!invoke)
805
+ return nullptr;
806
807
+ return std::unique_ptr<AST::AttrInput> (
808
+ new AST::AttrInputMacro (std::move (invoke)));
809
+ }
810
811
/* Ensure token is a "literal expression" (literally only a literal
812
* token of any type) */
813
if (!t->is_literal ())
gcc/testsuite/rust/compile/doc_macro.rs
@@ -0,0 +1 @@
1
+#![doc = concat!("AB")]
0 commit comments