Skip to content

Commit d0c7549

Browse files
committed
ast: Visibility: Add has_path method
1 parent 5536d36 commit d0c7549

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

gcc/rust/ast/rust-item.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,9 @@ struct Visibility
640640
return vis_type == PUB_IN_PATH && in_path.is_empty ();
641641
}
642642

643+
// Returns whether a visibility has a path
644+
bool has_path () const { return !(is_error ()) && vis_type == PUB_IN_PATH; }
645+
643646
// Returns whether visibility is public or not.
644647
bool is_public () const { return vis_type != PRIV && !is_error (); }
645648

0 commit comments

Comments
 (0)