aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src/nameres/raw.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-11-08 21:24:02 +0000
committerGitHub <[email protected]>2019-11-08 21:24:02 +0000
commit23939cabcc10ecc045a97361df182b9b4db32953 (patch)
tree27fba5036ac9154c64acb97251fdbd50ee11f0dd /crates/ra_hir_def/src/nameres/raw.rs
parentee798a02b399acf7bfdfa826ecce0dcc67eaa308 (diff)
parentc626a677e831e820e8a1510b198de150675c71df (diff)
Merge #2196
2196: Touch up nameres doc comment r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir_def/src/nameres/raw.rs')
-rw-r--r--crates/ra_hir_def/src/nameres/raw.rs48
1 files changed, 24 insertions, 24 deletions
diff --git a/crates/ra_hir_def/src/nameres/raw.rs b/crates/ra_hir_def/src/nameres/raw.rs
index cb47fa317..369376f30 100644
--- a/crates/ra_hir_def/src/nameres/raw.rs
+++ b/crates/ra_hir_def/src/nameres/raw.rs
@@ -88,7 +88,7 @@ impl RawItems {
88 (Arc::new(collector.raw_items), Arc::new(collector.source_map)) 88 (Arc::new(collector.raw_items), Arc::new(collector.source_map))
89 } 89 }
90 90
91 pub fn items(&self) -> &[RawItem] { 91 pub(super) fn items(&self) -> &[RawItem] {
92 &self.items 92 &self.items
93 } 93 }
94} 94}
@@ -125,19 +125,19 @@ impl Index<Macro> for RawItems {
125type Attrs = Option<Arc<[Attr]>>; 125type Attrs = Option<Arc<[Attr]>>;
126 126
127#[derive(Debug, PartialEq, Eq, Clone)] 127#[derive(Debug, PartialEq, Eq, Clone)]
128pub struct RawItem { 128pub(super) struct RawItem {
129 attrs: Attrs, 129 attrs: Attrs,
130 pub kind: RawItemKind, 130 pub(super) kind: RawItemKind,
131} 131}
132 132
133impl RawItem { 133impl RawItem {
134 pub fn attrs(&self) -> &[Attr] { 134 pub(super) fn attrs(&self) -> &[Attr] {
135 self.attrs.as_ref().map_or(&[], |it| &*it) 135 self.attrs.as_ref().map_or(&[], |it| &*it)
136 } 136 }
137} 137}
138 138
139#[derive(Debug, PartialEq, Eq, Clone, Copy)] 139#[derive(Debug, PartialEq, Eq, Clone, Copy)]
140pub enum RawItemKind { 140pub(super) enum RawItemKind {
141 Module(Module), 141 Module(Module),
142 Import(ImportId), 142 Import(ImportId),
143 Def(Def), 143 Def(Def),
@@ -145,11 +145,11 @@ pub enum RawItemKind {
145} 145}
146 146
147#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] 147#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
148pub struct Module(RawId); 148pub(super) struct Module(RawId);
149impl_arena_id!(Module); 149impl_arena_id!(Module);
150 150
151#[derive(Debug, PartialEq, Eq)] 151#[derive(Debug, PartialEq, Eq)]
152pub enum ModuleData { 152pub(super) enum ModuleData {
153 Declaration { name: Name, ast_id: FileAstId<ast::Module> }, 153 Declaration { name: Name, ast_id: FileAstId<ast::Module> },
154 Definition { name: Name, ast_id: FileAstId<ast::Module>, items: Vec<RawItem> }, 154 Definition { name: Name, ast_id: FileAstId<ast::Module>, items: Vec<RawItem> },
155} 155}
@@ -160,26 +160,26 @@ impl_arena_id!(ImportId);
160 160
161#[derive(Debug, Clone, PartialEq, Eq)] 161#[derive(Debug, Clone, PartialEq, Eq)]
162pub struct ImportData { 162pub struct ImportData {
163 pub path: Path, 163 pub(super) path: Path,
164 pub alias: Option<Name>, 164 pub(super) alias: Option<Name>,
165 pub is_glob: bool, 165 pub(super) is_glob: bool,
166 pub is_prelude: bool, 166 pub(super) is_prelude: bool,
167 pub is_extern_crate: bool, 167 pub(super) is_extern_crate: bool,
168 pub is_macro_use: bool, 168 pub(super) is_macro_use: bool,
169} 169}
170 170
171#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] 171#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
172pub struct Def(RawId); 172pub(super) struct Def(RawId);
173impl_arena_id!(Def); 173impl_arena_id!(Def);
174 174
175#[derive(Debug, PartialEq, Eq)] 175#[derive(Debug, PartialEq, Eq)]
176pub struct DefData { 176pub(super) struct DefData {
177 pub name: Name, 177 pub(super) name: Name,
178 pub kind: DefKind, 178 pub(super) kind: DefKind,
179} 179}
180 180
181#[derive(Debug, PartialEq, Eq, Clone, Copy)] 181#[derive(Debug, PartialEq, Eq, Clone, Copy)]
182pub enum DefKind { 182pub(super) enum DefKind {
183 Function(FileAstId<ast::FnDef>), 183 Function(FileAstId<ast::FnDef>),
184 Struct(FileAstId<ast::StructDef>), 184 Struct(FileAstId<ast::StructDef>),
185 Union(FileAstId<ast::StructDef>), 185 Union(FileAstId<ast::StructDef>),
@@ -191,15 +191,15 @@ pub enum DefKind {
191} 191}
192 192
193#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] 193#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
194pub struct Macro(RawId); 194pub(super) struct Macro(RawId);
195impl_arena_id!(Macro); 195impl_arena_id!(Macro);
196 196
197#[derive(Debug, PartialEq, Eq)] 197#[derive(Debug, PartialEq, Eq)]
198pub struct MacroData { 198pub(super) struct MacroData {
199 pub ast_id: FileAstId<ast::MacroCall>, 199 pub(super) ast_id: FileAstId<ast::MacroCall>,
200 pub path: Path, 200 pub(super) path: Path,
201 pub name: Option<Name>, 201 pub(super) name: Option<Name>,
202 pub export: bool, 202 pub(super) export: bool,
203} 203}
204 204
205struct RawItemsCollector { 205struct RawItemsCollector {