]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: BIR: Fix missed nodiscard
authorJakub Dupak <dev@jakubdupak.com>
Mon, 11 Dec 2023 20:52:48 +0000 (21:52 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 30 Jan 2024 11:36:50 +0000 (12:36 +0100)
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
gcc/rust/checks/errors/borrowck/rust-bir-place.h

index f33eb0752446ba36951bcad565138a403ce4ed62..cd61151477669cf3ca1728162ab7a0ec6c484738 100644 (file)
@@ -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);
index 66b131dee1a7eedd2d038615b4dc53c31613c22e..8c2df47c11d11bfcc8f2a530efa629a0a88ff46c 100644 (file)
@@ -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 ())