Skip to content

Commit 7be856f

Browse files
committed
privacy: visibility: Add resolving for "private" items
1 parent 77afec7 commit 7be856f

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

gcc/rust/privacy/rust-visibility-resolver.cc

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,18 @@ bool
4747
VisibilityResolver::resolve_visibility (const HIR::Visibility &visibility,
4848
ModuleVisibility &to_resolve)
4949
{
50-
return false;
50+
switch (visibility.get_vis_type ())
51+
{
52+
case HIR::Visibility::PRIVATE:
53+
to_resolve = ModuleVisibility::create_restricted (peek_module ());
54+
return true;
55+
case HIR::Visibility::PUBLIC:
56+
// FIXME: We need to handle the restricted path here
57+
to_resolve = ModuleVisibility::create_public ();
58+
return true;
59+
default:
60+
return false;
61+
}
5162
}
5263

5364
DefId

0 commit comments

Comments
 (0)