[COMMITTED] gccrs: Fmt: Simplify pragma diagnostic setup

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


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

There was a typo in the original commit where the diagnostic context was not being popped,
however popping the context still causes issues while bootstrapping.

For now, just mark -Warray-bounds as a warning to fix bootstrap on trunk and think about
a proper fix (probably adding a push and pop on every file including rust-fmt.h...) later if
the C++ warning issue is still not fixed.

gcc/rust/ChangeLog:

	* ast/rust-fmt.h: Simplify diagnostic avoidance.
---
 gcc/rust/ast/rust-fmt.h | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/gcc/rust/ast/rust-fmt.h b/gcc/rust/ast/rust-fmt.h
index 0c25a4226c5..13dc7be58f0 100644
--- a/gcc/rust/ast/rust-fmt.h
+++ b/gcc/rust/ast/rust-fmt.h
@@ -23,7 +23,6 @@
 #include "optional.h"
 
 // PR122498 "rust-enabled bootstrap is broken after r16-4897"
-#pragma GCC diagnostic push
 #pragma GCC diagnostic warning "-Warray-bounds"
 
 namespace Rust {
@@ -433,7 +432,4 @@ 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