We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f20a139 commit 4a10628Copy full SHA for 4a10628
src/libsyntax/parse/lexer/mod.rs
@@ -1616,8 +1616,9 @@ pub fn is_doc_comment(s: &str) -> bool {
1616
}
1617
1618
pub fn is_block_doc_comment(s: &str) -> bool {
1619
+ // Prevent `/**/` from being parsed as a doc comment
1620
let res = ((s.starts_with("/**") && *s.as_bytes().get(3).unwrap_or(&b' ') != b'*') ||
- s.starts_with("/*!")) && s.len() >= 5; // Prevent `/**/` from being parsed as a doc comment
1621
+ s.starts_with("/*!")) && s.len() >= 5;
1622
debug!("is {:?} a doc comment? {}", s, res);
1623
res
1624
0 commit comments