aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/visibility.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_def/src/visibility.rs')
-rw-r--r--crates/hir_def/src/visibility.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/crates/hir_def/src/visibility.rs b/crates/hir_def/src/visibility.rs
index e79a91102..38da3132b 100644
--- a/crates/hir_def/src/visibility.rs
+++ b/crates/hir_def/src/visibility.rs
@@ -22,8 +22,7 @@ pub enum RawVisibility {
22 22
23impl RawVisibility { 23impl RawVisibility {
24 pub(crate) const fn private() -> RawVisibility { 24 pub(crate) const fn private() -> RawVisibility {
25 let path = ModPath { kind: PathKind::Super(0), segments: Vec::new() }; 25 RawVisibility::Module(ModPath::from_kind(PathKind::Super(0)))
26 RawVisibility::Module(path)
27 } 26 }
28 27
29 pub(crate) fn from_ast( 28 pub(crate) fn from_ast(
@@ -59,15 +58,15 @@ impl RawVisibility {
59 RawVisibility::Module(path) 58 RawVisibility::Module(path)
60 } 59 }
61 ast::VisibilityKind::PubCrate => { 60 ast::VisibilityKind::PubCrate => {
62 let path = ModPath { kind: PathKind::Crate, segments: Vec::new() }; 61 let path = ModPath::from_kind(PathKind::Crate);
63 RawVisibility::Module(path) 62 RawVisibility::Module(path)
64 } 63 }
65 ast::VisibilityKind::PubSuper => { 64 ast::VisibilityKind::PubSuper => {
66 let path = ModPath { kind: PathKind::Super(1), segments: Vec::new() }; 65 let path = ModPath::from_kind(PathKind::Super(1));
67 RawVisibility::Module(path) 66 RawVisibility::Module(path)
68 } 67 }
69 ast::VisibilityKind::PubSelf => { 68 ast::VisibilityKind::PubSelf => {
70 let path = ModPath { kind: PathKind::Plain, segments: Vec::new() }; 69 let path = ModPath::from_kind(PathKind::Plain);
71 RawVisibility::Module(path) 70 RawVisibility::Module(path)
72 } 71 }
73 ast::VisibilityKind::Pub => RawVisibility::Public, 72 ast::VisibilityKind::Pub => RawVisibility::Public,