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 {
2996
2996
let imports: & mut ~[ @ImportDirective ] = & mut * module_. imports ;
2997
2997
let import_count = imports. len ( ) ;
2998
2998
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
+ }
3000
3007
}
3001
3008
3002
3009
// Descend into children and anonymous children.
You can’t perform that action at this time.
0 commit comments