aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src/visibility.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_def/src/visibility.rs')
-rw-r--r--crates/ra_hir_def/src/visibility.rs21
1 files changed, 1 insertions, 20 deletions
diff --git a/crates/ra_hir_def/src/visibility.rs b/crates/ra_hir_def/src/visibility.rs
index 1482d3be0..8136cb50c 100644
--- a/crates/ra_hir_def/src/visibility.rs
+++ b/crates/ra_hir_def/src/visibility.rs
@@ -6,7 +6,7 @@ use ra_syntax::ast;
6use crate::{ 6use crate::{
7 db::DefDatabase, 7 db::DefDatabase,
8 path::{ModPath, PathKind}, 8 path::{ModPath, PathKind},
9 AssocContainerId, ModuleId, 9 ModuleId,
10}; 10};
11 11
12/// Visibility of an item, not yet resolved. 12/// Visibility of an item, not yet resolved.
@@ -25,25 +25,6 @@ impl RawVisibility {
25 RawVisibility::Module(path) 25 RawVisibility::Module(path)
26 } 26 }
27 27
28 pub(crate) fn default_for_container(container_id: AssocContainerId) -> Self {
29 match container_id {
30 AssocContainerId::TraitId(_) => RawVisibility::Public,
31 _ => RawVisibility::private(),
32 }
33 }
34
35 pub(crate) fn from_ast_with_default(
36 db: &dyn DefDatabase,
37 default: RawVisibility,
38 node: InFile<Option<ast::Visibility>>,
39 ) -> RawVisibility {
40 Self::from_ast_with_hygiene_and_default(
41 node.value,
42 default,
43 &Hygiene::new(db.upcast(), node.file_id),
44 )
45 }
46
47 pub(crate) fn from_ast( 28 pub(crate) fn from_ast(
48 db: &dyn DefDatabase, 29 db: &dyn DefDatabase,
49 node: InFile<Option<ast::Visibility>>, 30 node: InFile<Option<ast::Visibility>>,