diff options
author | Jakub Dupak <dev@jakubdupak.com> | 2023-12-11 21:52:48 +0100 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-01-30 12:36:50 +0100 |
commit | 35d5f82eaeaa849997039586109b0b302a88148a (patch) | |
tree | 04c714833b5bf94571a1d123532272e2ea0524a1 | |
parent | ed198edc9bfc17b4c2356068623aa31bda4e1ee7 (diff) | |
download | gcc-35d5f82eaeaa849997039586109b0b302a88148a.zip gcc-35d5f82eaeaa849997039586109b0b302a88148a.tar.gz gcc-35d5f82eaeaa849997039586109b0b302a88148a.tar.bz2 |
gccrs: BIR: Fix missed nodiscard
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>
-rw-r--r-- | gcc/rust/checks/errors/borrowck/rust-bir-builder-internal.h | 4 | ||||
-rw-r--r-- | gcc/rust/checks/errors/borrowck/rust-bir-place.h | 6 |
2 files changed, 5 insertions, 5 deletions
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 f33eb07..cd61151 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 66b131d..8c2df47 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 ()) |