diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-12-29 12:24:19 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-12-29 12:24:19 +0000 |
commit | cdcb3d3833d3d5b37b2cd4dac91a6e9366f20aea (patch) | |
tree | c9750e1ef8079a691caed3dc941392c99fda1524 /crates/ra_hir_def/src/nameres/tests.rs | |
parent | c5a48bea1218afb63d7932a6816f34c810bbab6b (diff) | |
parent | 9fd2c813ca355c3a1f10f54993c16e81778b867b (diff) |
Merge #2667
2667: Visibility r=matklad a=flodiebold
This adds the infrastructure for handling visibility (for fields and methods, not in name resolution) in the HIR and code model, and as a first application hides struct fields from completions if they're not visible from the current module. (We might want to relax this again later, but I think it's ok for now?)
Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/ra_hir_def/src/nameres/tests.rs')
-rw-r--r-- | crates/ra_hir_def/src/nameres/tests.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_hir_def/src/nameres/tests.rs b/crates/ra_hir_def/src/nameres/tests.rs index ff474b53b..78bcdc850 100644 --- a/crates/ra_hir_def/src/nameres/tests.rs +++ b/crates/ra_hir_def/src/nameres/tests.rs | |||
@@ -12,8 +12,8 @@ use test_utils::covers; | |||
12 | 12 | ||
13 | use crate::{db::DefDatabase, nameres::*, test_db::TestDB, LocalModuleId}; | 13 | use crate::{db::DefDatabase, nameres::*, test_db::TestDB, LocalModuleId}; |
14 | 14 | ||
15 | fn def_map(fixtute: &str) -> String { | 15 | fn def_map(fixture: &str) -> String { |
16 | let dm = compute_crate_def_map(fixtute); | 16 | let dm = compute_crate_def_map(fixture); |
17 | render_crate_def_map(&dm) | 17 | render_crate_def_map(&dm) |
18 | } | 18 | } |
19 | 19 | ||
@@ -32,7 +32,7 @@ fn render_crate_def_map(map: &CrateDefMap) -> String { | |||
32 | *buf += path; | 32 | *buf += path; |
33 | *buf += "\n"; | 33 | *buf += "\n"; |
34 | 34 | ||
35 | let mut entries = map.modules[module].scope.collect_resolutions(); | 35 | let mut entries: Vec<_> = map.modules[module].scope.resolutions().collect(); |
36 | entries.sort_by_key(|(name, _)| name.clone()); | 36 | entries.sort_by_key(|(name, _)| name.clone()); |
37 | 37 | ||
38 | for (name, def) in entries { | 38 | for (name, def) in entries { |