aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/nameres/path_resolution.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_def/src/nameres/path_resolution.rs')
-rw-r--r--crates/hir_def/src/nameres/path_resolution.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/crates/hir_def/src/nameres/path_resolution.rs b/crates/hir_def/src/nameres/path_resolution.rs
index 2a3ac5d7b..f2b59172d 100644
--- a/crates/hir_def/src/nameres/path_resolution.rs
+++ b/crates/hir_def/src/nameres/path_resolution.rs
@@ -149,7 +149,7 @@ impl DefMap {
149 path: &ModPath, 149 path: &ModPath,
150 shadow: BuiltinShadowMode, 150 shadow: BuiltinShadowMode,
151 ) -> ResolvePathResult { 151 ) -> ResolvePathResult {
152 let mut segments = path.segments.iter().enumerate(); 152 let mut segments = path.segments().iter().enumerate();
153 let mut curr_per_ns: PerNs = match path.kind { 153 let mut curr_per_ns: PerNs = match path.kind {
154 PathKind::DollarCrate(krate) => { 154 PathKind::DollarCrate(krate) => {
155 if krate == self.krate { 155 if krate == self.krate {
@@ -190,7 +190,7 @@ impl DefMap {
190 // BuiltinShadowMode wasn't Module, then we need to try 190 // BuiltinShadowMode wasn't Module, then we need to try
191 // resolving it as a builtin. 191 // resolving it as a builtin.
192 let prefer_module = 192 let prefer_module =
193 if path.segments.len() == 1 { shadow } else { BuiltinShadowMode::Module }; 193 if path.segments().len() == 1 { shadow } else { BuiltinShadowMode::Module };
194 194
195 log::debug!("resolving {:?} in module", segment); 195 log::debug!("resolving {:?} in module", segment);
196 self.resolve_name_in_module(db, original_module, &segment, prefer_module) 196 self.resolve_name_in_module(db, original_module, &segment, prefer_module)
@@ -203,10 +203,10 @@ impl DefMap {
203 None => match &self.block { 203 None => match &self.block {
204 Some(block) => { 204 Some(block) => {
205 // Look up remaining path in parent `DefMap` 205 // Look up remaining path in parent `DefMap`
206 let new_path = ModPath { 206 let new_path = ModPath::from_segments(
207 kind: PathKind::Super(lvl - i), 207 PathKind::Super(lvl - i),
208 segments: path.segments.clone(), 208 path.segments().to_vec(),
209 }; 209 );
210 log::debug!("`super` path: {} -> {} in parent map", path, new_path); 210 log::debug!("`super` path: {} -> {} in parent map", path, new_path);
211 return block.parent.def_map(db).resolve_path_fp_with_macro( 211 return block.parent.def_map(db).resolve_path_fp_with_macro(
212 db, 212 db,
@@ -258,10 +258,10 @@ impl DefMap {
258 curr_per_ns = match curr { 258 curr_per_ns = match curr {
259 ModuleDefId::ModuleId(module) => { 259 ModuleDefId::ModuleId(module) => {
260 if module.krate != self.krate { 260 if module.krate != self.krate {
261 let path = ModPath { 261 let path = ModPath::from_segments(
262 segments: path.segments[i..].to_vec(), 262 PathKind::Super(0),
263 kind: PathKind::Super(0), 263 path.segments()[i..].iter().cloned(),
264 }; 264 );
265 log::debug!("resolving {:?} in other crate", path); 265 log::debug!("resolving {:?} in other crate", path);
266 let defp_map = module.def_map(db); 266 let defp_map = module.def_map(db);
267 let (def, s) = defp_map.resolve_path(db, module.local_id, &path, shadow); 267 let (def, s) = defp_map.resolve_path(db, module.local_id, &path, shadow);