Improve nonexistent-module error message

The error message for (for example) "import vec;" without "use std;"
was "cyclic import", which was misleading because there were no
cycles. I changed it to "cyclic import or nonexistent module",
which doesn't break existing tests.
This commit is contained in:
Tim Chevalier 2011-05-24 10:46:48 -07:00
parent 029c1e71ff
commit bad05e20a3
2 changed files with 8 additions and 1 deletions

View File

@ -724,7 +724,7 @@ fn lookup_import(&env e, def_id defid, namespace ns) -> option::t[def] {
ret lookup_import(e, defid, ns);
}
case (resolving(?sp)) {
e.sess.span_err(sp, "cyclic import");
e.sess.span_err(sp, "cyclic import or nonexistent module");
}
case (resolved(?val, ?typ, ?md)) {
ret alt (ns) { case (ns_value) { val }

View File

@ -0,0 +1,7 @@
// xfail-stage0
// error-pattern: nonexistent module
import vec;
fn main() {
auto foo = vec.len([]);
}