From f7c8a712be233f492b21bb1a4c4a3aa5f07b184b Mon Sep 17 00:00:00 2001 From: Kushal Pal Date: Tue, 16 Jan 2024 19:06:35 +0530 Subject: [PATCH] gccrs: Fix inconsistent formatting gcc/rust/ChangeLog: * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Enclose const in single quotes. gcc/testsuite/ChangeLog: * rust/compile/const_trait_fn.rs: Enclose const in single quotes. Signed-off-by: Kushal Pal --- gcc/rust/checks/errors/rust-ast-validation.cc | 2 +- gcc/testsuite/rust/compile/const_trait_fn.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/rust/checks/errors/rust-ast-validation.cc b/gcc/rust/checks/errors/rust-ast-validation.cc index 0ed5d060894..ccb071f74b0 100644 --- a/gcc/rust/checks/errors/rust-ast-validation.cc +++ b/gcc/rust/checks/errors/rust-ast-validation.cc @@ -149,7 +149,7 @@ ASTValidation::visit (AST::TraitFunctionDecl &decl) "functions in traits cannot be declared %"); if (qualifiers.is_const ()) rust_error_at (decl.get_identifier ().get_locus (), ErrorCode::E0379, - "functions in traits cannot be declared const"); + "functions in traits cannot be declared %"); } } diff --git a/gcc/testsuite/rust/compile/const_trait_fn.rs b/gcc/testsuite/rust/compile/const_trait_fn.rs index cff2f5f096e..41bba3b5335 100644 --- a/gcc/testsuite/rust/compile/const_trait_fn.rs +++ b/gcc/testsuite/rust/compile/const_trait_fn.rs @@ -1,4 +1,4 @@ trait Osterkz { const fn x(); - // { dg-error "functions in traits cannot be declared const .E0379." "" { target *-*-* } .-1 } + // { dg-error "functions in traits cannot be declared .const." "" { target *-*-* } .-1 } } -- 2.11.4.GIT