diff options
author | Jonas Schievink <[email protected]> | 2021-04-05 03:27:57 +0100 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2021-04-05 03:27:57 +0100 |
commit | 6f1ee9a7f4987d5286e6d875f544ce11f02465f3 (patch) | |
tree | b5786d42ad1fa6dd64863079a00150ec7e426fa6 /crates/hir_def/src | |
parent | 7c0c713a102ee86ee32af115acba63a5c3b3a657 (diff) |
simplify visibility.rs
Diffstat (limited to 'crates/hir_def/src')
-rw-r--r-- | crates/hir_def/src/visibility.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/hir_def/src/visibility.rs b/crates/hir_def/src/visibility.rs index 7d00a37c4..9908cd926 100644 --- a/crates/hir_def/src/visibility.rs +++ b/crates/hir_def/src/visibility.rs | |||
@@ -11,7 +11,7 @@ use crate::{ | |||
11 | nameres::DefMap, | 11 | nameres::DefMap, |
12 | path::{ModPath, PathKind}, | 12 | path::{ModPath, PathKind}, |
13 | resolver::HasResolver, | 13 | resolver::HasResolver, |
14 | FunctionId, HasModule, LocalFieldId, ModuleDefId, ModuleId, VariantId, | 14 | FunctionId, HasModule, LocalFieldId, ModuleId, VariantId, |
15 | }; | 15 | }; |
16 | 16 | ||
17 | /// Visibility of an item, not yet resolved. | 17 | /// Visibility of an item, not yet resolved. |
@@ -25,7 +25,7 @@ pub enum RawVisibility { | |||
25 | } | 25 | } |
26 | 26 | ||
27 | impl RawVisibility { | 27 | impl RawVisibility { |
28 | pub(crate) const fn private() -> RawVisibility { | 28 | pub(crate) fn private() -> RawVisibility { |
29 | RawVisibility::Module(ModPath::from_kind(PathKind::Super(0))) | 29 | RawVisibility::Module(ModPath::from_kind(PathKind::Super(0))) |
30 | } | 30 | } |
31 | 31 | ||
@@ -217,6 +217,6 @@ pub(crate) fn field_visibilities_query( | |||
217 | 217 | ||
218 | /// Resolve visibility of a function. | 218 | /// Resolve visibility of a function. |
219 | pub(crate) fn function_visibility_query(db: &dyn DefDatabase, def: FunctionId) -> Visibility { | 219 | pub(crate) fn function_visibility_query(db: &dyn DefDatabase, def: FunctionId) -> Visibility { |
220 | let resolver = ModuleDefId::from(def).module(db).unwrap().resolver(db); | 220 | let resolver = def.resolver(db); |
221 | db.function_data(def).visibility.resolve(db, &resolver) | 221 | db.function_data(def).visibility.resolve(db, &resolver) |
222 | } | 222 | } |