File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -2996,7 +2996,14 @@ pub impl Resolver {
29962996 let imports: & mut ~[ @ImportDirective ] = & mut * module_. imports ;
29972997 let import_count = imports. len ( ) ;
29982998 if index != import_count {
2999- self . session . span_err ( imports[ index] . span , ~"unresolved import") ;
2999+ let sn = self . session . codemap . span_to_snippet ( imports[ index] . span ) ;
3000+ if str:: contains ( sn, "::" ) {
3001+ self . session . span_err ( imports[ index] . span , ~"unresolved import") ;
3002+ } else {
3003+ let err = fmt ! ( "unresolved import (maybe you meant `%s::*`?)" ,
3004+ sn. slice( 0 , sn. len( ) - 1 ) ) ; // -1 to adjust for semicolon
3005+ self . session . span_err ( imports[ index] . span , err) ;
3006+ }
30003007 }
30013008
30023009 // Descend into children and anonymous children.
You can’t perform that action at this time.
0 commit comments