Skip to content

Commit 0cde71b

Browse files
committed
---
yaml --- r: 61313 b: refs/heads/try c: 8a69dba h: refs/heads/master i: 61311: 9f2e87b v: v3
1 parent b98d31a commit 0cde71b

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
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: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 2d28d645422c1617be58c8ca7ad9a457264ca850
5-
refs/heads/try: 3bfc1ca91d6f46bcfad71f0096b3f5a49718d421
5+
refs/heads/try: 8a69dba84a1be53949d0c24452b9910c7119ed68
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: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2596,11 +2596,17 @@ pub impl Resolver {
25962596
match module_prefix_result {
25972597
Failed => {
25982598
let mpath = self.idents_to_str(module_path);
2599-
let idx = str::rfind(self.idents_to_str(module_path), |c| { c == ':' }).unwrap();
2600-
self.session.span_err(span, fmt!("unresolved import: could not find `%s` in `%s`",
2601-
str::substr(mpath, idx, mpath.len() - idx),
2602-
// idx - 1 to account for the extra semicolon
2603-
str::substr(mpath, 0, idx - 1)));
2599+
match str::rfind(self.idents_to_str(module_path), |c| { c == ':' }) {
2600+
Some(idx) => {
2601+
self.session.span_err(span, fmt!("unresolved import: could not find `%s` \
2602+
in `%s`", str::substr(mpath, idx,
2603+
mpath.len() - idx),
2604+
// idx - 1 to account for the extra
2605+
// colon
2606+
str::substr(mpath, 0, idx - 1)));
2607+
},
2608+
None => (),
2609+
};
26042610
return Failed;
26052611
}
26062612
Indeterminate => {

0 commit comments

Comments
 (0)