@@ -2086,8 +2086,11 @@ impl Resolver {
2086
2086
match self . resolve_import_for_module( module_, import_directive) {
2087
2087
Failed => {
2088
2088
// We presumably emitted an error. Continue.
2089
- self . session. span_err( import_directive. span,
2090
- ~"failed to resolve import") ;
2089
+ let idents = import_directive. module_path. get( ) ;
2090
+ let msg = fmt!( "failed to resolve import: %s",
2091
+ self . import_path_to_str( idents,
2092
+ * import_directive. subclass) ) ;
2093
+ self . session. span_err( import_directive. span, msg) ;
2091
2094
}
2092
2095
Indeterminate => {
2093
2096
// Bail out. We'll come around next time.
@@ -2117,6 +2120,26 @@ impl Resolver {
2117
2120
// XXX: Shouldn't copy here. We need string builder functionality.
2118
2121
return result;
2119
2122
}
2123
+
2124
+ fn import_directive_subclass_to_str( subclass: ImportDirectiveSubclass )
2125
+ -> ~str {
2126
+ match subclass {
2127
+ SingleImport ( _target, source, _ns) => self . session. str_of( source) ,
2128
+ GlobImport => ~"* "
2129
+ }
2130
+ }
2131
+
2132
+ fn import_path_to_str(idents: ~[ident], subclass: ImportDirectiveSubclass)
2133
+ -> ~str {
2134
+ if idents.is_empty() {
2135
+ self.import_directive_subclass_to_str(subclass)
2136
+ } else {
2137
+ fmt!(" %s:: %s",
2138
+ self . idents_to_str ( idents) ,
2139
+ self . import_directive_subclass_to_str ( subclass) )
2140
+ }
2141
+ }
2142
+
2120
2143
/**
2121
2144
* Attempts to resolve the given import. The return value indicates
2122
2145
* failure if we're certain the name does not exist, indeterminate if we
0 commit comments