Skip to content

Commit bd33044

Browse files
committed
---
yaml --- r: 2758 b: refs/heads/master c: fbc0e84 h: refs/heads/master v: v3
1 parent c0c9e72 commit bd33044

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: bad05e20a35318c7790990683bcdf2d254c8059a
2+
refs/heads/master: fbc0e840e3e660c0f0acd3e738d005b2a4aec00f

trunk/src/comp/middle/resolve.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,10 +323,11 @@ fn resolve_import(&env e, &@ast::view_item it, &list[scope] sc) {
323323
auto end_id = ids.(n_idents - 1u);
324324

325325
if (n_idents == 1u) {
326+
auto next_sc = std::list::cdr(sc);
326327
register(e, defid, it.span, end_id,
327-
lookup_in_scope(e, sc, it.span, end_id, ns_value),
328-
lookup_in_scope(e, sc, it.span, end_id, ns_type),
329-
lookup_in_scope(e, sc, it.span, end_id, ns_module));
328+
lookup_in_scope(e, next_sc, it.span, end_id, ns_value),
329+
lookup_in_scope(e, next_sc, it.span, end_id, ns_type),
330+
lookup_in_scope(e, next_sc, it.span, end_id, ns_module));
330331
} else {
331332
auto dcur = lookup_in_scope_strict(e, sc, it.span, ids.(0),
332333
ns_module);
@@ -724,7 +725,7 @@ fn lookup_import(&env e, def_id defid, namespace ns) -> option::t[def] {
724725
ret lookup_import(e, defid, ns);
725726
}
726727
case (resolving(?sp)) {
727-
e.sess.span_err(sp, "cyclic import or nonexistent module");
728+
e.sess.span_err(sp, "cyclic import");
728729
}
729730
case (resolved(?val, ?typ, ?md)) {
730731
ret alt (ns) { case (ns_value) { val }
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// xfail-stage0
2-
// error-pattern: nonexistent module
2+
// error-pattern: unresolved import: vec
33
import vec;
44

55
fn main() {
6-
auto foo = vec.len([]);
6+
auto foo = vec::len([]);
77
}
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
// error-pattern:cyclic import
1+
// error-pattern: cyclic import
22

3-
import x;
3+
import y::x;
4+
5+
mod y {
6+
import x;
7+
}
48

59
fn main() {
6-
auto y = x;
710
}

0 commit comments

Comments
 (0)