[COMMITTED] gccrs: fmt: Skip warnings in Fmt class due to unused devirt method [PR122498]

arthur.cohen@embecosm.com arthur.cohen@embecosm.com
Wed Nov 12 17:52:17 GMT 2025


From: Arthur Cohen <arthur.cohen@embecosm.com>

Since this warning is not easily fixable, avoid it for now and wait for
the underlying issue to be resolved.

gcc/rust/ChangeLog:

	PR rust/122498
	* ast/rust-fmt.h: Add -Warray-bounds pragma to avoid the issue during
	bootstraps

Co-authored-by: Thomas Schwinge <tschwinge@gcc.gnu.org>
---
 gcc/rust/ast/rust-fmt.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gcc/rust/ast/rust-fmt.h b/gcc/rust/ast/rust-fmt.h
index e59bed3e9d2..0c25a4226c5 100644
--- a/gcc/rust/ast/rust-fmt.h
+++ b/gcc/rust/ast/rust-fmt.h
@@ -22,6 +22,10 @@
 #include "rust-system.h"
 #include "optional.h"
 
+// PR122498 "rust-enabled bootstrap is broken after r16-4897"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic warning "-Warray-bounds"
+
 namespace Rust {
 namespace Fmt {
 
@@ -429,4 +433,7 @@ private:
 } // namespace Fmt
 } // namespace Rust
 
+// PR122498 "rust-enabled bootstrap is broken after r16-4897"
+#pragma GCC diagnostic push
+
 #endif // !RUST_FMT_H
-- 
2.50.1



More information about the Gcc-rust mailing list