about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src/coverage/spans.rs
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2023-06-07 18:01:30 +0530
committerGitHub <noreply@github.com>2023-06-07 18:01:30 +0530
commit42cf6da6af4dd738bacf851fc6361a8e3dfb8138 (patch)
tree9fb0f9884feb95524bc6837b05b2768891c7234d /compiler/rustc_mir_transform/src/coverage/spans.rs
parentc6fda401f6d03c3947c6604a709e6a6239c76c4f (diff)
parent5eafab30ba0721451f5114c5b27b37870bb3955a (diff)
downloadrust-42cf6da6af4dd738bacf851fc6361a8e3dfb8138.tar.gz
rust-42cf6da6af4dd738bacf851fc6361a8e3dfb8138.zip
Rollup merge of #112345 - bvanjoi:fix-112342, r=nilstrieb,est31
fix(expand): prevent infinity loop in macro containing only "///"

Fixes https://github.com/rust-lang/rust/issues/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.
Diffstat (limited to 'compiler/rustc_mir_transform/src/coverage/spans.rs')
0 files changed, 0 insertions, 0 deletions