Skip to content

Commit 8852fdb

Browse files
committed
---
yaml --- r: 79220 b: refs/heads/auto c: 7fd5bdc h: refs/heads/master v: v3
1 parent 5261d1e commit 8852fdb

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 72ee6af4d4e4d16a81e3f518f9c75f513a9a7dea
16+
refs/heads/auto: 7fd5bdcb9a6d090276c0366f2c55975c153ac088
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/librustc/middle/resolve.rs

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4706,25 +4706,13 @@ impl Resolver {
47064706
return NoNameDefinition;
47074707
}
47084708

4709-
pub fn intern_module_part_of_path(@mut self, path: &Path) -> ~[Ident] {
4710-
let mut module_path_idents = ~[];
4711-
for (index, segment) in path.segments.iter().enumerate() {
4712-
if index == path.segments.len() - 1 {
4713-
break;
4714-
}
4715-
4716-
module_path_idents.push(segment.identifier);
4717-
}
4718-
4719-
return module_path_idents;
4720-
}
4721-
4709+
// resolve a "module-relative" path, e.g. a::b::c
47224710
pub fn resolve_module_relative_path(@mut self,
47234711
path: &Path,
47244712
xray: XrayFlag,
47254713
namespace: Namespace)
47264714
-> Option<Def> {
4727-
let module_path_idents = self.intern_module_part_of_path(path);
4715+
let module_path_idents = path.segments.init().map(|ps| ps.identifier);
47284716

47294717
let containing_module;
47304718
match self.resolve_module_path(self.current_module,
@@ -4790,7 +4778,7 @@ impl Resolver {
47904778
xray: XrayFlag,
47914779
namespace: Namespace)
47924780
-> Option<Def> {
4793-
let module_path_idents = self.intern_module_part_of_path(path);
4781+
let module_path_idents = path.segments.init().map(|ps| ps.identifier);
47944782

47954783
let root_module = self.graph_root.get_module();
47964784

0 commit comments

Comments
 (0)