gccrs icon indicating copy to clipboard operation
gccrs copied to clipboard

`:meta` specifier fails to match doc comment (was ICE when failing to match repetition)

Open matthewjasper opened this issue 2 years ago • 2 comments

Code

Minimized from core (https://github.com/rust-lang/rust/blob/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/core/src/str/iter.rs#L707). This also ICEs without a doc comment being used, instead of erroring.

macro_rules! generate_pattern_iterators {
    {
        $(#[$forward_iterator_attribute:meta])*
    } => {
    }
}

generate_pattern_iterators! {
    /// Created with the method [`split`].
}

Meta

  • What version of Rust GCC were you using, git sha if possible. 6521333e402a2f71e34591666ae697cab7af7316

Error output

crab1: internal compiler error: in match_matcher, at rust/expand/rust-macro-expand.cc:472
Backtrace

crab1: internal compiler error: in match_matcher, at rust/expand/rust-macro-expand.cc:472
0x755627 Rust::MacroExpander::match_matcher(Rust::Parser<Rust::MacroInvocLexer>&, Rust::AST::MacroMatcher&, bool)
      ../../gccrs/gcc/rust/expand/rust-macro-expand.cc:472
0x755627 Rust::MacroExpander::match_matcher(Rust::Parser<Rust::MacroInvocLexer>&, Rust::AST::MacroMatcher&, bool)
      ../../gccrs/gcc/rust/expand/rust-macro-expand.cc:440
0xa1ed53 Rust::MacroExpander::match_n_matches(Rust::Parser<Rust::MacroInvocLexer>&, Rust::AST::MacroMatchRepetition&, unsigned long&, unsigned long, unsigned long)
      ../../gccrs/gcc/rust/expand/rust-macro-expand.cc:629
0xa1ef7f Rust::MacroExpander::match_repetition(Rust::Parser<Rust::MacroInvocLexer>&, Rust::AST::MacroMatchRepetition&)
      ../../gccrs/gcc/rust/expand/rust-macro-expand.cc:684
0xa1f405 Rust::MacroExpander::match_matcher(Rust::Parser<Rust::MacroInvocLexer>&, Rust::AST::MacroMatcher&, bool)
      ../../gccrs/gcc/rust/expand/rust-macro-expand.cc:510
0xa1f405 Rust::MacroExpander::match_matcher(Rust::Parser<Rust::MacroInvocLexer>&, Rust::AST::MacroMatcher&, bool)
      ../../gccrs/gcc/rust/expand/rust-macro-expand.cc:440
0xa1f7b7 Rust::MacroExpander::try_match_rule(Rust::AST::MacroRule&, Rust::AST::DelimTokenTree&)
      ../../gccrs/gcc/rust/expand/rust-macro-expand.cc:356
0xa1fa23 Rust::MacroExpander::expand_decl_macro(Location, Rust::AST::MacroInvocData&, Rust::AST::MacroRulesDefinition&, bool)
      ../../gccrs/gcc/rust/expand/rust-macro-expand.cc:83
0xa1ff8b Rust::MacroExpander::expand_invoc(Rust::AST::MacroInvocation&, bool)
      ../../gccrs/gcc/rust/expand/rust-macro-expand.cc:284
0xa76152 Rust::ExpandVisitor::go(Rust::AST::Crate&)
      ../../gccrs/gcc/rust/expand/rust-expand-visitor.cc:36
0xa0541e Rust::Session::expansion(Rust::AST::Crate&)
      ../../gccrs/gcc/rust/rust-session-manager.cc:884
0xa0b20e Rust::Session::compile_crate(char const*)
      ../../gccrs/gcc/rust/rust-session-manager.cc:591
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

matthewjasper avatar May 22 '23 21:05 matthewjasper

This no longer produces an ICE, it just fails to match the doc comment

powerboat9 avatar Jun 07 '23 17:06 powerboat9

I'm gonna move this issue to the other milestone as it's not the most important for compiling libcore - but it is an important libcore functionality. I'll also rename it since it no longer ICEs and instead just has the wrong behavior of not recognizing a doc comment

CohenArthur avatar Feb 07 '24 12:02 CohenArthur