public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] privacy: visibility: Add resolving for "private" items
@ 2022-06-08 12:35 Thomas Schwinge
0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2022-06-08 12:35 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:7be856f7b6f39694f05c7c3453653046e48b3a52
commit 7be856f7b6f39694f05c7c3453653046e48b3a52
Author: Arthur Cohen <arthur.cohen@embecosm.com>
Date: Fri Apr 22 10:31:50 2022 +0200
privacy: visibility: Add resolving for "private" items
Diff:
---
gcc/rust/privacy/rust-visibility-resolver.cc | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/gcc/rust/privacy/rust-visibility-resolver.cc b/gcc/rust/privacy/rust-visibility-resolver.cc
index 2ca3bd75174..99f13674889 100644
--- a/gcc/rust/privacy/rust-visibility-resolver.cc
+++ b/gcc/rust/privacy/rust-visibility-resolver.cc
@@ -47,7 +47,18 @@ bool
VisibilityResolver::resolve_visibility (const HIR::Visibility &visibility,
ModuleVisibility &to_resolve)
{
- return false;
+ switch (visibility.get_vis_type ())
+ {
+ case HIR::Visibility::PRIVATE:
+ to_resolve = ModuleVisibility::create_restricted (peek_module ());
+ return true;
+ case HIR::Visibility::PUBLIC:
+ // FIXME: We need to handle the restricted path here
+ to_resolve = ModuleVisibility::create_public ();
+ return true;
+ default:
+ return false;
+ }
}
DefId
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-06-08 12:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-08 12:35 [gcc/devel/rust/master] privacy: visibility: Add resolving for "private" items Thomas Schwinge
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).