diff --git a/compiler/noirc_frontend/src/parser/errors.rs b/compiler/noirc_frontend/src/parser/errors.rs index ad6f6b928ab..406bcfbf12a 100644 --- a/compiler/noirc_frontend/src/parser/errors.rs +++ b/compiler/noirc_frontend/src/parser/errors.rs @@ -211,8 +211,17 @@ impl<'a> From<&'a ParserError> for Diagnostic { other => Diagnostic::simple_error(format!("{other}"), String::new(), error.span), }, None => { - let primary = error.to_string(); - Diagnostic::simple_error(primary, String::new(), error.span) + if matches!( + error.found.kind(), + TokenKind::InnerDocComment | TokenKind::OuterDocComment + ) { + let primary = "This doc comment doesn't document anything".to_string(); + let secondary = "Consider changing it to a regular `//` comment".to_string(); + Diagnostic::simple_error(primary, secondary, error.span) + } else { + let primary = error.to_string(); + Diagnostic::simple_error(primary, String::new(), error.span) + } } } }