Skip to content

Commit 426ad08

Browse files
committed
---
yaml --- r: 79317 b: refs/heads/try c: 7b579c0 h: refs/heads/master i: 79315: 4d9d4a6 v: v3
1 parent 88348b0 commit 426ad08

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
@@ -2,7 +2,7 @@
22
refs/heads/master: 3e6de6b7da8ee88bf84b0e217900051334be08da
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 60fba4d7d677ec098e6a43014132fe99f7547363
5-
refs/heads/try: 5dc1b39b6a12ae791aea1273667fa7359467340b
5+
refs/heads/try: 7b579c065a82ee00956ee26fddf48e84d8132936
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/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)