Improve an error message in resolve

This commit is contained in:
Tim Chevalier 2011-06-09 10:02:48 -07:00
parent b34a97de39
commit d1819fb747

View File

@ -903,9 +903,16 @@ fn l_i_m_r(&env e, &def m, &span sp, &ident id,
ret some[def](matches.(0));
} else {
for (def match in matches) {
e.sess.span_note(e.ast_map.get
(ast::def_id_of_def(match)).span,
"'" + id + "' is defined here.");
alt (e.ast_map.find(ast::def_id_of_def(match))) {
case (some(?it)) {
e.sess.span_note(it.span,
"'" + id + "' is defined here.");
}
case (_) {
e.sess.bug("Internal error: imports and matches "
+ "don't agree");
}
}
}
e.sess.span_err(sp, "'" + id + "' is glob-imported from" +
" multiple different modules.");