提交 03f75b62 编写于 作者: C Corey Richardson

Better error reporting with renaming imports

上级 043d0221
......@@ -2593,7 +2593,12 @@ fn resolve_module_path_for_import(@mut self,
let start_index;
match module_prefix_result {
Failed => {
self.session.span_err(span, ~"unresolved name");
let mpath = self.idents_to_str(module_path);
let idx = str::rfind(self.idents_to_str(module_path), |c| { c == ':' }).unwrap();
self.session.span_err(span, fmt!("unresolved import: could not find `%s` in `%s`",
str::substr(mpath, idx, mpath.len() - idx),
// idx - 1 to account for the extra semicolon
str::substr(mpath, 0, idx - 1)));
return Failed;
}
Indeterminate => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册