[COMMITTED,074/101] gccrs: BIR: Fix missed nodiscard

Message ID 20240130121026.807464-77-arthur.cohen@embecosm.com
State Committed
Commit 35d5f82eaeaa849997039586109b0b302a88148a
Headers
Series [COMMITTED,001/101] gccrs: Add visibility to trait item |

Commit Message

Arthur Cohen Jan. 30, 2024, 12:07 p.m. UTC
  From: Jakub Dupak <dev@jakubdupak.com>

gcc/rust/ChangeLog:

	* checks/errors/borrowck/rust-bir-builder-internal.h: Replace nodiscard.
	* checks/errors/borrowck/rust-bir-place.h: Replace nodiscard.

Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
---
 gcc/rust/checks/errors/borrowck/rust-bir-builder-internal.h | 4 ++--
 gcc/rust/checks/errors/borrowck/rust-bir-place.h            | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)
  

Patch

diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-builder-internal.h b/gcc/rust/checks/errors/borrowck/rust-bir-builder-internal.h
index f33eb075244..cd611514776 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-builder-internal.h
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-builder-internal.h
@@ -261,12 +261,12 @@  protected: // CFG helpers
 
 protected: // HIR resolution helpers
   template <typename T>
-  [[nodiscard]] TyTy::BaseType *lookup_type (T &hir_node) const
+  WARN_UNUSED_RESULT TyTy::BaseType *lookup_type (T &hir_node) const
   {
     return lookup_type (hir_node.get_mappings ().get_hirid ());
   }
 
-  [[nodiscard]] TyTy::BaseType *lookup_type (HirId hirid) const
+  WARN_UNUSED_RESULT TyTy::BaseType *lookup_type (HirId hirid) const
   {
     TyTy::BaseType *type = nullptr;
     bool ok = ctx.tyctx.lookup_type (hirid, &type);
diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-place.h b/gcc/rust/checks/errors/borrowck/rust-bir-place.h
index 66b131dee1a..8c2df47c11d 100644
--- a/gcc/rust/checks/errors/borrowck/rust-bir-place.h
+++ b/gcc/rust/checks/errors/borrowck/rust-bir-place.h
@@ -148,9 +148,9 @@  public:
       0);
   }
 
-  [[nodiscard]] PlaceId lookup_or_add_path (Place::Kind kind,
-					    TyTy::BaseType *tyty,
-					    PlaceId parent, size_t id = 0)
+  WARN_UNUSED_RESULT PlaceId lookup_or_add_path (Place::Kind kind,
+						 TyTy::BaseType *tyty,
+						 PlaceId parent, size_t id = 0)
   {
     PlaceId current = 0;
     if (parent < places.size ())