]> git.lizzy.rs Git - rust.git/commit
Prevent `/**/` from being parsed as a doc comment
authorBarosl Lee <vcs@barosl.com>
Wed, 7 Oct 2015 22:25:59 +0000 (07:25 +0900)
committerBarosl Lee <vcs@barosl.com>
Fri, 9 Oct 2015 19:49:31 +0000 (04:49 +0900)
commitc7fa52df34cfc80f31cc41d797ad847e14e8dd8e
tree9b45350600843e7dc1d506bc9a8281be9e4c730d
parente3376d8a134e52e1638eff37ed3c0d602a0483d7
Prevent `/**/` from being parsed as a doc comment

Previously, `/**/` was incorrectly regarded as a doc comment because it
starts with `/**` and ends with `*/`. However, this caused an ICE
because some code assumed that the length of a doc comment is at least
5. This commit adds an additional check to `is_block_doc_comment` that
tests the length of the input.

Fixes #28844.
src/libsyntax/parse/lexer/mod.rs
src/test/compile-fail/empty-comment.rs [new file with mode: 0644]