diff --git a/src/librustc/middle/resolve.rs b/src/librustc/middle/resolve.rs index a962ea07c54225fc79f5288a67720e2e07609181..95b8281d4b2aa0b20faf580f078c5081c8173272 100644 --- a/src/librustc/middle/resolve.rs +++ b/src/librustc/middle/resolve.rs @@ -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 => {