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 e9bbf23 commit dee9f7bCopy full SHA for dee9f7b
compiler/rustc_parse/src/parser/diagnostics.rs
@@ -686,6 +686,13 @@ impl<'a> Parser<'a> {
686
}
687
688
if let token::DocComment(kind, style, _) = self.token.kind {
689
+ // This is to avoid suggesting converting a doc comment to a regular comment
690
+ // when missing a comma before the doc comment in lists. (issue #142311)
691
+ // For example:
692
+ // `enum Foo{
693
+ // A ///xxxxxxx
694
+ // B,
695
+ // }`
696
if !expected.contains(&TokenType::Comma) {
697
// We have something like `expr //!val` where the user likely meant `expr // !val`
698
let pos = self.token.span.lo() + BytePos(2);
0 commit comments