fix(expand): prevent infinity loop in macro containing only "///" by b...
source link: https://github.com/rust-lang/rust/pull/112345
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Conversation
Contributor
Fixes #112342
Issue #112342 was caused by an infinity loop in parse_tt_inner
, and the state of it is as follows:
-
matcher
:[Sequence, Token(Doc), SequenceKleeneOpNoSep(op: ZeroOrMore), Eof]
-
loop:
Iteration | Action |
---|---|
0 | enter Sequence |
1 | enter Token(Doc) and mp.idx += 1 had been executed |
2 | enter SequenceKleeneOpNoSep and reset mp.idx to 1 |
3 | enter Token(Doc) again |
To prevent the infinite loop, a check for whether it only contains DocComment
in check_lhs_no_empty_seq
had been added.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK