aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust
diff options
context:
space:
mode:
authorMuhammad Mahad <mahadtxt@gmail.com>2023-08-17 10:13:00 +0500
committerPhilip Herron <philip.herron@embecosm.com>2023-08-17 09:53:20 +0000
commit0110145c1de18fb7859f0801c8d91edcf82b6c7d (patch)
tree225c1400ac81c6e910cdf351c07ac6a9c8965c75 /gcc/rust
parentefa3041b4b19d598b919455ec1290ba899e54508 (diff)
downloadgcc-0110145c1de18fb7859f0801c8d91edcf82b6c7d.zip
gcc-0110145c1de18fb7859f0801c8d91edcf82b6c7d.tar.gz
gcc-0110145c1de18fb7859f0801c8d91edcf82b6c7d.tar.bz2
gccrs: [E0753] Use of inner doc comment in invalid context
gcc/rust/ChangeLog: * parse/rust-parse-impl.h (Parser::parse_outer_attribute): Added errorcode & updated error function. gcc/testsuite/ChangeLog: * rust/compile/bad_inner_doc.rs: Updated comment to pass testcase. Signed-off-by: Muhammad Mahad <mahadtxt@gmail.com>
Diffstat (limited to 'gcc/rust')
-rw-r--r--gcc/rust/parse/rust-parse-impl.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h
index 18acc93..49e8a5c 100644
--- a/gcc/rust/parse/rust-parse-impl.h
+++ b/gcc/rust/parse/rust-parse-impl.h
@@ -1218,8 +1218,9 @@ Parser<ManagedTokenSource>::parse_outer_attribute ()
if (lexer.peek_token ()->get_id () == INNER_DOC_COMMENT)
{
Error error (
- lexer.peek_token ()->get_locus (),
- "inner doc (%<//!%> or %</*!%>) only allowed at start of item "
+ lexer.peek_token ()->get_locus (), ErrorCode::E0753,
+ "expected outer doc comment, inner doc (%<//!%> or %</*!%>) only "
+ "allowed at start of item "
"and before any outer attribute or doc (%<#[%>, %<///%> or %</**%>)");
add_error (std::move (error));
lexer.skip_token ();