From dfb5f548cee6874be343d3a337e9779ac30a5eb5 Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Thu, 7 Apr 2022 11:47:56 +0200 Subject: hir: Visibility: Add is_public() method --- gcc/rust/hir/tree/rust-hir-item.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gcc') diff --git a/gcc/rust/hir/tree/rust-hir-item.h b/gcc/rust/hir/tree/rust-hir-item.h index 2e35aea..70d5138 100644 --- a/gcc/rust/hir/tree/rust-hir-item.h +++ b/gcc/rust/hir/tree/rust-hir-item.h @@ -576,6 +576,9 @@ public: // Returns whether visibility is in an error state. bool is_error () const { return vis_type == ERROR; } + // Does the current visibility refer to a simple `pub ` entirely public + bool is_public () const { return vis_type == PUBLIC; } + // Creates an error visibility. static Visibility create_error () { -- cgit v1.1