hir: Visibility: Add is_public() method

This commit is contained in:
Arthur Cohen 2022-04-07 11:47:56 +02:00
parent e01a814061
commit dfb5f548ce
1 changed files with 3 additions and 0 deletions

View File

@ -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 <item>` entirely public
bool is_public () const { return vis_type == PUBLIC; }
// Creates an error visibility.
static Visibility create_error ()
{